summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetCell.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-04-11 15:44:32 -0700
committerHyunyoung Song <hyunyoungs@google.com>2015-04-13 15:58:30 -0700
commit4e8fb91cf19b7d621de8cbed2bde2c8dac734121 (patch)
treee8f92dfd39abde81fd2d0f017a533fa8b950a9bf /src/com/android/launcher3/widget/WidgetCell.java
parentd9760ee2de0a245fe0a0c11891723ef3f1513de9 (diff)
downloadandroid_packages_apps_Trebuchet-4e8fb91cf19b7d621de8cbed2bde2c8dac734121.tar.gz
android_packages_apps_Trebuchet-4e8fb91cf19b7d621de8cbed2bde2c8dac734121.tar.bz2
android_packages_apps_Trebuchet-4e8fb91cf19b7d621de8cbed2bde2c8dac734121.zip
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
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetCell.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetCell.java13
1 files changed, 11 insertions, 2 deletions
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) {