January 2019
Intermediate to advanced
392 pages
10h 11m
English
The RxBinding library provides a reactive application programming interface. Let's imagine that we want to observe an input of EditText and display this text in TextView.
The RxBinding library provides extension functions for user interface components, such as textChanges:
fun TextView.textChanges(): InitialValueObservable<CharSequence> { return TextViewTextChangesObservable(this)}
We can implement our example by using the textChanges function, as follows:
class RxActivity : AppCompatActivity() { private val editText by lazy(LazyThreadSafetyMode.NONE) { findViewById<EditText>(R.id.editText) } private val textView by lazy(LazyThreadSafetyMode.NONE) { findViewById<TextView>(R.id.textView) } override fun onCreate(savedInstanceState ...
Read now
Unlock full access