Workspace: Allow resizing any widget
[BadDaemon: Adapt for S]
Change-Id: Iba122eb45d4ba81e53267ff341addfe281cf02fe
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 7131452..d6e12b6 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -13,7 +13,6 @@
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;
@@ -214,23 +213,6 @@
mMaxHSpan = info.maxSpanX;
mMaxVSpan = info.maxSpanY;
- // 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);
@@ -286,12 +268,10 @@
}
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 73bb828..001cb5a 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2190,8 +2190,7 @@
private Runnable getWidgetResizeFrameRunnable(DragOptions options,
LauncherAppWidgetHostView hostView, CellLayout cellLayout) {
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !options.isAccessibleDrag) {
+ if (pInfo != null && !options.isAccessibleDrag) {
return () -> {
if (!isPageInTransition()) {
AppWidgetResizeFrame.showForWidget(hostView, cellLayout);