summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNebojsa Cvetkovic <nebkat@gmail.com>2017-11-10 15:20:37 (GMT)
committerArne Coucheron <arco68@gmail.com>2017-12-16 05:58:07 (GMT)
commitcf6e472d8fee34c6fa371786ade4b91f9829f44a (patch)
treeb3d336daa38a9a5c5b4bda0f94d933a0b8b25372
parenta48cdf29c2b220741f76e9949da8f2aa35d08ade (diff)
downloadandroid_packages_apps_Trebuchet-cf6e472d8fee34c6fa371786ade4b91f9829f44a.zip
android_packages_apps_Trebuchet-cf6e472d8fee34c6fa371786ade4b91f9829f44a.tar.gz
android_packages_apps_Trebuchet-cf6e472d8fee34c6fa371786ade4b91f9829f44a.tar.bz2
Workspace: Allow resizing any widget
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 a486a3a..7daa874 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -6,7 +6,6 @@ import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.appwidget.AppWidgetHostView;
-import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Point;
@@ -70,8 +69,6 @@ public class AppWidgetResizeFrame extends FrameLayout
private boolean mTopBorderActive;
private boolean mBottomBorderActive;
- private int mResizeMode;
-
private int mRunningHInc;
private int mRunningVInc;
private int mMinHSpan;
@@ -120,7 +117,6 @@ public class AppWidgetResizeFrame extends FrameLayout
mWidgetView = widgetView;
LauncherAppWidgetProviderInfo info = (LauncherAppWidgetProviderInfo)
widgetView.getAppWidgetInfo();
- mResizeMode = info.resizeMode;
mDragLayer = dragLayer;
mMinHSpan = info.minSpanX;
@@ -135,14 +131,6 @@ public class AppWidgetResizeFrame extends FrameLayout
mWidgetPadding = new Rect(padding, padding, padding, padding);
}
- 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.
@@ -152,14 +140,10 @@ public class AppWidgetResizeFrame extends FrameLayout
}
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 37ee6d7..6c4397b 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2550,8 +2550,7 @@ public class Workspace extends PagedView
final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell;
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !d.accessibleDrag) {
+ if (pInfo != null && !d.accessibleDrag) {
mDelayedResizeRunnable = new Runnable() {
public void run() {
if (!isPageInTransition()) {