Merge "Properly store values to pass to constant state" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-09-24 17:12:27 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 0 deletions

View File

@@ -109,6 +109,12 @@ public class AlphaTintDrawableWrapper extends InsetDrawable {
} }
} }
@Override
public void setTintList(ColorStateList tint) {
super.setTintList(tint);
mTint = tint;
}
private void applyTint() { private void applyTint() {
if (getDrawable() != null && mTint != null) { if (getDrawable() != null && mTint != null) {
getDrawable().mutate().setTintList(mTint); getDrawable().mutate().setTintList(mTint);

View File

@@ -69,6 +69,10 @@ class RoundedCornerProgressDrawable @JvmOverloads constructor(
return super.getChangingConfigurations() or ActivityInfo.CONFIG_DENSITY return super.getChangingConfigurations() or ActivityInfo.CONFIG_DENSITY
} }
override fun canApplyTheme(): Boolean {
return (drawable?.canApplyTheme() ?: false) || super.canApplyTheme()
}
private class RoundedCornerState(private val wrappedState: ConstantState) : ConstantState() { private class RoundedCornerState(private val wrappedState: ConstantState) : ConstantState() {
override fun newDrawable(): Drawable { override fun newDrawable(): Drawable {
return newDrawable(null, null) return newDrawable(null, null)
@@ -82,5 +86,9 @@ class RoundedCornerProgressDrawable @JvmOverloads constructor(
override fun getChangingConfigurations(): Int { override fun getChangingConfigurations(): Int {
return wrappedState.changingConfigurations return wrappedState.changingConfigurations
} }
override fun canApplyTheme(): Boolean {
return true
}
} }
} }