summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNebojsa Cvetkovic <nebkat@gmail.com>2017-11-10 15:20:37 (GMT)
committerBruno Martins <bgcngm@gmail.com>2019-10-20 13:00:37 (GMT)
commitb63fd2519d0ed589ca7b9fe9066e9df1ed0c1c0d (patch)
treeac1b7652a6ac1b7a94081844962b9647849baef3
parentd43e011e5e29007ef32d15321d7791f585541e15 (diff)
downloadandroid_packages_apps_Trebuchet-b63fd2519d0ed589ca7b9fe9066e9df1ed0c1c0d.zip
android_packages_apps_Trebuchet-b63fd2519d0ed589ca7b9fe9066e9df1ed0c1c0d.tar.gz
android_packages_apps_Trebuchet-b63fd2519d0ed589ca7b9fe9066e9df1ed0c1c0d.tar.bz2
Workspace: Allow resizing any widget
Change-Id: Iba122eb45d4ba81e53267ff341addfe281cf02fe Signed-off-by: Joey Rizzoli <joey@lineageos.org>
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java24
-rw-r--r--src/com/android/launcher3/Workspace.java3
2 files changed, 5 insertions, 22 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index f9a8d1b..b377c0c 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -9,7 +9,6 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.appwidget.AppWidgetHostView;
-import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
@@ -76,8 +75,6 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
private boolean mTopBorderActive;
private boolean mBottomBorderActive;
- private int mResizeMode;
-
private int mRunningHInc;
private int mRunningVInc;
private int mMinHSpan;
@@ -160,7 +157,6 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
mWidgetView = widgetView;
LauncherAppWidgetProviderInfo info = (LauncherAppWidgetProviderInfo)
widgetView.getAppWidgetInfo();
- mResizeMode = info.resizeMode;
mDragLayer = dragLayer;
mMinHSpan = info.minSpanX;
@@ -169,14 +165,6 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
mWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(getContext(),
widgetView.getAppWidgetInfo().provider, null);
- if (mResizeMode == AppWidgetProviderInfo.RESIZE_HORIZONTAL) {
- mDragHandles[INDEX_TOP].setVisibility(GONE);
- mDragHandles[INDEX_BOTTOM].setVisibility(GONE);
- } else if (mResizeMode == AppWidgetProviderInfo.RESIZE_VERTICAL) {
- mDragHandles[INDEX_LEFT].setVisibility(GONE);
- mDragHandles[INDEX_RIGHT].setVisibility(GONE);
- }
-
// When we create the resize frame, we first mark all cells as unoccupied. The appropriate
// cells (same if not resized, or different) will be marked as occupied when the resize
// frame is dismissed.
@@ -186,14 +174,10 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
}
public boolean beginResizeIfPointInRegion(int x, int y) {
- boolean horizontalActive = (mResizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0;
- boolean verticalActive = (mResizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0;
-
- mLeftBorderActive = (x < mTouchTargetWidth) && horizontalActive;
- mRightBorderActive = (x > getWidth() - mTouchTargetWidth) && horizontalActive;
- mTopBorderActive = (y < mTouchTargetWidth + mTopTouchRegionAdjustment) && verticalActive;
- mBottomBorderActive = (y > getHeight() - mTouchTargetWidth + mBottomTouchRegionAdjustment)
- && verticalActive;
+ 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 9f846bb..6928eea 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1872,8 +1872,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell;
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !d.accessibleDrag) {
+ if (pInfo != null && !d.accessibleDrag) {
onCompleteRunnable = new Runnable() {
public void run() {
if (!isPageInTransition()) {