diff options
author | Nebojsa Cvetkovic <nebkat@gmail.com> | 2017-11-10 16:20:37 +0100 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-05-06 14:30:30 +0800 |
commit | f2e547b4571e457ca8d3841dea20c4f3ca5d0f96 (patch) | |
tree | 4cf77a59d06a09cfff105b163c835f2a3ba35023 | |
parent | 24aeffb174cdc3e72887109c018e04f7f7eb7310 (diff) |
Launcher3: Allow resizing any widget
[BadDaemon: Adapt for S]
Change-Id: Iba122eb45d4ba81e53267ff341addfe281cf02fe
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
-rw-r--r-- | src/com/android/launcher3/AppWidgetResizeFrame.java | 28 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 3 |
2 files changed, 5 insertions, 26 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java index 300f22bd96..3625e2da06 100644 --- a/src/com/android/launcher3/AppWidgetResizeFrame.java +++ b/src/com/android/launcher3/AppWidgetResizeFrame.java @@ -15,7 +15,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; -import android.appwidget.AppWidgetProviderInfo; import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; @@ -238,23 +237,6 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O mWidgetPadding = getDefaultPaddingForWidget(getContext(), widgetView.getAppWidgetInfo().provider, null); - // 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 < 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 < mMaxHSpan; - if (!mHorizontalResizeActive) { - mDragHandles[INDEX_LEFT].setVisibility(GONE); - mDragHandles[INDEX_RIGHT].setVisibility(GONE); - } - mReconfigureButton = (ImageButton) findViewById(R.id.widget_reconfigure_button); if (info.isReconfigurable()) { mReconfigureButton.setVisibility(VISIBLE); @@ -307,12 +289,10 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O } public boolean beginResizeIfPointInRegion(int x, int y) { - mLeftBorderActive = (x < mTouchTargetWidth) && mHorizontalResizeActive; - mRightBorderActive = (x > getWidth() - mTouchTargetWidth) && mHorizontalResizeActive; - mTopBorderActive = (y < mTouchTargetWidth + mTopTouchRegionAdjustment) - && mVerticalResizeActive; - mBottomBorderActive = (y > getHeight() - mTouchTargetWidth + mBottomTouchRegionAdjustment) - && mVerticalResizeActive; + mLeftBorderActive = x < mTouchTargetWidth; + mRightBorderActive = x > getWidth() - mTouchTargetWidth; + mTopBorderActive = y < mTouchTargetWidth + mTopTouchRegionAdjustment; + mBottomBorderActive = y > getHeight() - mTouchTargetWidth + mBottomTouchRegionAdjustment; boolean anyBordersActive = mLeftBorderActive || mRightBorderActive || mTopBorderActive || mBottomBorderActive; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 281dfea492..f4f14e802d 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -2078,8 +2078,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell; AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo(); - if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE - && !options.isAccessibleDrag) { + if (pInfo != null && !options.isAccessibleDrag) { onCompleteRunnable = () -> { if (!isPageInTransition()) { AppWidgetResizeFrame.showForWidget(hostView, cellLayout); |