Shadowsocks-android: The popup menu background color following the system theme, but the font color will not change

Created on 31 Mar 2018  ·  14Comments  ·  Source: shadowsocks/shadowsocks-android

Environment

  • Android version: 8.1(LineageOS 15.1)
  • Shadowsocks version: 4.5.3

What did you see instead?

If the system enable Dark theme (night mode), the popupmenu background color will be the same as the system.
screenshot_shadowsocks_20180401-035524

bug

Most helpful comment

You can fix the background color like this.

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="popupMenuStyle">@style/popupMenuStyle</item>
</style>

<style name="popupMenuStyle" parent="Widget.AppCompat.PopupMenu">
    <item name="android:popupBackground">@android:color/white</item>
</style>

Or add DayNight Mode(Theme.AppCompat.DayNight)

All 14 comments

You can fix the background color like this.

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="popupMenuStyle">@style/popupMenuStyle</item>
</style>

<style name="popupMenuStyle" parent="Widget.AppCompat.PopupMenu">
    <item name="android:popupBackground">@android:color/white</item>
</style>

Or add DayNight Mode(Theme.AppCompat.DayNight)

Even though I could not reproduce this issue on any of my devices (seems like most custom ROMs these days don't really want to care about day night features) but I fixed it anyhow. Please wait for fix to be merged by upstream.

@Mygod the bug still exist.
P.S. 夜间模式并不只是自定义 ROM 才有,AOSP 就已经支持,Pixel 手机可以通过使用暗色壁纸开启夜间模式
https://play.google.com/store/apps/details?id=com.lb.lwp_plus
https://www.xda-developers.com/force-dark-mode-any-wallpaper-android-8-1-oreo/
screenshot_settings_20180410-234029

@onlymash AOSP 只有通知栏和快捷设置面板、启动器抽屉会变成暗色,其他地方不变。全局暗色主题还是第三方才有的功能。

Upstream hasn't merged the fix. Please blame @gericop.

@iKirby 只要系统变成暗色主题模式,用系统的颜色值作为背景,肯定是黑色的,然而这里字体写死为黑色,背景又是黑色,就造成这样的后果

@iKirby 其他地方不变是因为每个系统app都是单独写的,这些app并没有适配夜间主题(使用DayNight主题)

Also DayNight theme is different from night light. I haven't seen AOSP has
DayNight feature.

AppCompatDelegate.setDefaultNightMode()
有这几个值:
MODE_NIGHT_NO. Always use the day (light) theme.
MODE_NIGHT_YES. Always use the night (dark) theme.
MODE_NIGHT_AUTO. Changes between day/night based on the time of day.
MODE_NIGHT_FOLLOW_SYSTEM (default). This setting follows the system’s setting.
怎么看都是天生为系统的夜间主题设计的

Day night was originally introduced in a developer preview and was removed
in the official release. In fact people has been begging Google to add back
dark mode for years and yet that has not happened.

LineageOS 正在给越来越多系统自带 App 适配夜间主题,普遍采用 DayNight 主题。
https://review.lineageos.org/#/c/LineageOS/android_packages_apps_Updater/+/212457/

Pull requests are welcome.

谷歌目前没有把代码合并到AOSP,但是他们自己的 Pixel、 Android One 设备都是支持的。可能是考虑到很多应用写的不规范,会出现类似这样的bug,才没有强制让OEM支持

Feel free to go rant on this issue: https://issuetracker.google.com/issues/69759140

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mygod picture Mygod  ·  5Comments

kuaihou2012 picture kuaihou2012  ·  6Comments

zhoujun2 picture zhoujun2  ·  3Comments

CzBiX picture CzBiX  ·  3Comments

yyxida picture yyxida  ·  5Comments