Closed rajasone closed 5 years ago
@spipau when we change the device orientation
LiveData subscriber
get call it's the default behavior of the LiveData, you are absolutely right
, I thought why don't we make a good UX experience by showing the toast ONLY once even though user is playing with orientation each second, the above solution is showing the toast only once when user swipe the refresh and our view model is exposing the Mutable live data which is not a good approach so i introduced a bit of the abstraction
@rajasone I understand very much why you did it, but isn't it still an overkill? I would argue that the user won't rotate the phone that often. Is it really necessary to code so much for such a little benefit? Maybe just saving the state in a variable in the ViewModel could solve your issue easier? It would survive the rotation and you don't need any new database requests and so on? Or you work with save instance state in the Fragment, also a valid solution?
@spipau yes you are absolutely right, let me refactor it to avoid current complex solution and thanks for clearing my confusion :)
I fixed a bug where it always displayed 25 blogs, even if I deactivated some in the Blogs list. I added the German translation and improved some code parts. Great Work @rajasone ! If you agree with the changes, then we can merge this branch 👍
I didn't test your solution, but isn't it way too complicated? I thought this is very easy to solve by just:
In
ICT4DNewsFragment
add a Toast toso it will be displayed every time a new update starts.
Add a TextView behind the Recycler View in the XML Layout and hide it, then do in
ICT4DNewsFragment
:Or did I miss something? 😄