droidconKE / droidconKE2020App

Android app fully written in Kotlin for droidconKE2020
120 stars 42 forks source link

Setup HomeViewModel in home module #45

Closed michaelbukachi closed 4 years ago

michaelbukachi commented 4 years ago

This ViewModel should handle all the logic for the home page. Use of livedata + data binding should be used to make binding to the UI easier. The logic in this ViewModel includes:

muth0mi commented 4 years ago

Is it ok to modify the recyclerView adapters to use listAdapter and diffCallback? And to introduce databinding in the adapters?

michaelbukachi commented 4 years ago

Hmm. What advantages does use of ListAdapter have over using a regular Adapter. Also, as much as we encouraging use of databinding, we are not enforcing it. What matters is the code is readable and testable. @wangerekaharun what do you think?

muth0mi commented 4 years ago

Main reason was to avoid calling notifyOnDatasetChanged upon feeding new data to the recyclerviews. I have had a discussion with @wangerekaharun to avoid huge breaking changes.

muth0mi commented 4 years ago

Showing CFP card for a given duration.

When should the card be hidden and shown?

muth0mi commented 4 years ago

Also, the promos? Is it a single promotion at a time or several in sort of a carousel?

wangerekaharun commented 4 years ago

For this PR i think its better you work on the viewmodel and tests part. Later on when we intergrate the API we can further see what areas we can address. The promos will be coming from the back end and its a single one not a list. So for a particular time, we can only have one promo running. If more, they go to the feed section.

muth0mi commented 4 years ago

Ok