jrpie / Launcher

A distraction-free minimal homescreen for Android.
https://f-droid.org/packages/de.jrpie.android.launcher/index.html
Other
45 stars 6 forks source link

Performance issue when toggling options in the menu #34

Open toby-bro opened 2 months ago

toby-bro commented 2 months ago

Describe the bug When toggling some options the app seems to freeze in the middle of toggling a switch...

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Settings'
  2. Click on Launcher
  3. Scroll down to 'Monochrome app icons'
  4. See error

Expected behavior I would expect the switch to finish toggling before the app starts its computations of changing the apps icons' color... And the change to happen in background

jrpie commented 2 months ago

And the change to happen in background

There is not really a good way to do this, as changing the theme is inherently a UI-related thing.

I really want to use Android themes for theming as this makes the code a lot cleaner. (Finn was working around this by setting the color of every single UI element manually, see for example this code).

In order to modify the actual theme one needs to restart the activity which is what causes the delay.

The only thing I could do here is to update the theme only when the user leaves the settings activity. But then there would be no instantaneous feedback to the user.

On the devices I tested this so far, the delay was noticable but not too bad. I think the current solution is the best tradeoff here.

The only real improvement can come from making the settings activity more performant in general.