Status Update
Comments
gg...@google.com <gg...@google.com> #2
Can you provide the below requested information to better understand the issue:
Steps to reproduce
Please provide a sample application to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Expected output
What is the expected output?
Current output
What is the current output?
Steps to reproduce
Please provide a sample application to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Expected output
What is the expected output?
Current output
What is the current output?
io...@gmail.com <io...@gmail.com> #3
Example application:
*https://transfer.sh/fxaZz/Jelly.apk
* Source code:https://github.com/LineageOS/android_packages_apps_Jelly
Steps to reproduce:
1. Install the app on a phone and on a tablet
2. The app has a style that inherits from AppCompat.DayNight and it has AppCompatDelegate's night mode set to AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
3. Open the app on both, the app is now using default resources and light style (Day mode)
4. Set UiModeManager nightMode to UiModeManager.MODE_NIGHT_YES (Example code for doing that:https://github.com/LineageOS/android_frameworks_base/commit/8538f16ce600efb5fdc02af3e143a762cab8fe7a )
Expected output:
* -night resources and dark style should be used on both phones and tablet devices
Current output:
* On phones it works fine: night / dark resources are used
* On tablets day / light resources are used regardless of UiModeManager configuration
*
* Source code:
Steps to reproduce:
1. Install the app on a phone and on a tablet
2. The app has a style that inherits from AppCompat.DayNight and it has AppCompatDelegate's night mode set to AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
3. Open the app on both, the app is now using default resources and light style (Day mode)
4. Set UiModeManager nightMode to UiModeManager.MODE_NIGHT_YES (Example code for doing that:
Expected output:
* -night resources and dark style should be used on both phones and tablet devices
Current output:
* On phones it works fine: night / dark resources are used
* On tablets day / light resources are used regardless of UiModeManager configuration
gg...@google.com <gg...@google.com> #4
Thanks for feedback we not able reproduce this in android emulator pixel C and google device.
Can you please attach the Screenshot and provide the clear steps how to test app with given APK or sample project.
Please be more specific what exact changes need do here "Set UiModeManager nightMode to UiModeManager.MODE_NIGHT_YES"
Can you please attach the Screenshot and provide the clear steps how to test app with given APK or sample project.
Please be more specific what exact changes need do here "Set UiModeManager nightMode to UiModeManager.MODE_NIGHT_YES"
io...@gmail.com <io...@gmail.com> #5
In order to change UIModeManager's night mode you need to have a system app that does it.
As you can see in the commit I linked earlier, I'm doing this using SystemUI [1].
You can't reproduce this issue on a "stock" emulator image or a Google's public-released build
as they are not using the UIModeManager APIs anywhere.
If you want you can download or compile a build for your device (not emulators), such as pixel C, look here [2].
This is not a an "official android" issue, but it's an issue with public android apis [3] [4].
What I'm not 100% sure is whether the issue is in appCompat's dayNight theme not loading
-night resources on tablet or if it's a deeper android issue.
The repro steps are easy:
Once you get a way to switch between day and night mode in UiModeManager service, just reopen the app
and you'll notice the UI changes (light vs dark ui elements).
[1]https://github.com/LineageOS/android_frameworks_base/commit/8538f16ce600efb5fdc02af3e143a762cab8fe7a
[2]https://wiki.lineageos.org/devices/dragon
[3]https://developer.android.com/reference/android/app/UiModeManager.html#setNightMode(int)
[4]https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getdefaultnightmode
As you can see in the commit I linked earlier, I'm doing this using SystemUI [1].
You can't reproduce this issue on a "stock" emulator image or a Google's public-released build
as they are not using the UIModeManager APIs anywhere.
If you want you can download or compile a build for your device (not emulators), such as pixel C, look here [2].
This is not a an "official android" issue, but it's an issue with public android apis [3] [4].
What I'm not 100% sure is whether the issue is in appCompat's dayNight theme not loading
-night resources on tablet or if it's a deeper android issue.
The repro steps are easy:
Once you get a way to switch between day and night mode in UiModeManager service, just reopen the app
and you'll notice the UI changes (light vs dark ui elements).
[1]
[2]
[3]
[4]
gg...@google.com <gg...@google.com> #6
We have shared this with our engineering team and will update this issue with more information as it becomes available.
Description
Version used: 27.x
Theme used: AppCompat.DayNight
Devices/Android versions reproduced on: 8.1
- How to trigger the issue
1. Make an app theme inherit AppCompat.DayNight
2. Make sure the AppCompatDelegate night mode is set to MODE_NIGHT_FOLLOW_SYSTEM when the app is running
2. Execute the app
3. Using android's "UiModeManager" API to change Night mode ( `UiModeManager.setNightMode()` ) the following happens
- On phones: the App's UI is updated accordingly to UiModeManager settings
- On tablets: the "night" mode is never enabled and "nonight / day" mode is always on
This is reproducible on Google Maps too:
on phones, when the UiModeManager nightMode is set to `UiModeManager.MODE_NIGHT_YES` the splash screen has a dark background and when it's set to `UiModeManager.MODE_NIGHT_NO` it's white;
on tablets it's always white.
In case you were wondering: UiModeManager night mode change is done from a system app using the proper `android.permission.MODIFY_DAY_NIGHT_MODE` permission.