Improve Apps/Widgets transition

- Avoid using a bitmap when doing crossfade when switching between Apps/Widgets tabs, also fixes a visual issue on stingray (5104303)

Change-Id: I7365c629e704f37e18350ad15a849c034553d0b3
This commit is contained in:
Michael Jurka committed 2011-11-11 16:48:48 -08:00
1 parent fd99e7776a
commit 141dbd0e02
3 files changed
+58 -29

No files matched your search

+14 -7
View File
@@ -44,6 +44,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
private static final int sPreviewFadeInDuration = 80;
private static final int sPreviewFadeInStaggerDuration = 20;
private static boolean sDeletePreviewsWhenDetachedFromWindow = true;
private final Paint mPaint = new Paint();
private Bitmap mHolographicOutline;
@@ -89,17 +90,23 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
setClipToPadding(false);
}
public static void setDeletePreviewsWhenDetachedFromWindow(boolean value) {
sDeletePreviewsWhenDetachedFromWindow = value;
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
final ImageView image = (ImageView) findViewById(R.id.widget_preview);
if (image != null) {
FastBitmapDrawable preview = (FastBitmapDrawable) image.getDrawable();
if (preview != null && preview.getBitmap() != null) {
preview.getBitmap().recycle();
}
image.setImageDrawable(null);
if (sDeletePreviewsWhenDetachedFromWindow) {
final ImageView image = (ImageView) findViewById(R.id.widget_preview);
if (image != null) {
FastBitmapDrawable preview = (FastBitmapDrawable) image.getDrawable();
if (preview != null && preview.getBitmap() != null) {
preview.getBitmap().recycle();
}
image.setImageDrawable(null);
}
}
}