mpcjanssen / simpletask-android

GNU General Public License v3.0
545 stars 124 forks source link

Left drawer redraws every filter change #820

Open smichel17 opened 6 years ago

smichel17 commented 6 years ago

Any time the filter is updated, the left drawer redraws itself. A side effect is that, if you have enough lists/tags that the drawer is scrollable, changing the filter from the drawer will redraw the drawer and the list will jump to the top, and you have to scroll back down if you want to make another modification to the filter.

v10.0.6

smichel17 commented 6 years ago

This happens because checking or unchecking an item updates the UI (Simpletask.kt L1667), in order to update the task list. However, updating the UI also refreshes the drawer, to respond to when a new filter is selected (since there is currently no difference between changing the filter from the left or right drawer).

In order to fix this, I think we should separate the Update UI broadcast into two: Update active filter and update visible tasks.

mpcjanssen commented 6 years ago

Really the whole UI refreshing needs to be redesigned. Too many things are happening as a result of the omnipotent refresh UI now.

This needs to be split into events which describe what happend instead of how the elements what the elements need to do. That decision should be up to the elements. So instead of refresh_ui, we will need things like:

1) Filter updated 2) Remote file changed 3) Todo file changed

etc.

smichel17 commented 6 years ago

How does this interact with possibly using a reactive framework, as mentioned in #639?

mpcjanssen commented 6 years ago

Using a reactive framework would ideally only refresh the drawers if the actual list of tags or lists would change.

smichel17 commented 6 years ago

I mean, is it something you want to look into, or not worry about for now?

mpcjanssen commented 6 years ago

Would like it to be fixed without using a compete reactive framework.