Fixed
Status Update
Comments
ae...@google.com <ae...@google.com>
al...@mercari.com <al...@mercari.com> #2
Still reproducible in 1.2.0
be...@google.com <be...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 72bcfb498302e80563b2eb6037ef54079eb5bb55
Author: Ben Trengrove <bentrengrove@google.com>
Date: Wed Aug 10 20:49:34 2022
Fix painterResource not subscribing to configuration changes
Fixes: 228862715
Test: PainterResourcesDemo
Relnote: Fixed an issue where painterResource wouldn't update on configuration changes
Change-Id: I58e732cd43766d41a7f8f732c6bf519548a695d7
A compose/ui/ui/integration-tests/ui-demos/src/main/res/drawable-night/ic_painterresource.xml
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/PainterResourcesDemo.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/VectorResources.android.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/StringResources.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M compose/ui/ui/api/restricted_current.txt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/Resources.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/PainterResources.android.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/AndroidManifest.xml
A compose/ui/ui/integration-tests/ui-demos/src/main/res/drawable/ic_painterresource.xml
M compose/ui/ui/api/public_plus_experimental_current.txt
https://android-review.googlesource.com/2182977
Branch: androidx-main
commit 72bcfb498302e80563b2eb6037ef54079eb5bb55
Author: Ben Trengrove <bentrengrove@google.com>
Date: Wed Aug 10 20:49:34 2022
Fix painterResource not subscribing to configuration changes
Fixes: 228862715
Test: PainterResourcesDemo
Relnote: Fixed an issue where painterResource wouldn't update on configuration changes
Change-Id: I58e732cd43766d41a7f8f732c6bf519548a695d7
A compose/ui/ui/integration-tests/ui-demos/src/main/res/drawable-night/ic_painterresource.xml
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/PainterResourcesDemo.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/VectorResources.android.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/StringResources.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M compose/ui/ui/api/restricted_current.txt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/Resources.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/PainterResources.android.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/AndroidManifest.xml
A compose/ui/ui/integration-tests/ui-demos/src/main/res/drawable/ic_painterresource.xml
M compose/ui/ui/api/public_plus_experimental_current.txt
Description
Jetpack Compose component used: androidx.compose.ui.res.painterResource
Android Studio Build:
Android Studio Bumblebee | 2021.1.1 Patch 3
Build #AI-211.7628.21.2111.8309675, built on March 16, 2022
Runtime version: 11.0.11+0-b60-7590822 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6.5
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry: external.system.auto.import.disabled=true, ide.instant.shutdown=false
Non-Bundled Plugins: com.dubreuia (2.2.0), com.intellij.javafx (1.0.4), org.jetbrains.kotlin (211-1.6.20-release-275-AS7442.40), com.intellij.lang.jsgraphql (3.1.2), org.intellij.plugins.markdown (211.7142.37),
Kotlin version: 1.6.10
Steps to Reproduce or Code Sample to Reproduce:
1. Display an Image composable using a painterResource, where the drawable resource has both a light and a night version.
2. Add the following to your activity in your AndroidManifest.xml: android:configChanges="colorMode|density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
3. Rebuild and run the application and view your image from step 1.
4. Toggle the Night/Light Mode setting on the device
5. See that the displayed image is not updated to utilize the night mode version of the resource.
KotlinLang Slack discussion for more context/Info:
Stack trace (if applicable):