android-dark-theme

Disable dark theme in Ionic

北战南征 提交于 2021-02-18 12:42:09
问题 I'm designing an Ionic app, and I would like it to have white backgrounds and black texts whether the user has enabled the dark theme or not . This is what I want: However, when I enable the dark theme on an Android phone, it gets automatically converted to this: I want to prevent this from happening. I've searched online and found many articles that describe how to apply the dark theme, but I haven't found anything about disabling it. One solution I've thought about is explicitly enabling

How to use @media (prefers-color-scheme) in responsive email in Gmail?

陌路散爱 提交于 2021-02-16 18:21:27
问题 Following CSS is in head of HTML email to change email body color when the device in dark mode. @media (prefers-color-scheme: dark) { .white-cont { background: red !important; } } It turns body of email only in apple mail app. Gmail app does nothing the entire mail is converted to dark color scheme automatically which is not so good. How to make dark-mode-responsive a gmail email? Why the above tag does not work in gmail? Any solutions? 回答1: Dark Mode is a trend in email development to

Why is Android inverting some of my drawables for dark theme (night) but not others?

倾然丶 夕夏残阳落幕 提交于 2021-02-07 19:50:59
问题 My app uses the Theme.AppCompat.DayNight.NoActionBar AppTheme , and has a navigation drawer. All my drawables are XML vectors and the paths in them are black. For the uses of these drawables that are in the menu in my sidenav, something somewhere in Android or the SDK has inverted the drawable such that my paths are in fact white (or a colour close to white, maybe it's actually colorAccent ). This is good. But when I place the same drawable myself in the action bar as a menu item, it isn't

Night Mode color is not applying to the recycler view background

强颜欢笑 提交于 2021-01-27 21:03:08
问题 I want to implement night mode for my android app so I have used Theme.AppCompat.DayNight theme for implementing Night Mode. But I have to customize the color of the Toolbar and recycler view during the Night Mode. For that, I have declared the attribute in the attrs.xml file and use that attribute as a background in the recyclerview. Here is the attrs.xml file <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="ds"> <attr name="rv_color" format="color"/> </declare

Dark Theme in android 9.0 changes my app layouts ugly

こ雲淡風輕ζ 提交于 2021-01-27 13:48:55
问题 I am just designing my layout without expecting any of the problems, but one-day android 9.0 launched and I brought the phone and installed my app in it and tried my app opening it with night mode ON and I started to see white color layout changes in dark and my minds goes block. I want to know how to disable the theme. I tried changing themes, changing the background colors none of those works <RelativeLayout android:layout_width="190dp" android:layout_height="200dp" android:layout_marginTop

MIUI 11/12 Theme Switch Results in LifeCycleException, ClassCastException

柔情痞子 提交于 2020-12-26 16:33:31
问题 Since MIUI 11/12 Use Its Own Custom Implementation of Dark Mode, using below code results in ClassCastException and Activity Life Cycle Exception, as DefaultNightMode and LocalNightMode is always Unspecified i.e. -100 instead of 0 or 1. If anyone has built a workaround for Xiaomi Devices specially for MIUI 11/12. Please Help Me Out On this. Code Used: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); this.recreate(); Error Caused: 2020-10-25 07:04:43.626 9167-9167/com

MIUI 11/12 Theme Switch Results in LifeCycleException, ClassCastException

Deadly 提交于 2020-12-26 16:32:45
问题 Since MIUI 11/12 Use Its Own Custom Implementation of Dark Mode, using below code results in ClassCastException and Activity Life Cycle Exception, as DefaultNightMode and LocalNightMode is always Unspecified i.e. -100 instead of 0 or 1. If anyone has built a workaround for Xiaomi Devices specially for MIUI 11/12. Please Help Me Out On this. Code Used: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); this.recreate(); Error Caused: 2020-10-25 07:04:43.626 9167-9167/com

How to avoid forced dark theme in my app when devices can force it at app level?

落花浮王杯 提交于 2020-11-28 02:49:39
问题 Some devices, like Poco F2 Pro , can force dark theme in apps that are not compatible with dark theme. For example, my app has this theme and is not compatible with dark theme: <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> This is my manifest application part, no dark theme enabled: <application android:name=".helpers.CustomApplication" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android