android-dark-theme

App freezes after PreferenceSwitch in settings Android Studio

谁说胖子不能爱 提交于 2020-06-09 05:22:26
问题 I made settings activity from Android Studio, not manually. I want to make a switch that applies a dark mode in the app. The problem is that when I click the switch there is no animation for movement, only a blink from the app. When I go back in my Main Activity I see that the theme is applied(I have tried earlier only with the main activity), but when I try to go back in the settings everything is frozen! Nothing can be clicked, no reaction at all. This is my Java code: import androidx

App freezes after PreferenceSwitch in settings Android Studio

强颜欢笑 提交于 2020-06-09 05:21:12
问题 I made settings activity from Android Studio, not manually. I want to make a switch that applies a dark mode in the app. The problem is that when I click the switch there is no animation for movement, only a blink from the app. When I go back in my Main Activity I see that the theme is applied(I have tried earlier only with the main activity), but when I try to go back in the settings everything is frozen! Nothing can be clicked, no reaction at all. This is my Java code: import androidx

Android: How to switch theme for dark mode?

橙三吉。 提交于 2020-04-30 07:05:07
问题 Since Android 10, you can switch between dark mode and default light mode. I didn't make any closer research yet on this since it's a new topic. Is Dark mode color switching automatic by OS or is there any way to tell my App to switch different app-theme if Dark mode is turned on? Also dark mode is possibility for some Android 9 devices. Because I made custom Dark theme with custom parameters and I set dark color for each of my color in resources (using custom attributes in attrs.xml and

Supporting Dark & Light Theme in AndroidX [closed]

*爱你&永不变心* 提交于 2020-04-17 21:40:54
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 months ago . I currently use the following parent theme Theme.MaterialComponents.Light.NoActionBar and just updated my material design library to implementation 'com.google.android.material:material:1.1.0' which messed up some colors in my app So i am deciding to update it to support both light

How to automatically switch to dark mode on Android app?

橙三吉。 提交于 2020-02-25 06:20:47
问题 I'm making an Android app. I made another UI for dark mode. So this is what I need; the app will switch to dark theme automatically by the local time. For example, when the sun goes down by the local time, app will be switched to dark mode. Or another alternative is switching to dark mode by pre-setted time of the day. Hope you understand my problem. Please help me if anyone knows, I prefer the first option to do if it's possible. Thanks in advance. 回答1: Maybe you can have a look at

Dark theme configuration change in Android Q

安稳与你 提交于 2020-02-02 11:19:07
问题 I want to implement android 10 dark theme in my app , I have these following cases: SYSTEM_DEFAULT, NIGHT_MODE, LIGHT_MODE The problem is when I change theme from night or light to system_default from inside the app and it can not understand whether the system is in light mode or dark mode. so the theme won't be updated. I've tried the dark theme by google https://developer.android.com/guide/topics/ui/look-and-feel/darktheme and implementing the configuration still won't be good for me

Dark theme configuration change in Android Q

吃可爱长大的小学妹 提交于 2020-02-02 11:19:06
问题 I want to implement android 10 dark theme in my app , I have these following cases: SYSTEM_DEFAULT, NIGHT_MODE, LIGHT_MODE The problem is when I change theme from night or light to system_default from inside the app and it can not understand whether the system is in light mode or dark mode. so the theme won't be updated. I've tried the dark theme by google https://developer.android.com/guide/topics/ui/look-and-feel/darktheme and implementing the configuration still won't be good for me

implementing dark theme in my app; different color is showing in toolbar of different activity

主宰稳场 提交于 2019-12-13 02:55:40
问题 I wanted to implement dark theme in my app; it has a toolbar in mainactivity and action bar in other activity. I implemented dark theme in values/styles.xml as below: <resources> <style name="AppTheme" parent="Theme.MaterialComponents"> <item name="colorPrimary">@color/primary_material_dark</item> <item name="colorPrimaryDark">@color/primary_dark_material_dark</item> <item name="colorAccent">@color/material_deep_teal_200</item> </style> <style name="AppTheme.NoActionBar"> <item name=

WebView resetting UiMode and breaking dark theme

不问归期 提交于 2019-12-07 12:32:12
问题 Our app relies on AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) to make us pick up Light and Dark theme colors from values/colors and values-night/colors But every time we try to use the WebView , it starts by resetting the UiMode and our app gets confused which color values to pick for our themes Some people discussed the issue in detail here and here Anyone out there run into a similar issue? 回答1: Answering my own question, looks like Google fixed the issue https:/

WebView resetting UiMode and breaking dark theme

断了今生、忘了曾经 提交于 2019-12-06 02:35:46
Our app relies on AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) to make us pick up Light and Dark theme colors from values/colors and values-night/colors But every time we try to use the WebView , it starts by resetting the UiMode and our app gets confused which color values to pick for our themes Some people discussed the issue in detail here and here Anyone out there run into a similar issue? Answering my own question, looks like Google fixed the issue https://issuetracker.google.com/issues/37124582 with https://developer.android.com/jetpack/androidx/releases