Recently I've been learning about architecture for Android, I find the journey of learning this topic pretty tough, so I hope to share my finding in this talk!
this lib I find it hard to use logic inside XML, cannot be tested android:visibility = "@{viewModel.diplayString != null ? View.VISIBLE : View.GONE}" also, RxJava provides more, manipulating streams https://medium.com/@Miqubel/4-reasons-im-not-using-android-data-binding-e62127c2650c google this term: android data binding library bad idea ” “ Observable is not compatible with RxJava 38
spaghetti code inside xml you can do more, manipulating streams viewModel.displayStringObservable.subscribe { displayTextView.text = it } https://github.com/worker8/learning-architecture-for-android 39
ViewModel, not View - (VM is bound to View automatically) TEST - Test: states of the screen - Junit test: lightweight Code Wise - Decoupled - Readability - Swap module (eg. view) easily 40
problem you’re trying to solve with arch Don’t focus on the solution! For trivial app, use no-architecture If project uses RxJava, use MVVM otherwise: use MVP personal advice… 42
" likes " + favoriteAnimal)}) .subscribe(outputViewModel) I’m making new MvpVmViewModel in every mutation MvpVmViewModel MvpVmViewModel MvpVmViewModel MvpVmViewModel MVP-VM 50