Status Update
Comments
du...@google.com <du...@google.com>
ap...@google.com <ap...@google.com> #2
Are there many use cases for this? The current logic works fine with dark mode of platform, appcompat, and Compose.
ap...@google.com <ap...@google.com> #3
When I was trying out integrating this with Now in Android, I ran into this issue since Now in Android currently doesn't inherit from AppCompatActivity
and doesn't call AppCompatDelegate.setDefaultNightMode
, so maybe the solution is instead to inherit from AppCompatActivity
instead of just ComponentActivity
to update the underlying configuration.
ap...@google.com <ap...@google.com> #4
I just tested it with ComponentActivity. It's working fine for me. The scrim for 3-button nav and the icons are properly changed on light/dark mode switch. The extension function detect light/dark mode from resources.configuration.uiMode
which is commonly used by the platform, AppCompat, and Compose, so I don't know why it doesn't work. Can I take a look at what you tried in Now in Android.
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #5
The theme switcher based on the user's preference within the app is handled separately from Configuration.uiMode
and isn't updating the configuration directly, so I was attempting to call enableEdgeToEdge
and manually specifying the dark and light themes.
The two options I see:
- Allow a different way of specifying for
enableEdgeToEdge
whether the app is effectively in dark mode or light mode instead of that being based just onConfiguration.uiMode
(this issue) - Switch Now in Android to use
AppCompatActivity
andAppCompatDelegate.setDefaultNightMode
so that theConfiguration.uiMode
is updated based on the user's preference
ap...@google.com <ap...@google.com> #6
I see, so it has in-app light/dark setting.
On API 31+, apps with custom in-app light/dark settings should call UiModeManager.setApplicationNightMode
enableEdgeToEdge
as well.
On API <31, it's easy if you can use AppCompatDelegate.setDefaultNightMode(int)
So, custom mode is useful for apps that:
- Provide in-app light/dark mode settings on API <31.
- Don't want to depend on appcompat
I'm not sure if it's super common, but I guess the feature is worth implementing. I'll put it during the next alpha phase.
For Now in Android, I recommend you still call setApplicationNightMode
on API 31+ regardless of enableEdgeToEdge
. On API <31, just for the time being, you can either use the current e2e implementation, hide the setting, depend on appcompat, or just bear with the minor UI glitch. None of these are great, but I don't have a good solution now.
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit 27e7d52e8604a080133e8b842db10c89b4482598
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Apr 19 12:56:59 2023
Add SystemBarStyle.custom
Relnote: "Add an optional parameter `detectDarkMode` to SystemBarStyle.auto for detecting night mode by custom logic"
Test: androidx.activity.EdgeToEdgeTest.enableCustom
Bug: 278263793
Change-Id: I78322867ba3940939e137479383eca08efc9a2b6
M activity/activity/api/current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/EdgeToEdgeTest.kt
M activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt
M activity/integration-tests/testapp/src/main/java/androidx/activity/integration/testapp/EdgeToEdgeActivity.kt
M activity/integration-tests/testapp/src/main/res/layout/edge_to_edge_activity.xml
ap...@google.com <ap...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.activity:activity:1.8.0-alpha06
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit c4782c289e754747e1a98a28e2700836d78d7578
Author: clarafok <clarafok@google.com>
Date: Fri May 13 14:12:02 2022
Implement rxjava2 LimitOffsetRxPagingSource
Test: ./gradlew room:room-paging-rxjava2:cC
Bug: 203666906
Change-Id: Iefd883d45b18b032bb3a29d51209fc7de169c1aa
A room/room-paging-rxjava2/src/androidTest/kotlin/androidx/room/paging/rxjava2/LimitOffsetRxPagingSourceTest.kt
M room/room-paging-rxjava2/build.gradle
A room/room-paging-rxjava2/src/main/java/androidx/room/paging/rxjava2/LimitOffsetRxPagingSource.kt
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit d1ba57918465b84aa9564074df68d3136a4f8fcd
Author: clarafok <clarafok@google.com>
Date: Fri May 13 16:09:09 2022
Hook up room-paging-rxjava2 to room-compiler
Test: ./gradlew room:room-compiler:test
Test: ./gradlew room:integration-tests:room-testapp-kotlin:cC
Fixes: 203666906
Change-Id: Ic8f07f14491ece38b1296ca71c761511218a65a9
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/testutil/PagingEntityDao.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/MultiTypedPagingSourceTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/room-compiler/src/test/kotlin/androidx/room/testing/test_util.kt
M room/integration-tests/kotlintestapp/build.gradle
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
A room/room-compiler/src/test/data/common/input/Rx2PagingSource.java
A room/room-compiler/src/main/kotlin/androidx/room/solver/binderprovider/RxJava2PagingSourceQueryResultBinderProvider.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
A room/room-compiler/src/test/data/common/input/LimitOffsetRx2PagingSource.java
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/Rx2PagingSourceTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
Description
Add new artifacts for room-paging-rx2/3 and -guava.