Merge "Remove LAUNCHER3_ALL_APPS_PULL_UP Bug: 63712253 Verified: all apps transition fully functional Verified: NO_ALL_APPS_ICON = false case also works." into ub-launcher3-dorval-polish2

This commit is contained in:
TreeHugger Robot 2017-08-21 19:22:56 +00:00 committed by Android (Google) Code Review
commit b55b6264ae
9 changed files with 30 additions and 71 deletions

View File

@ -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,

View File

@ -1310,9 +1310,7 @@ public class Launcher extends BaseActivity
mDragController.addDropTarget(mWorkspace);
mDropTargetBar.setup(mDragController);
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
mAllAppsController.setupViews(mAppsView, mHotseat, mWorkspace);
}
if (TestingUtils.MEMORY_DUMP_ENABLED) {
TestingUtils.addWeightWatcher(this);
@ -2280,7 +2278,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) {

View File

@ -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);

View File

@ -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) {

View File

@ -102,7 +102,6 @@ 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));
@ -112,9 +111,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
} else {
getRevealView().setBackground(mBaseDrawable);
}
} else {
super.updateBackground(paddingLeft, paddingTop, paddingRight, paddingBottom);
}
}
/**
@ -232,12 +228,10 @@ 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);
}
}
public SearchUiManager getSearchUiManager() {
return mSearchUiManager;
@ -254,7 +248,6 @@ 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;
@ -265,22 +258,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
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;
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);
}
@Override

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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 {