Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared.  This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
This commit is contained in:
Christopher Lais
2011-01-13 15:02:05 -06:00
committed by Dianne Hackborn
parent d922ae01ca
commit 6efd2bad95
13 changed files with 12 additions and 13 deletions

View File

@@ -241,7 +241,7 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback {
@Override
public ConstantState getConstantState() {
if (mScaleState.canConstantState()) {
mScaleState.mChangingConfigurations = super.getChangingConfigurations();
mScaleState.mChangingConfigurations = getChangingConfigurations();
return mScaleState;
}
return null;