futurice / freesound-android

Unofficial Android client for the Freesound Project
Apache License 2.0
85 stars 16 forks source link

Add View Lifecycle #116

Open peter-tackage opened 7 years ago

peter-tackage commented 7 years ago

The Views created by the RecyclerViewAdapter will stay bound to their ViewModels even when the host Activity/Fragment is paused/stopped. This means that changes may still be propagated to Views when it is unnecessary to do so. In terms of data binding; Views should be subject to the same lifecycle as their host Activity/Fragment.

peter-tackage commented 7 years ago

@luciapayo also brought up the question of whether ViewItems should even be bound because it bypasses the DiffUtils mechanism when the bound Observable emits a changed value.