Fix issues with theming of preloaded ColorStateLists
Ensures changing configurations mask is propagated to the host drawable so that it can be properly cleared from cache on configuration changes. Also fixes constant state handling of the mask in the Inset and Rotate drawables. Hides new ColorStateList methods related to theming, since they should only be used during preloading or internally by framework drawables. Fixes bug where the cached versions of themeable ColorStateLists were modified by calling applyTheme() on the host drawable. Also cleans up some docs and naming in GradientDrawable. Bug: 19966397 Change-Id: I8c8d3cabbaf94b488c2b8fe9fd423e07d824c19c
This commit is contained in:
@@ -87,8 +87,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
|
||||
@Override
|
||||
public int getChangingConfigurations() {
|
||||
return super.getChangingConfigurations()
|
||||
| mDrawableContainerState.mChangingConfigurations
|
||||
| mDrawableContainerState.mChildrenChangingConfigurations;
|
||||
| mDrawableContainerState.getChangingConfigurations();
|
||||
}
|
||||
|
||||
private boolean needsMirroring() {
|
||||
@@ -865,6 +864,9 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (drawables[i] != null && drawables[i].canApplyTheme()) {
|
||||
drawables[i].applyTheme(theme);
|
||||
|
||||
// Update cached mask of child changing configurations.
|
||||
mChildrenChangingConfigurations |= drawables[i].getChangingConfigurations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user