From 4067f5d4ae56de4da704e771eb97be42bff6ee60 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Fri, 15 Oct 2021 10:16:51 -0500 Subject: [PATCH] Bugfix where the widget handles appear even when you can't resize it. To fix it I added the following logic condition: if the minimum size of the widget (`mMinVSpan` vertically) is equal to the maximum size of the widget (`mMaxVSpan` vertically), then you can't change the size and the handles shouldn't appear, I did this for both the horizontal handles as well as the vertical handles. Fix: 202004006 Change-Id: Ide05231f5712a736129ac6cb2fee358f7c70e371 Test: Manully veryfied. --- src/com/android/launcher3/AppWidgetResizeFrame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java index ebfd28169c..e038235c1c 100644 --- a/src/com/android/launcher3/AppWidgetResizeFrame.java +++ b/src/com/android/launcher3/AppWidgetResizeFrame.java @@ -241,13 +241,15 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O // Only show resize handles for the directions in which resizing is possible. InvariantDeviceProfile idp = LauncherAppState.getIDP(cellLayout.getContext()); mVerticalResizeActive = (info.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0 - && mMinVSpan < idp.numRows && mMaxVSpan > 1; + && mMinVSpan < idp.numRows && mMaxVSpan > 1 + && mMinVSpan < mMaxVSpan; if (!mVerticalResizeActive) { mDragHandles[INDEX_TOP].setVisibility(GONE); mDragHandles[INDEX_BOTTOM].setVisibility(GONE); } mHorizontalResizeActive = (info.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0 - && mMinHSpan < idp.numColumns && mMaxHSpan > 1; + && mMinHSpan < idp.numColumns && mMaxHSpan > 1 + && mMinHSpan < mMaxHSpan; if (!mHorizontalResizeActive) { mDragHandles[INDEX_LEFT].setVisibility(GONE); mDragHandles[INDEX_RIGHT].setVisibility(GONE);