
Concise and powerful syntax
//Create your data
val counter = mutableFieldOf(0)
//Display your data however you want
mainText.setText(counter)
evenOrOddText.setText(counter.transform {
if(it % 2 == 0) "Even" else "Odd"
})
container.setBackgroundColor(counter.transform {
Color.argb(min(it, 255), 0, 255, 0)
})
//Change the data whenever you want,
//changes will be applied automatically
button.setOnClickListener {
counter.increment()
}
//Create your data
MutableField<Integer> counter = MutableField.of(0);
//Display your data however you want
TextViewUtils.setText(mainText, counter);
TextViewUtils.setText(evenOrOddText, counter.transform(it ->
it % 2 == 0 ? "Even" : "Odd"
));
ViewUtils.setBackgroundColor(container, counter.transform(it ->
Color.argb(min(it, 255), 0, 255, 0)
));
//Change the data whenever you want,
//changes will be applied automatically
button.setOnClickListener(() -> {
counter.setValue(c -> c + 1);
});

The engine behind MoviesFad
Comparison with similar products
Dataflow* | LiveData | ReactiveX (RxJava) | |
---|---|---|---|
Async computing | check | clear | check |
Lifecycle aware | check |
check
Only on activities and fragments
|
clear |
Compatibility |
check
Any JVM based language
|
clear
Android™ only
|
check
Multiple languages
|
Data manipulation | check | check | check |
Weak listeners support | check | clear | clear |
Error handling | check | clear |
check
Errors terminate the stream
|
Advanced collection operations | check | clear | clear |
Delay and debounce operators | check | clear | check |
Directly set value on Android™ views |
check
Only in code
|
check
Only in XML
|
clear |
Android™ optimizations | check | check | clear |
Native Kotlin support | check | clear |
check
Afterthought, doesn't fully exploit Kotlin features
|
Commercial technical support | check | clear | clear |