Fixed
Status Update
Comments
al...@google.com <al...@google.com> #2
Theme
does not implement equals
or hashcode
so there is no way to distinguish between the object in different states.
bu...@google.com <bu...@google.com> #3
Hi. I've received your bug and will wait for b/155881035 to be resolved and then assign the bug to alanv@google.com.
Bugjuggler: b/155881035 -> assigned to alanv@google.com
Bugjuggler:
Ar...@qq.com <Ar...@qq.com> #4
You can provide a method to clear the cache.
e.g:
public final class ResourcesCompat {
...
public static void clearColorStateCache() {
synchronized (sColorStateCacheLock) {
sColorStateCaches.clear();
}
}
...
}
al...@google.com <al...@google.com> #5
Good suggestion! I think it would also be reasonable to provide a cache-clearing mechanism for a specific Theme
, since this applies to more than just CSL
s. We can do that as a stop-gap until we have APIs for comparing Theme
contents.
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #6
aosp/1927081 up for review.
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit 4f66c0ca1f324426a862a707597573d6bd8c0f01
Author: Alan Viverette <alanv@google.com>
Date: Thu Dec 16 15:28:48 2021
Add workaround method for addressing cache invalidation on SDK < 33
This method is not very discoverable, but it's also pretty niche. Those
who need it will probably find it via StackOverflow or Buganizer.
Relnote: """Added method for working around ColorStateList issues
resulting from Theme-keyed caching and Theme.applyStyle"""
Test: ResourcesCompatTest
Fixes: 207739887
Change-Id: I9188bbf6b182111b3d6d302b81b9a000058687bd
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
M core/core/api/public_plus_experimental_current.txt
M core/core/src/androidTest/java/androidx/core/content/res/ResourcesCompatTest.java
M core/core/api/current.txt
https://android-review.googlesource.com/1927081
Branch: androidx-main
commit 4f66c0ca1f324426a862a707597573d6bd8c0f01
Author: Alan Viverette <alanv@google.com>
Date: Thu Dec 16 15:28:48 2021
Add workaround method for addressing cache invalidation on SDK < 33
This method is not very discoverable, but it's also pretty niche. Those
who need it will probably find it via StackOverflow or Buganizer.
Relnote: """Added method for working around ColorStateList issues
resulting from Theme-keyed caching and Theme.applyStyle"""
Test: ResourcesCompatTest
Fixes: 207739887
Change-Id: I9188bbf6b182111b3d6d302b81b9a000058687bd
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
M core/core/api/public_plus_experimental_current.txt
M core/core/src/androidTest/java/androidx/core/content/res/ResourcesCompatTest.java
M core/core/api/current.txt
Description