Mahmud0808 / ColorBlendr

An Android app for customizing Material You colors on devices with Android 12+. It lets you tweak accent colors, background saturation, and more for a personalized look.
GNU General Public License v3.0
765 stars 14 forks source link

Wallpaper change changes theme back #40

Closed androidacy-user closed 6 months ago

androidacy-user commented 7 months ago

Hello!

Changing the wallpaper will sometimes completely revert ColorBlendr changes

Pixel stock 14, app 1.2

Mahmud0808 commented 7 months ago

Make sure ColorBlendr is running in background. How to make sure? Don't hide the notification, if the notification is being shown then it's running, otherwise it's not. Disable any battery saving or doze mode of ColorBlendr if you have enabled any.

androidacy-user commented 7 months ago

Make sure ColorBlendr is running in background. How to make sure? Don't hide the notification, if the notification is being shown then it's running, otherwise it's not. Disable any battery saving or doze mode of ColorBlendr if you have enabled any.

Occasionally it causes ColorBlendr to crash so none of that will help 😉

Sometimes even changing color in ColorBlendr kills the app

Mahmud0808 commented 7 months ago

Provide crash log. I have used on miui and currently on hyperos, both known to aggressively kill apps and so far I have no issue with ColorBlendr.

androidacy-user commented 7 months ago

Provide crash log. I have used on miui and currently on hyperos, both known to aggressively kill apps and so far I have no issue with ColorBlendr.

It's not being killed

It doesn't trigger consistently but I suspect it's android forcing a configuration change that closes the app, I seem to recall there being aosp docs that a monet change will force recreate activities or close apps in some cases

androidacy-user commented 7 months ago

Also, does miui even implement Monet properly lol

androidacy-user commented 7 months ago

I was just able to trigger it w/o the app actually crashing. Changing wallpaper changed the theme but resuming ColorBlendr was enough to change it back, although it also sometimes seems to require changing anything in ColorBlendr to force it to recreate themes

Mahmud0808 commented 7 months ago

Also, does miui even implement Monet properly lol

Nope they don't, just those 3rd party apps. Also some roms/modules can activate monet in miui.

Mahmud0808 commented 7 months ago

Provide crash logs if there is any crash, without that can't help much.

androidacy-user commented 7 months ago

Provide crash logs if there is any crash, without that can't help much.

Looking into it a bit deeper, the app doesn't actually crash. Android may finish the activity, which probably requires you to specify your activity will handle configuration changes and handle them, and the other times the app just doesn't seem to notice the theme is changing.

Keeping the app in recents, the app is not "dead" but the activity will sometimes refresh when I resume it, briefly showing the old theme and then reapplying ColorBlendr's, other times requiring a (any) tweak to the theming in ColorBlendr, which recreates the theme I assume.

Worth noting that repainter (admittedly closed source and abandoned and a bit broken) has a way to disable the system taking over Monet theming so that wallpaper changes don't change the theme but I have no idea how.

Also, note I'm using a third party wallpaper app to change wallpaper, not styles and wallpapers

androidacy-user commented 7 months ago

Battery optimization is of course disabled but pixel stock (as long as you don't purposely restrict battery usage) generally isn't very bad about killing apps either way

Mahmud0808 commented 7 months ago

I will check. I know about the activity recreation and I didn't consider it as a bug, cause it helps ColorBlendr to adapt colors of system and show the actual colors being applied. And also you can use logcat apps to check if ColorBlendr is correctly noticing wallpaper change. Every intent it receives is logged. And there's a 5 seconds cool down after each change, to avoid any intent loops or multiple received intents in a short time.

Linouxs commented 6 months ago

Just to let you know: I got the same problem here at a Nothing Phone 2 (Android 14). It doesn't happen often and when I change the wallpaper it keeps the Colorblendr theme so that is working fine. The app doesn't crash either but sometimes it randomly changes it back to the stock colors (most of the times when I just logged in after boot).

Changing settings in Colorblendr or disable and enable the service again turns it back to the Colorblendr theme or sometimes (not always) opening the app is enough while battery optimization is disabled for Colorblendr.

Love the app btw, its awesome how much you can customize. Keep up the great work!

Mahmud0808 commented 6 months ago

(most of the times when I just logged in after boot).

That can happen if ColorBlendr app failed to run after booting up. I can't think of any other reason.

Linouxs commented 6 months ago

When it happened after booting the device, I get the keyboard to type the sim pin. At that moment the colors of the buttons changes to the theme of Colorblendr. When I filled the sim pin and my password, the Colorblendr theme was still applied for a few seconds, then it changed back to the stock theme.

When it's working correctly, the same happens when I logged in but Colorblendr corrects it in a split second. So: sim pin keyboard keys changes from stock colors to Colorblendr colors after boot > after being logged in and a few seconds of waiting the Material You colors changes back to the stock theme for a split second and are immediately corrected to the Colorblendr theme.

I've zero knowledge how it works but it looks like that whatever application Nothing OS uses to set the Material You theme tries to overwrite the the Material You theme sometimes and in a very few cases succeeded.

Mahmud0808 commented 6 months ago

I've zero knowledge how it works but it looks like that whatever application Nothing OS uses to set the Material You theme tries to overwrite the the Material You theme sometimes and in a very few cases succeeded.

Can you check if NOS applies theme after unlocking phone when colorblendr is disabled? Or is it applies only when colorblendr applies its theme?

Linouxs commented 6 months ago

Just tested it a few times, the NOS theme is applied before the sim pin keyboard shows up after a reboot, but it doesn't look like that the NOS theme is reapplied after unlocking.

When Colorblendr is enabled and I pulled down the the quick settings menu immediately after reboot and unlocking it kind of looked like it refreshed the theme in the quick settings menu from Colorblendr to NOS to Colorblendr. It doesn't seem that the theme in quick settings refreshed when Colorblendr is disabled. It's hard to tell what's exactly happening but I hope that it helps.

Mahmud0808 commented 6 months ago

When Colorblendr is enabled and I pulled down the the quick settings menu immediately after reboot and unlocking it kind of looked like it refreshed the theme in the quick settings menu from Colorblendr to NOS to Colorblendr. It doesn't seem that the theme in quick settings refreshed when Colorblendr is disabled. It's hard to tell what's exactly happening but I hope that it helps.

Hmm I need to find some way to disable the stock theme overriding. Thanks for the info.

Mahmud0808 commented 6 months ago

Only for rooted users unfortunately https://github.com/Mahmud0808/ColorBlendr/commit/6438d4de6a87d9e68ca7a5666318c31da5c77949

Linouxs commented 6 months ago

Only for rooted users unfortunately 6438d4d

My phone is rooted so that wouldn't be a problem for me