Sets Drawable in DrawableWrapper properly

Before this change, creating a DrawableWrapper (through a custom class
that extends it) using the public constructor will not set the drawable
callback properly and DrawableWrapper will not update when the
underlying Drawable is invalidated.

Test: CTS test added
Bug: 120835632
Change-Id: I3545db76e032c0bd074846e0fa64c5cf01e2941c
This commit is contained in:
Fabian Kozynski
2018-12-10 16:33:06 -05:00
parent a6d828755e
commit de9f10d9d9

View File

@@ -65,7 +65,7 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb
*/
public DrawableWrapper(@Nullable Drawable dr) {
mState = null;
mDrawable = dr;
setDrawable(dr);
}
/**