Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
This commit is contained in:
Dianne Hackborn
2009-09-13 18:22:19 -07:00
parent e7f47f50ad
commit c297480937
21 changed files with 309 additions and 115 deletions

View File

@@ -822,7 +822,26 @@ public abstract class Drawable {
}
public static abstract class ConstantState {
/**
* Create a new drawable without supplying resources the caller
* is running in. Note that using this means the density-dependent
* drawables (like bitmaps) will not be able to update their target
* density correctly.
*/
public abstract Drawable newDrawable();
/**
* Create a new Drawable instance from its constant state. This
* must be implemented for drawables that change based on the target
* density of their caller (that is depending on whether it is
* in compatibility mode).
*/
public Drawable newDrawable(Resources res) {
return newDrawable();
}
/**
* Return a bit mask of configuration changes that will impact
* this drawable (and thus require completely reloading it).
*/
public abstract int getChangingConfigurations();
}