From 4e8fb91cf19b7d621de8cbed2bde2c8dac734121 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Sat, 11 Apr 2015 15:44:32 -0700 Subject: WidgetTray improvement UI - Fixing the issue of widget row not rendering - Moved the resetting of previous bitmap to the start of onBind instead of the onDetachedWindow. Performance - WidgetModel do not have to keep packageName list around. Will com in immediate follow up CLs - use lowRes widgets bitmap before fully loading the fullRes one. - application icons are fully loaded in background thread. b/19897708 Change-Id: I5b3b43a5c543a5135c395f90df32e66d57dc86e0 --- src/com/android/launcher3/widget/WidgetCell.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3/widget/WidgetCell.java') diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java index 93ee94a59..d10c3049e 100644 --- a/src/com/android/launcher3/widget/WidgetCell.java +++ b/src/com/android/launcher3/widget/WidgetCell.java @@ -47,7 +47,7 @@ import com.android.launcher3.compat.AppWidgetManagerCompat; */ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { - private static final String TAG = "PagedViewWidget"; + private static final String TAG = "WidgetCell"; private static final boolean DEBUG = false; // Temporary preset width and height of the image to keep them aligned. @@ -120,7 +120,16 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { Log.d(TAG, String.format("[tag=%s] onDetachedFromWindow", getTagToString())); } super.onDetachedFromWindow(); - deletePreview(true); + deletePreview(false); + } + + public void reset() { + ImageView image = (ImageView) findViewById(R.id.widget_preview); + final TextView name = (TextView) findViewById(R.id.widget_name); + final TextView dims = (TextView) findViewById(R.id.widget_dims); + image.setImageDrawable(null); + name.setText(null); + dims.setText(null); } public void deletePreview(boolean recycleImage) { -- cgit v1.2.3