summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetCell.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetCell.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetCell.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java
index 7c7d982de..2df170eff 100644
--- a/src/com/android/launcher3/widget/WidgetCell.java
+++ b/src/com/android/launcher3/widget/WidgetCell.java
@@ -94,18 +94,25 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
mOriginalImagePadding.right = mWidgetImage.getPaddingRight();
mOriginalImagePadding.bottom = mWidgetImage.getPaddingBottom();
- // Ensure we are using the right text size
- DeviceProfile profile = LauncherAppState.getInstance().getDynamicGrid().getDeviceProfile();
mWidgetName = ((TextView) findViewById(R.id.widget_name));
mWidgetDims = ((TextView) findViewById(R.id.widget_dims));
}
- public void reset() {
+ /**
+ * Called to clear the view and free attached resources. (e.g., {@link Bitmap}
+ */
+ public void clear() {
+ if (DEBUG) {
+ Log.d(TAG, "reset called on:" + mWidgetName.getText());
+ }
mWidgetImage.setImageDrawable(null);
mWidgetName.setText(null);
mWidgetDims.setText(null);
- cancelLoader(false);
+ if (mActiveRequest != null) {
+ mActiveRequest.cleanup();
+ mActiveRequest = null;
+ }
}
/**
@@ -211,13 +218,6 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
return Math.min(size[0], info.spanX * cellWidth);
}
- private void cancelLoader(boolean recycleImage) {
- if (mActiveRequest != null) {
- mActiveRequest.cancel(recycleImage);
- mActiveRequest = null;
- }
- }
-
/**
* Helper method to get the string info of the tag.
*/