summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-08-18 09:05:01 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2017-08-23 21:19:42 (GMT)
commit988ad27be4e42e659f7a2461d16f7d75352e4711 (patch)
treec878b00dd5b20d85e803205e373d3a243135c895
parentc56e3ff2ee03d1756ff70574421e497c5d2f0331 (diff)
downloadandroid_packages_apps_Trebuchet-988ad27be4e42e659f7a2461d16f7d75352e4711.zip
android_packages_apps_Trebuchet-988ad27be4e42e659f7a2461d16f7d75352e4711.tar.gz
android_packages_apps_Trebuchet-988ad27be4e42e659f7a2461d16f7d75352e4711.tar.bz2
Applying the widget resize changes even when the activity is destroyed
in the middle of the resize interaction. Bug: 64759853 Change-Id: I65ab7df0426f36fe1121bf055e38fc722822b0f4
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java12
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java1
2 files changed, 5 insertions, 8 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 1a405f9..a486a3a 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -55,7 +55,6 @@ public class AppWidgetResizeFrame extends FrameLayout
private final int[] mDirectionVector = new int[2];
private final int[] mLastDirectionVector = new int[2];
- private final int[] mTmpPt = new int[2];
private final IntRange mTempRange1 = new IntRange();
private final IntRange mTempRange2 = new IntRange();
@@ -344,13 +343,12 @@ public class AppWidgetResizeFrame extends FrameLayout
return rect;
}
- /**
- * This is the final step of the resize. Here we save the new widget size and position
- * to LauncherModel and animate the resize frame.
- */
- public void commitResize() {
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+
+ // We are done with resizing the widget. Save the widget size & position to LauncherModel
resizeWidgetIfNeeded(true);
- requestLayout();
}
private void onTouchUp() {
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index ee6a0e0..fde7995 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -544,7 +544,6 @@ public class DragLayer extends InsettableFrameLayout {
public void clearResizeFrame() {
if (mCurrentResizeFrame != null) {
- mCurrentResizeFrame.commitResize();
removeView(mCurrentResizeFrame);
mCurrentResizeFrame = null;
}