Loading quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -218,7 +218,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag private LauncherTransitionAnimator composeRecentsLaunchAnimator(View v, private LauncherTransitionAnimator composeRecentsLaunchAnimator(View v, RemoteAnimationTargetCompat[] targets) { RemoteAnimationTargetCompat[] targets) { // Ensure recents is actually visible // Ensure recents is actually visible if (!mLauncher.isInState(LauncherState.OVERVIEW)) { if (!mLauncher.getStateManager().getState().overviewUi) { return null; return null; } } Loading Loading @@ -720,7 +720,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag postAtFrontOfQueueAsynchronously(handler, () -> { postAtFrontOfQueueAsynchronously(handler, () -> { if ((Utilities.getPrefs(mLauncher) if ((Utilities.getPrefs(mLauncher) .getBoolean("pref_use_screenshot_for_swipe_up", false) .getBoolean("pref_use_screenshot_for_swipe_up", false) && mLauncher.isInState(LauncherState.OVERVIEW)) && mLauncher.getStateManager().getState().overviewUi) || !launcherIsATargetWithMode(targets, MODE_OPENING)) { || !launcherIsATargetWithMode(targets, MODE_OPENING)) { // We use a separate transition for Overview mode. And we can skip the // We use a separate transition for Overview mode. And we can skip the // animation in cases where Launcher is not in the set of opening targets. // animation in cases where Launcher is not in the set of opening targets. Loading quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.uioverrides; import com.android.launcher3.Launcher; /** * Extension of overview state used for QuickScrub */ public class FastOverviewState extends OverviewState { private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI; private static final boolean DEBUG_DIFFERENT_UI = false; public FastOverviewState(int id) { super(id, STATE_FLAGS); } @Override public float getHoseatAlpha(Launcher launcher) { if (DEBUG_DIFFERENT_UI) { return 0; } return super.getHoseatAlpha(launcher); } } quickstep/src/com/android/launcher3/uioverrides/OverviewState.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -34,10 +34,14 @@ import com.android.quickstep.RecentsView; public class OverviewState extends LauncherState { public class OverviewState extends LauncherState { private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS; | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_OVERVIEW_UI; public OverviewState(int id) { public OverviewState(int id) { super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, STATE_FLAGS); this(id, STATE_FLAGS); } protected OverviewState(int id, int stateFlags) { super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, stateFlags); } } @Override @Override Loading quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -60,10 +60,10 @@ public class RecentsViewStateController implements StateHandler { @Override @Override public void setState(LauncherState state) { public void setState(LauncherState state) { mWorkspaceCard.setWorkspaceScrollingEnabled(state == OVERVIEW); mWorkspaceCard.setWorkspaceScrollingEnabled(state.overviewUi); setVisibility(state == OVERVIEW); setVisibility(state.overviewUi); setTransitionProgress(state == OVERVIEW ? 1 : 0); setTransitionProgress(state.overviewUi ? 1 : 0); if (state == OVERVIEW) { if (state.overviewUi) { for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) { for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) { ((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties(); ((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties(); } } Loading Loading @@ -92,20 +92,20 @@ public class RecentsViewStateController implements StateHandler { } } ObjectAnimator progressAnim = ObjectAnimator progressAnim = mTransitionProgress.animateToValue(toState == OVERVIEW ? 1 : 0); mTransitionProgress.animateToValue(toState.overviewUi ? 1 : 0); progressAnim.setDuration(config.duration); progressAnim.setDuration(config.duration); progressAnim.setInterpolator(Interpolators.LINEAR); progressAnim.setInterpolator(Interpolators.LINEAR); progressAnim.addListener(new AnimationSuccessListener() { progressAnim.addListener(new AnimationSuccessListener() { @Override @Override public void onAnimationSuccess(Animator animator) { public void onAnimationSuccess(Animator animator) { mWorkspaceCard.setWorkspaceScrollingEnabled(toState == OVERVIEW); mWorkspaceCard.setWorkspaceScrollingEnabled(toState.overviewUi); mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); } } }); }); builder.play(progressAnim); builder.play(progressAnim); ObjectAnimator visibilityAnim = animateVisibility(toState == OVERVIEW); ObjectAnimator visibilityAnim = animateVisibility(toState.overviewUi); visibilityAnim.setDuration(config.duration); visibilityAnim.setDuration(config.duration); visibilityAnim.setInterpolator(Interpolators.LINEAR); visibilityAnim.setInterpolator(Interpolators.LINEAR); builder.play(visibilityAnim); builder.play(visibilityAnim); Loading quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -43,13 +43,11 @@ public class UiFactory { public static TouchController[] createTouchControllers(Launcher launcher) { public static TouchController[] createTouchControllers(Launcher launcher) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { return new TouchController[] { return new TouchController[] { new IgnoreTouchesInQuickScrub(), new EdgeSwipeController(launcher), new EdgeSwipeController(launcher), new TwoStepSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; new OverviewSwipeController(launcher)}; } else { } else { return new TouchController[] { return new TouchController[] { new IgnoreTouchesInQuickScrub(), new TwoStepSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; new OverviewSwipeController(launcher)}; } } Loading Loading
quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -218,7 +218,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag private LauncherTransitionAnimator composeRecentsLaunchAnimator(View v, private LauncherTransitionAnimator composeRecentsLaunchAnimator(View v, RemoteAnimationTargetCompat[] targets) { RemoteAnimationTargetCompat[] targets) { // Ensure recents is actually visible // Ensure recents is actually visible if (!mLauncher.isInState(LauncherState.OVERVIEW)) { if (!mLauncher.getStateManager().getState().overviewUi) { return null; return null; } } Loading Loading @@ -720,7 +720,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag postAtFrontOfQueueAsynchronously(handler, () -> { postAtFrontOfQueueAsynchronously(handler, () -> { if ((Utilities.getPrefs(mLauncher) if ((Utilities.getPrefs(mLauncher) .getBoolean("pref_use_screenshot_for_swipe_up", false) .getBoolean("pref_use_screenshot_for_swipe_up", false) && mLauncher.isInState(LauncherState.OVERVIEW)) && mLauncher.getStateManager().getState().overviewUi) || !launcherIsATargetWithMode(targets, MODE_OPENING)) { || !launcherIsATargetWithMode(targets, MODE_OPENING)) { // We use a separate transition for Overview mode. And we can skip the // We use a separate transition for Overview mode. And we can skip the // animation in cases where Launcher is not in the set of opening targets. // animation in cases where Launcher is not in the set of opening targets. Loading
quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.uioverrides; import com.android.launcher3.Launcher; /** * Extension of overview state used for QuickScrub */ public class FastOverviewState extends OverviewState { private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI; private static final boolean DEBUG_DIFFERENT_UI = false; public FastOverviewState(int id) { super(id, STATE_FLAGS); } @Override public float getHoseatAlpha(Launcher launcher) { if (DEBUG_DIFFERENT_UI) { return 0; } return super.getHoseatAlpha(launcher); } }
quickstep/src/com/android/launcher3/uioverrides/OverviewState.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -34,10 +34,14 @@ import com.android.quickstep.RecentsView; public class OverviewState extends LauncherState { public class OverviewState extends LauncherState { private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS; | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_OVERVIEW_UI; public OverviewState(int id) { public OverviewState(int id) { super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, STATE_FLAGS); this(id, STATE_FLAGS); } protected OverviewState(int id, int stateFlags) { super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, stateFlags); } } @Override @Override Loading
quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -60,10 +60,10 @@ public class RecentsViewStateController implements StateHandler { @Override @Override public void setState(LauncherState state) { public void setState(LauncherState state) { mWorkspaceCard.setWorkspaceScrollingEnabled(state == OVERVIEW); mWorkspaceCard.setWorkspaceScrollingEnabled(state.overviewUi); setVisibility(state == OVERVIEW); setVisibility(state.overviewUi); setTransitionProgress(state == OVERVIEW ? 1 : 0); setTransitionProgress(state.overviewUi ? 1 : 0); if (state == OVERVIEW) { if (state.overviewUi) { for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) { for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) { ((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties(); ((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties(); } } Loading Loading @@ -92,20 +92,20 @@ public class RecentsViewStateController implements StateHandler { } } ObjectAnimator progressAnim = ObjectAnimator progressAnim = mTransitionProgress.animateToValue(toState == OVERVIEW ? 1 : 0); mTransitionProgress.animateToValue(toState.overviewUi ? 1 : 0); progressAnim.setDuration(config.duration); progressAnim.setDuration(config.duration); progressAnim.setInterpolator(Interpolators.LINEAR); progressAnim.setInterpolator(Interpolators.LINEAR); progressAnim.addListener(new AnimationSuccessListener() { progressAnim.addListener(new AnimationSuccessListener() { @Override @Override public void onAnimationSuccess(Animator animator) { public void onAnimationSuccess(Animator animator) { mWorkspaceCard.setWorkspaceScrollingEnabled(toState == OVERVIEW); mWorkspaceCard.setWorkspaceScrollingEnabled(toState.overviewUi); mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); } } }); }); builder.play(progressAnim); builder.play(progressAnim); ObjectAnimator visibilityAnim = animateVisibility(toState == OVERVIEW); ObjectAnimator visibilityAnim = animateVisibility(toState.overviewUi); visibilityAnim.setDuration(config.duration); visibilityAnim.setDuration(config.duration); visibilityAnim.setInterpolator(Interpolators.LINEAR); visibilityAnim.setInterpolator(Interpolators.LINEAR); builder.play(visibilityAnim); builder.play(visibilityAnim); Loading
quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -43,13 +43,11 @@ public class UiFactory { public static TouchController[] createTouchControllers(Launcher launcher) { public static TouchController[] createTouchControllers(Launcher launcher) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { return new TouchController[] { return new TouchController[] { new IgnoreTouchesInQuickScrub(), new EdgeSwipeController(launcher), new EdgeSwipeController(launcher), new TwoStepSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; new OverviewSwipeController(launcher)}; } else { } else { return new TouchController[] { return new TouchController[] { new IgnoreTouchesInQuickScrub(), new TwoStepSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; new OverviewSwipeController(launcher)}; } } Loading