feat(Tile/Dimmer): restart cycle if torch was disabled
Changes the DimmerSettingsTile to always start from the dimmest mode when the torch is disabled. Previously it would continue from the last mode, which was confusing for the user as the tile would suddenly behave differently when tapped. This could happen if the user was using the tile and then disabled the torch through another application (e.g., the At a Glance widget on Pixels). The tile will also update to show if the torch has been disabled by other means.
Hi, thanks for your contribution.
I've tested your PR but it seems the cycle is still a bit weird (it goes from "Off" to "Max" to "Half" to "Max" to "Min" or something):
https://i.imgur.com/Etr6vvx.mp4
Does it work on your side?
Yup, works pretty much perfectly over here, ~~have been testing it since I created the PR~~ (nvm, I thought this was https://github.com/cyb3rko/flashdim/pull/79. Not sure what you're planning, but it might be better to merge https://github.com/cyb3rko/flashdim/pull/79 instead of this one, as it completely replaces the changes made in this PR). Maybe it's a problem with the old state save interfering? I had some of these problems during development, but managed to fix them at some point.
https://github.com/user-attachments/assets/8a879495-3566-476c-bf6d-fa97c801531a
I've investigated this issue and it seems that the settings tiles work fine without problems when being used on their one, so by not having both of them in the quick settings pane.
I will take a look at #79 and try to fix this issue there.
@FineFindus I tried to apply your changes to the current state of the app. Could you please test out if it works for you as expected?
The reset works, however both the min and half stage now show the text of the half stage.
Thank you. I think I've found the fix, will test it in a bit.
Then you can test again and we can finally merge.
Could you test again please?
Works fine for me now, I will merge it.
If you find problems in the future with the implementation, please let me know.