From d725f644b70239332a4440173e6411e9ffb169a0 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Thu, 17 Aug 2017 22:26:35 -0700 Subject: Remove LAUNCHER3_ALL_APPS_PULL_UP Bug: 63712253 Verified: all apps transition fully functional Verified: NO_ALL_APPS_ICON = false case also works. Change-Id: I779fb7bd4927c5923da3f85590d912dbbbcdef4d --- src/com/android/launcher3/BaseContainerView.java | 2 +- src/com/android/launcher3/Launcher.java | 6 +-- .../LauncherStateTransitionAnimation.java | 24 +++------- .../WorkspaceStateTransitionAnimation.java | 10 ++--- .../launcher3/allapps/AllAppsContainerView.java | 51 ++++++---------------- .../allapps/search/AppsSearchContainerLayout.java | 3 +- src/com/android/launcher3/config/BaseFlags.java | 1 - src/com/android/launcher3/dragndrop/DragLayer.java | 2 +- .../launcher3/ui/AbstractLauncherUiTest.java | 2 +- 9 files changed, 30 insertions(+), 71 deletions(-) diff --git a/src/com/android/launcher3/BaseContainerView.java b/src/com/android/launcher3/BaseContainerView.java index c55a5860e..82175b721 100644 --- a/src/com/android/launcher3/BaseContainerView.java +++ b/src/com/android/launcher3/BaseContainerView.java @@ -62,7 +62,7 @@ public abstract class BaseContainerView extends FrameLayout public BaseContainerView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && this instanceof AllAppsContainerView) { + if (this instanceof AllAppsContainerView) { mBaseDrawable = new ColorDrawable(); } else { TypedArray a = context.obtainStyledAttributes(attrs, diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 615ec4716..106a11b73 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1307,9 +1307,7 @@ public class Launcher extends BaseActivity mDragController.addDropTarget(mWorkspace); mDropTargetBar.setup(mDragController); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - mAllAppsController.setupViews(mAppsView, mHotseat, mWorkspace); - } + mAllAppsController.setupViews(mAppsView, mHotseat, mWorkspace); if (TestingUtils.MEMORY_DUMP_ENABLED) { TestingUtils.addWeightWatcher(this); @@ -2277,7 +2275,7 @@ public class Launcher extends BaseActivity if (v instanceof FolderIcon) { onClickFolderIcon(v); } - } else if ((FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && v instanceof PageIndicator) || + } else if ((v instanceof PageIndicator) || (v == mAllAppsButton && mAllAppsButton != null)) { onClickAllAppsButton(v); } else if (tag instanceof AppInfo) { diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index 9ff61ec98..e2474900d 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -80,13 +80,11 @@ import com.android.launcher3.widget.WidgetsContainerView; public class LauncherStateTransitionAnimation { /** - * animation used for all apps and widget tray when - *{@link FeatureFlags#LAUNCHER3_ALL_APPS_PULL_UP} is {@code false} + * animation used for the widget tray */ public static final int CIRCULAR_REVEAL = 0; /** - * animation used for all apps and not widget tray when - *{@link FeatureFlags#LAUNCHER3_ALL_APPS_PULL_UP} is {@code true} + * animation used for all apps tray */ public static final int PULLUP = 1; @@ -154,13 +152,9 @@ public class LauncherStateTransitionAnimation { mLauncher.getUserEventDispatcher().resetElapsedContainerMillis(); } }; - int animType = CIRCULAR_REVEAL; - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - animType = PULLUP; - } // Only animate the search bar if animating from spring loaded mode back to all apps startAnimationToOverlay( - Workspace.State.NORMAL_HIDDEN, buttonView, toView, animated, animType, cb); + Workspace.State.NORMAL_HIDDEN, buttonView, toView, animated, PULLUP, cb); } /** @@ -193,12 +187,8 @@ public class LauncherStateTransitionAnimation { if (fromState == Launcher.State.APPS || fromState == Launcher.State.APPS_SPRING_LOADED || mAllAppsController.isTransitioning()) { - int animType = CIRCULAR_REVEAL; - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - animType = PULLUP; - } startAnimationToWorkspaceFromAllApps(fromWorkspaceState, toWorkspaceState, - animated, animType, onCompleteRunnable); + animated, PULLUP, onCompleteRunnable); } else if (fromState == Launcher.State.WIDGETS || fromState == Launcher.State.WIDGETS_SPRING_LOADED) { startAnimationToWorkspaceFromWidgets(fromWorkspaceState, toWorkspaceState, @@ -235,8 +225,7 @@ public class LauncherStateTransitionAnimation { playCommonTransitionAnimations(toWorkspaceState, animated, initialized, animation, layerViews); if (!animated || !initialized) { - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && - toWorkspaceState == Workspace.State.NORMAL_HIDDEN) { + if (toWorkspaceState == Workspace.State.NORMAL_HIDDEN) { mAllAppsController.finishPullUp(); } toView.setTranslationX(0.0f); @@ -527,8 +516,7 @@ public class LauncherStateTransitionAnimation { playCommonTransitionAnimations(toWorkspaceState, animated, initialized, animation, layerViews); if (!animated || !initialized) { - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && - fromWorkspaceState == Workspace.State.NORMAL_HIDDEN) { + if (fromWorkspaceState == Workspace.State.NORMAL_HIDDEN) { mAllAppsController.finishPullDown(); } fromView.setVisibility(View.GONE); diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 76772dce4..a105a7303 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -273,9 +273,8 @@ public class WorkspaceStateTransitionAnimation { float finalBackgroundAlpha = (states.stateIsSpringLoaded || states.stateIsOverview) ? 1.0f : 0f; float finalHotseatAlpha = (states.stateIsNormal || states.stateIsSpringLoaded || - (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f; - float finalQsbAlpha = (states.stateIsNormal || - (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f; + states.stateIsNormalHidden) ? 1f : 0f; + float finalQsbAlpha = (states.stateIsNormal || states.stateIsNormalHidden) ? 1f : 0f; float finalWorkspaceTranslationY = 0; if (states.stateIsOverview || states.stateIsOverviewHidden) { @@ -312,8 +311,7 @@ public class WorkspaceStateTransitionAnimation { if (states.stateIsOverviewHidden) { finalAlpha = 0f; } else if(states.stateIsNormalHidden) { - finalAlpha = (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && - i == mWorkspace.getNextPage()) ? 1 : 0; + finalAlpha = (i == mWorkspace.getNextPage()) ? 1 : 0; } else if (states.stateIsNormal && mWorkspaceFadeInAdjacentScreens) { finalAlpha = (i == toPage || i < customPageCount) ? 1f : 0f; } else { @@ -322,7 +320,7 @@ public class WorkspaceStateTransitionAnimation { // If we are animating to/from the small state, then hide the side pages and fade the // current page in - if (!FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && !mWorkspace.isSwitchingState()) { + if (!FeatureFlags.NO_ALL_APPS_ICON && !mWorkspace.isSwitchingState()) { if (states.workspaceToAllApps || states.allAppsToWorkspace) { boolean isCurrentPage = (i == toPage); if (states.allAppsToWorkspace && isCurrentPage) { diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 828a347df..93f04e93b 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -102,18 +102,14 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc @Override protected void updateBackground( int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) { - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { - getRevealView().setBackground(new InsetDrawable(mBaseDrawable, - paddingLeft, paddingTop, paddingRight, paddingBottom)); - getContentView().setBackground( - new InsetDrawable(new ColorDrawable(Color.TRANSPARENT), - paddingLeft, paddingTop, paddingRight, paddingBottom)); - } else { - getRevealView().setBackground(mBaseDrawable); - } + if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { + getRevealView().setBackground(new InsetDrawable(mBaseDrawable, + paddingLeft, paddingTop, paddingRight, paddingBottom)); + getContentView().setBackground( + new InsetDrawable(new ColorDrawable(Color.TRANSPARENT), + paddingLeft, paddingTop, paddingRight, paddingBottom)); } else { - super.updateBackground(paddingLeft, paddingTop, paddingRight, paddingBottom); + getRevealView().setBackground(mBaseDrawable); } } @@ -240,11 +236,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc mAppsRecyclerView.preMeasureViews(mAdapter); mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener()); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - getRevealView().setVisibility(View.VISIBLE); - getContentView().setVisibility(View.VISIBLE); - getContentView().setBackground(null); - } + getRevealView().setVisibility(View.VISIBLE); + getContentView().setVisibility(View.VISIBLE); + getContentView().setBackground(null); } public SearchUiManager getSearchUiManager() { @@ -262,32 +256,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc // Update the number of items in the grid before we measure the view grid.updateAppsViewNumCols(); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - if (mNumAppsPerRow != grid.inv.numColumns || - mNumPredictedAppsPerRow != grid.inv.numColumns) { - mNumAppsPerRow = grid.inv.numColumns; - mNumPredictedAppsPerRow = grid.inv.numColumns; - - mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow); - mAdapter.setNumAppsPerRow(mNumAppsPerRow); - mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow); - } - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - return; - } - - // --- remove START when {@code FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP} is enabled. --- - if (mNumAppsPerRow != grid.allAppsNumCols || - mNumPredictedAppsPerRow != grid.allAppsNumPredictiveCols) { - mNumAppsPerRow = grid.allAppsNumCols; - mNumPredictedAppsPerRow = grid.allAppsNumPredictiveCols; + if (mNumAppsPerRow != grid.inv.numColumns || + mNumPredictedAppsPerRow != grid.inv.numColumns) { + mNumAppsPerRow = grid.inv.numColumns; + mNumPredictedAppsPerRow = grid.inv.numColumns; mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow); mAdapter.setNumAppsPerRow(mNumAppsPerRow); mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow); } - - // --- remove END when {@code FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP} is enabled. --- super.onMeasure(widthMeasureSpec, heightMeasureSpec); } diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java index 39e208874..d50455171 100644 --- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java +++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java @@ -108,8 +108,7 @@ public class AppsSearchContainerLayout extends FrameLayout @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && - !mLauncher.getDeviceProfile().isVerticalBarLayout()) { + if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) { getLayoutParams().height = mLauncher.getDragLayer().getInsets().top + mMinHeight; } super.onMeasure(widthMeasureSpec, heightMeasureSpec); diff --git a/src/com/android/launcher3/config/BaseFlags.java b/src/com/android/launcher3/config/BaseFlags.java index 7964dd15d..456562e2b 100644 --- a/src/com/android/launcher3/config/BaseFlags.java +++ b/src/com/android/launcher3/config/BaseFlags.java @@ -34,7 +34,6 @@ abstract class BaseFlags { public static boolean LAUNCHER3_DISABLE_ICON_NORMALIZATION = false; public static boolean LAUNCHER3_LEGACY_FOLDER_ICON = false; public static boolean LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW = false; - public static boolean LAUNCHER3_ALL_APPS_PULL_UP = true; public static boolean LAUNCHER3_NEW_FOLDER_ANIMATION = true; // When enabled allows to use any point on the fast scrollbar to start dragging. public static final boolean LAUNCHER3_DIRECT_SCROLL = true; diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index be5f01adb..ee6a0e0b8 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -243,7 +243,7 @@ public class DragLayer extends InsettableFrameLayout { return true; } - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && mAllAppsController.onControllerInterceptTouchEvent(ev)) { + if (mAllAppsController.onControllerInterceptTouchEvent(ev)) { mActiveController = mAllAppsController; return true; } diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 7fb5d8521..1be33d2f8 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -103,7 +103,7 @@ public abstract class AbstractLauncherUiTest { */ protected UiObject2 openAllApps() { mDevice.waitForIdle(); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { + if (FeatureFlags.NO_ALL_APPS_ICON) { // clicking on the page indicator brings up all apps tray on non tablets. findViewById(R.id.page_indicator).click(); } else { -- cgit v1.2.3