Closed shubhamnanche closed 11 months ago
I am actually aware of the problems with theme change. To apply only light & dark theme easy, but the way the black theme was applied was not a great way. I will have to change the theme change method.
Your shared preferences tags are cluttered... Have you tried making a single class holding all the sharedpref tags in one place? That way, you'll get the exact string you need to get their values and it'll be more organised. I am trying to correct the way black, light and dark themes were implemented. Let me see what works well.
Your shared preferences tags are cluttered... Have you tried making a single class holding all the sharedpref tags in one place?
I have not tried only thought about it later (like- If I can manage time maybe I will do it 🙂) That way, you'll get the exact string you need to get their values and it'll be more organised.
Yeah, that's true. I am trying to correct the way black, light and dark themes were implemented. Let me see what works well.
👍
I have fixed light, dark and black theme modes on your app. I removed the change theme function to be invoked from radio button clicks to the positive button click of the dialog box (dialog fragment). But there are minute errors that I am able to see - the option menu items are not recreated and retain their previous mode's color, meaning let's say you have switched from light to black mode, when the app was in light mode, the menu items color was black, not it should have changed to white, right? But that doesn't happen. Weird behaviour... will have to dig deep into it to find out why that happens.
I'll create a PR once I am convinced with my solution :) Hope that will be accepted by you.
Description When I open the app for the first time after installing it, it opens with the Light Theme as the default theme selected. Although, it is the
Light Theme
that is displayed in the selection, the actual app theme is the one that is selected in the system-wide android theme mode in the android settings, which shouldn't be the case. Let's say I my device theme is "Dark Theme
" (for android 10+), and I am opening the app for the first time, the app opens in dark mode because of this issue, now I change the app theme toDark Theme
, nothing happens as it is already in the dark mode, and I again change it toLight Theme
, this time the app changes to light theme. Now, I close the app and remove it from the background (recents menu) as well, and I reopen the app, the expected behavior is the app must open inLight Theme
, but instead it follows the android's system-wide theme mode.To Reproduce Steps to reproduce the behavior:
Light Theme
as selected)Dark Theme
and back toLight Theme
Light Theme
, although the app is still displaying in dark modeExpected behavior The app should always be displayed in the theme that is shown as selected in the theme's alert dialog.