Update preload list, clean up drawable theming

Removes all implementations of three-arg ConstantState constructor, since
we handle mutation and applyTheme() in Resources now. Moves progress bar
tinting to android:tint attribute. Correctly implements applyTheme() and
canApplyTheme() in all drawable wrapper and container classes.

Change-Id: Ic9cb43d0d6228aa4914f3124bed234b837beaa41
This commit is contained in:
Alan Viverette
2014-10-14 14:07:21 -07:00
parent 2f82e48abb
commit 17cd4dfe3a
22 changed files with 333 additions and 402 deletions

View File

@@ -76,7 +76,7 @@ public class ShapeDrawable extends Drawable {
* ShapeDrawable constructor.
*/
public ShapeDrawable() {
this(new ShapeState(null), null, null);
this(new ShapeState(null), null);
}
/**
@@ -85,7 +85,7 @@ public class ShapeDrawable extends Drawable {
* @param s the Shape that this ShapeDrawable should be
*/
public ShapeDrawable(Shape s) {
this(new ShapeState(null), null, null);
this(new ShapeState(null), null);
mShapeState.mShape = s;
}
@@ -555,17 +555,12 @@ public class ShapeDrawable extends Drawable {
@Override
public Drawable newDrawable() {
return new ShapeDrawable(this, null, null);
return new ShapeDrawable(this, null);
}
@Override
public Drawable newDrawable(Resources res) {
return new ShapeDrawable(this, res, null);
}
@Override
public Drawable newDrawable(Resources res, Theme theme) {
return new ShapeDrawable(this, res, theme);
return new ShapeDrawable(this, res);
}
@Override
@@ -578,13 +573,8 @@ public class ShapeDrawable extends Drawable {
* The one constructor to rule them all. This is called by all public
* constructors to set the state and initialize local properties.
*/
private ShapeDrawable(ShapeState state, Resources res, Theme theme) {
if (theme != null && state.canApplyTheme()) {
mShapeState = new ShapeState(state);
applyTheme(theme);
} else {
mShapeState = state;
}
private ShapeDrawable(ShapeState state, Resources res) {
mShapeState = state;
initializeWithState(state, res);
}