diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-08-02 03:37:39 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-09-08 14:06:30 -0700 |
commit | 7ce471bdf6d77c9d5778810d9ea033313c579067 (patch) | |
tree | 26567ed32b78611f33f9823f7514fbb1f8de821c /src/com/android/launcher3/CellLayout.java | |
parent | 17e780794bd10e08405350af8fa1f2fffff79829 (diff) | |
download | packages_apps_Trebuchet-7ce471bdf6d77c9d5778810d9ea033313c579067.tar.gz packages_apps_Trebuchet-7ce471bdf6d77c9d5778810d9ea033313c579067.tar.bz2 packages_apps_Trebuchet-7ce471bdf6d77c9d5778810d9ea033313c579067.zip |
Removing support for CustomContent screen
The supported way to customize Launcher and add a "-1 page" is by
using LauncherOverlays. Custom content screen is no longer supported.
Change-Id: I3f8a2734c287d1a69ae0c038ec1de1d45fa1b464
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 3ebccda9e..f83574808 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -89,8 +89,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { private int mCountY; private boolean mDropPending = false; - private boolean mIsDragTarget = true; - private boolean mJailContent = true; // These are temporary variables to prevent having to allocate a new object just to // return an (x, y) value from helper functions. Do NOT use them to maintain other state. @@ -404,14 +402,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { } } - void disableDragTarget() { - mIsDragTarget = false; - } - - public boolean isDragTarget() { - return mIsDragTarget; - } - void setIsDragOverlapping(boolean isDragOverlapping) { if (mIsDragOverlapping != isDragOverlapping) { mIsDragOverlapping = isDragOverlapping; @@ -421,26 +411,22 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { } } - public void disableJailContent() { - mJailContent = false; - } - @Override protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) { - if (mJailContent) { - ParcelableSparseArray jail = getJailedArray(container); - super.dispatchSaveInstanceState(jail); - container.put(R.id.cell_layout_jail_id, jail); - } else { - super.dispatchSaveInstanceState(container); - } + ParcelableSparseArray jail = getJailedArray(container); + super.dispatchSaveInstanceState(jail); + container.put(R.id.cell_layout_jail_id, jail); } @Override protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) { - super.dispatchRestoreInstanceState(mJailContent ? getJailedArray(container) : container); + super.dispatchRestoreInstanceState(getJailedArray(container)); } + /** + * Wrap the SparseArray in another Parcelable so that the item ids do not conflict with our + * our internal resource ids + */ private ParcelableSparseArray getJailedArray(SparseArray<Parcelable> container) { final Parcelable parcelable = container.get(R.id.cell_layout_jail_id); return parcelable instanceof ParcelableSparseArray ? @@ -453,10 +439,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { @Override protected void onDraw(Canvas canvas) { - if (!mIsDragTarget) { - return; - } - // When we're large, we are either drawn in a "hover" state (ie when dragging an item to // a neighboring page) or with just a normal background (if backgroundAlpha > 0.0f) // When we're small, we are either drawn normally or in the "accepts drops" state (during @@ -838,16 +820,10 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { - boolean isFullscreen = mShortcutsAndWidgets.getChildCount() > 0 && - ((LayoutParams) mShortcutsAndWidgets.getChildAt(0).getLayoutParams()).isFullscreen; int left = getPaddingLeft(); - if (!isFullscreen) { - left += (int) Math.ceil(getUnusedHorizontalSpace() / 2f); - } + left += (int) Math.ceil(getUnusedHorizontalSpace() / 2f); int right = r - l - getPaddingRight(); - if (!isFullscreen) { - right -= (int) Math.ceil(getUnusedHorizontalSpace() / 2f); - } + right -= (int) Math.ceil(getUnusedHorizontalSpace() / 2f); int top = getPaddingTop(); int bottom = b - t - getPaddingBottom(); @@ -888,7 +864,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { @Override protected boolean verifyDrawable(Drawable who) { - return super.verifyDrawable(who) || (mIsDragTarget && who == mBackground); + return super.verifyDrawable(who) || (who == mBackground); } public void setShortcutAndWidgetAlpha(float alpha) { @@ -2654,11 +2630,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { public boolean isLockedToGrid = true; /** - * Indicates that this item should use the full extents of its parent. - */ - public boolean isFullscreen = false; - - /** * Indicates whether this item can be reordered. Always true except in the case of the * the AllApps button and QSB place holder. */ |