Merge "Fix that CSL cache hits produce bad drawables" into sc-dev

This commit is contained in:
John Reck
2021-04-27 19:59:13 +00:00
committed by Android (Google) Code Review

View File

@@ -48,6 +48,12 @@ public class ColorStateListDrawable extends Drawable implements Drawable.Callbac
setColorStateList(colorStateList);
}
private ColorStateListDrawable(@NonNull ColorStateListDrawableState state) {
mState = state;
initializeColorDrawable();
onStateChange(getState());
}
@Override
public void draw(@NonNull Canvas canvas) {
mColorDrawable.draw(canvas);
@@ -286,11 +292,6 @@ public class ColorStateListDrawable extends Drawable implements Drawable.Callbac
}
}
private ColorStateListDrawable(@NonNull ColorStateListDrawableState state) {
mState = state;
initializeColorDrawable();
}
private void initializeColorDrawable() {
mColorDrawable = new ColorDrawable();
mColorDrawable.setCallback(this);