I need to use multiple recyclerviews. In the below scenario I will require at least 6 recyclerviews. 6 = 1 for horizontal recyclerview + 3 for each fragment in viewpager + 1 for recylerview + 1 for grid layout.
As the data complexity is huge and each adapter data is dependent on changes from other adapters, I have decided to go with architecture components introduced in the android jetpack. So initially, I will integrate view model and live data. later incorporate room database (existing DB is in SQLite)
As I would be using multiple livedata to monitor adapter data changes. I want clear my doubts on performance aspects of view model and live data.
Performance overhead of using large number of live data :
I will require 6 to 7 live data to observe changes on each adapter data. To get an understanding of performance, assume some 50 ~ 60 live data is to be used.
Is it a best practice or recommended to use live data only with room?.
can we use it on adapter data or simple primitive types such as booleans, int etc (ex: isLoading: MutableLiveData, inputText: MutableLiveData textField string to monitor changes.)
Say someone may require it to have on a form which may have multiple number edit text, dropdown, multi-select etc with each having a live data attached to it.
- How live data works internally does it use some expensive resource to monitor change on a variable