Always update drawable container source res

Bug: 27349209
Change-Id: I3bb3d4862a03fd5ce0beeb2bf5208f2917ec9320
This commit is contained in:
Alan Viverette
2016-02-25 12:27:02 -05:00
parent 8baf238a41
commit 2d3ca47ef8

View File

@@ -898,19 +898,19 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
* @param res the resources used to inflate density-dependent values
*/
final void updateDensity(Resources res) {
if (mSourceRes != null) {
if (res != null) {
mSourceRes = res;
}
// The density may have changed since the last update (if any). Any
// dimension-type attributes will need their default values scaled.
final int targetDensity = Drawable.resolveDensity(res, mDensity);
final int sourceDensity = mDensity;
mDensity = targetDensity;
// The density may have changed since the last update (if any). Any
// dimension-type attributes will need their default values scaled.
final int targetDensity = Drawable.resolveDensity(res, mDensity);
final int sourceDensity = mDensity;
mDensity = targetDensity;
if (sourceDensity != targetDensity) {
mCheckedConstantSize = false;
mCheckedPadding = false;
if (sourceDensity != targetDensity) {
mCheckedConstantSize = false;
mCheckedPadding = false;
}
}
}