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
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 3ebccda..f835748 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -89,8 +89,6 @@
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 @@
}
}
- void disableDragTarget() {
- mIsDragTarget = false;
- }
-
- public boolean isDragTarget() {
- return mIsDragTarget;
- }
-
void setIsDragOverlapping(boolean isDragOverlapping) {
if (mIsDragOverlapping != isDragOverlapping) {
mIsDragOverlapping = isDragOverlapping;
@@ -421,26 +411,22 @@
}
}
- 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 @@
@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 @@
@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 @@
@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 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.
*/