For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| apply from: './flavors.gradle' | |
| ... | |
| android { | |
| buildTypes { | |
| productFlavors { | |
| project.flavors.each { flavor, config -> | |
| "$flavor" { | |
| dimension 'scope' | |
| if (flavor != 'full') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyCustomTextView(ctx: Context) : MyCustomTextView(ctx), TextView | |
| inline fun ViewManager.myCustomTextView(init: MyCustomTextView.() -> Unit = {})= ankoView({ MyCustomTextView(it) }, theme = 0, init) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| linearLayout { | |
| orientation = LinearLayout.VERTICAL | |
| val myEdt = editText { | |
| hint = "Name" | |
| }.lparams(width = matchParent, height = wrapContent) | |
| button("Say Hello") { | |
| onClick { | |
| val message = if (myEdt.text.toString().isBlank()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| linearLayout { | |
| orientation = LinearLayout.VERTICAL | |
| editText { | |
| hint = "Name" | |
| }.lparams(width = matchParent, height = wrapContent) | |
| button("Say Hello") { | |
| }.lparams(width = matchParent, height = wrapContent) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout android:id="@+id/main_root" | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context="com.wisnu.uicomponent.MainActivity"> | |
| <EditText |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.reactivex.Observable | |
| import io.reactivex.Observer | |
| import io.reactivex.disposables.Disposable | |
| import io.reactivex.schedulers.Schedulers | |
| fun main(args: Array<String>) { | |
| val data: MutableList<String> = mutableListOf("Andi", "Beni", "Deni", "Fani", "Gita") | |
| Observable | |
| .just(data) | |
| .observeOn(Schedulers.io()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.reactivex.Observable | |
| import io.reactivex.Observer | |
| import io.reactivex.disposables.Disposable | |
| import io.reactivex.schedulers.Schedulers | |
| fun main(args: Array<String>) { | |
| val data: MutableList<String> = mutableListOf("Andi", "Beni", "Deni", "Fani", "Gita") // Sumber data | |
| val observer = object : Observer<MutableList<String>> { // Membuat observer | |
| override fun onNext(p0: MutableList<String>) { | |
| // Do something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Functional interface for binding data to a view | |
| */ | |
| public interface ViewBinder<V extends View> { | |
| void bindView(V view, ViewItem<V> item); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Pager<I, O> { | |
| private static final Observable FINISH_SEQUENCE = Observable.never(); | |
| private PublishSubject<Observable<I>> pages; | |
| private Observable<I> nextPage = finish(); | |
| private Subscription subscription = Subscriptions.empty(); | |
| private final PagingFunction<I> pagingFunction; | |
| private final Func1<I, O> pageTransformer; |