diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java index a34e716072..e3eb76c257 100644 --- a/src/com/android/launcher3/widget/WidgetCell.java +++ b/src/com/android/launcher3/widget/WidgetCell.java @@ -118,6 +118,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { if (DEBUG) { Log.d(TAG, "reset called on:" + mWidgetName.getText()); } + mWidgetImage.animate().cancel(); mWidgetImage.setImageDrawable(null); mWidgetName.setText(null); mWidgetDims.setText(null); diff --git a/src/com/android/launcher3/widget/WidgetsListAdapter.java b/src/com/android/launcher3/widget/WidgetsListAdapter.java index b8124d6e39..397d177990 100644 --- a/src/com/android/launcher3/widget/WidgetsListAdapter.java +++ b/src/com/android/launcher3/widget/WidgetsListAdapter.java @@ -185,6 +185,15 @@ public class WidgetsListAdapter extends Adapter { } } + @Override + public boolean onFailedToRecycleView(WidgetsRowViewHolder holder) { + // If child views are animating, then the RecyclerView may choose not to recycle the view, + // causing extraneous onCreateViewHolder() calls. It is safe in this case to continue + // recycling this view, and take care in onViewRecycled() to cancel any existing + // animations. + return true; + } + @Override public long getItemId(int pos) { return pos;