Loading quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/AppsDividerView.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,9 @@ import android.util.AttributeSet; import android.view.View; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; Loading @@ -41,9 +44,6 @@ import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.util.Themes; import com.android.launcher3.util.Themes; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; /** /** * A view which shows a horizontal divider * A view which shows a horizontal divider */ */ Loading Loading @@ -288,10 +288,10 @@ public class AppsDividerView extends View implements LauncherStateManager.StateL } } @Override @Override public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent, public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent, PropertySetter setter, Interpolator fadeInterpolator) { PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) { // Don't use setViewAlpha as we want to control the visibility ourselves. // Don't use setViewAlpha as we want to control the visibility ourselves. setter.setFloat(this, ALPHA, hasContent ? 1 : 0, fadeInterpolator); setter.setFloat(this, ALPHA, hasAllAppsContent ? 1 : 0, allAppsFade); } } @Override @Override Loading quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java +28 −21 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,9 @@ import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import android.widget.LinearLayout; import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.AppInfo; import com.android.launcher3.AppInfo; import com.android.launcher3.BubbleTextView; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile; Loading Loading @@ -62,9 +65,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Collections; import java.util.List; import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @TargetApi(Build.VERSION_CODES.P) @TargetApi(Build.VERSION_CODES.P) public class PredictionRowView extends LinearLayout implements public class PredictionRowView extends LinearLayout implements LogContainerProvider, OnDeviceProfileChangeListener, FloatingHeaderRow { LogContainerProvider, OnDeviceProfileChangeListener, FloatingHeaderRow { Loading @@ -80,7 +80,7 @@ public class PredictionRowView extends LinearLayout implements @Override @Override public Integer get(PredictionRowView view) { public Integer get(PredictionRowView view) { return view.mIconCurrentTextAlpha; return view.mIconLastSetTextAlpha; } } }; }; Loading @@ -103,6 +103,8 @@ public class PredictionRowView extends LinearLayout implements private final int mIconTextColor; private final int mIconTextColor; private final int mIconFullTextAlpha; private final int mIconFullTextAlpha; private int mIconLastSetTextAlpha; // Might use mIconFullTextAlpha instead of mIconLastSetTextAlpha if we are translucent. private int mIconCurrentTextAlpha; private int mIconCurrentTextAlpha; private FloatingHeaderView mParent; private FloatingHeaderView mParent; Loading Loading @@ -315,14 +317,27 @@ public class PredictionRowView extends LinearLayout implements } } } } public void setTextAlpha(int alpha) { public void setTextAlpha(int textAlpha) { mIconCurrentTextAlpha = alpha; mIconLastSetTextAlpha = textAlpha; if (getAlpha() < 1 && textAlpha > 0) { // If the entire header is translucent, make sure the text is at full opacity so it's // not double-translucent. However, we support keeping the text invisible (alpha == 0). textAlpha = mIconFullTextAlpha; } mIconCurrentTextAlpha = textAlpha; int iconColor = setColorAlphaBound(mIconTextColor, mIconCurrentTextAlpha); int iconColor = setColorAlphaBound(mIconTextColor, mIconCurrentTextAlpha); for (int i = 0; i < getChildCount(); i++) { for (int i = 0; i < getChildCount(); i++) { ((BubbleTextView) getChildAt(i)).setTextColor(iconColor); ((BubbleTextView) getChildAt(i)).setTextColor(iconColor); } } } } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); // Reapply text alpha so that we update it to be full alpha if the row is now translucent. setTextAlpha(mIconLastSetTextAlpha); } @Override @Override public boolean hasOverlappingRendering() { public boolean hasOverlappingRendering() { return false; return false; Loading Loading @@ -351,23 +366,15 @@ public class PredictionRowView extends LinearLayout implements } } @Override @Override public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent, public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent, PropertySetter setter, Interpolator fadeInterpolator) { PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) { boolean isDrawn = getAlpha() > 0; // Text follows all apps visibility int textAlpha = hasHeaderExtra int textAlpha = hasHeaderExtra && hasAllAppsContent ? mIconFullTextAlpha : 0; ? (hasContent ? mIconFullTextAlpha : 0) // Text follows the content visibility setter.setInt(this, TEXT_ALPHA, textAlpha, allAppsFade); : mIconCurrentTextAlpha; // Leave as before if (!isDrawn) { // If the header is not drawn, no need to animate the text alpha setTextAlpha(textAlpha); } else { setter.setInt(this, TEXT_ALPHA, textAlpha, fadeInterpolator); } setter.setFloat(mOverviewScrollFactor, AnimatedFloat.VALUE, setter.setFloat(mOverviewScrollFactor, AnimatedFloat.VALUE, (hasHeaderExtra && !hasContent) ? 1 : 0, LINEAR); (hasHeaderExtra && !hasAllAppsContent) ? 1 : 0, LINEAR); setter.setFloat(mContentAlphaFactor, AnimatedFloat.VALUE, hasHeaderExtra ? 1 : 0, setter.setFloat(mContentAlphaFactor, AnimatedFloat.VALUE, hasHeaderExtra ? 1 : 0, fadeInterpolator); headerFade); } } @Override @Override Loading quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewPeekState.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,9 @@ */ */ package com.android.launcher3.uioverrides.states; package com.android.launcher3.uioverrides.states; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCRIM_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; Loading Loading @@ -43,6 +45,7 @@ public class OverviewPeekState extends OverviewState { if (this == OVERVIEW_PEEK && fromState == NORMAL) { if (this == OVERVIEW_PEEK && fromState == NORMAL) { builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7); builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7); builder.setInterpolator(ANIM_OVERVIEW_SCRIM_FADE, FAST_OUT_SLOW_IN); } } } } } } quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -43,7 +43,6 @@ import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.Workspace; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.uioverrides.UiFactory; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode; Loading Loading @@ -128,14 +127,15 @@ public class OverviewState extends LauncherState { if (launcher.getDeviceProfile().isVerticalBarLayout()) { if (launcher.getDeviceProfile().isVerticalBarLayout()) { return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON; return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON; } else { } else { boolean hasAllAppsHeaderExtra = launcher.getAppsView() != null && launcher.getAppsView().getFloatingHeaderView().hasVisibleContent(); return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON | return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON | (launcher.getAppsView().getFloatingHeaderView().hasVisibleContent() (hasAllAppsHeaderExtra ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS); ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS); } } } } @Override @Override public float getWorkspaceScrimAlpha(Launcher launcher) { public float getOverviewScrimAlpha(Launcher launcher) { return 0.5f; return 0.5f; } } Loading quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -23,13 +23,17 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_PEEK; import static com.android.launcher3.LauncherState.OVERVIEW_PEEK; import static com.android.launcher3.LauncherStateManager.ANIM_ALL; import static com.android.launcher3.LauncherStateManager.ANIM_ALL; import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT; import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_HEADER_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE; import static com.android.launcher3.anim.Interpolators.ACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; Loading @@ -43,6 +47,7 @@ import android.view.ViewConfiguration; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.util.MotionPauseDetector; Loading Loading @@ -102,6 +107,9 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { mPeekAnim.start(); mPeekAnim.start(); recentsView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, recentsView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING); HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING); mLauncher.getDragLayer().getScrim().animateToSysuiMultiplier(isPaused ? 0 : 1, peekDuration, 0); }); }); } } } } Loading @@ -120,6 +128,13 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { LauncherState toState) { LauncherState toState) { if (fromState == NORMAL && toState == ALL_APPS) { if (fromState == NORMAL && toState == ALL_APPS) { AnimatorSetBuilder builder = new AnimatorSetBuilder(); AnimatorSetBuilder builder = new AnimatorSetBuilder(); // Fade in prediction icons quickly, then rest of all apps after reaching overview. float progressToReachOverview = NORMAL.getVerticalProgress(mLauncher) - OVERVIEW.getVerticalProgress(mLauncher); builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD)); builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(LINEAR, progressToReachOverview, 1)); // Get workspace out of the way quickly, to prepare for potential pause. // Get workspace out of the way quickly, to prepare for potential pause. builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3); builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3); Loading Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/AppsDividerView.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,9 @@ import android.util.AttributeSet; import android.view.View; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; Loading @@ -41,9 +44,6 @@ import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.util.Themes; import com.android.launcher3.util.Themes; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; /** /** * A view which shows a horizontal divider * A view which shows a horizontal divider */ */ Loading Loading @@ -288,10 +288,10 @@ public class AppsDividerView extends View implements LauncherStateManager.StateL } } @Override @Override public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent, public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent, PropertySetter setter, Interpolator fadeInterpolator) { PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) { // Don't use setViewAlpha as we want to control the visibility ourselves. // Don't use setViewAlpha as we want to control the visibility ourselves. setter.setFloat(this, ALPHA, hasContent ? 1 : 0, fadeInterpolator); setter.setFloat(this, ALPHA, hasAllAppsContent ? 1 : 0, allAppsFade); } } @Override @Override Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java +28 −21 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,9 @@ import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import android.widget.LinearLayout; import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.AppInfo; import com.android.launcher3.AppInfo; import com.android.launcher3.BubbleTextView; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile; Loading Loading @@ -62,9 +65,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Collections; import java.util.List; import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @TargetApi(Build.VERSION_CODES.P) @TargetApi(Build.VERSION_CODES.P) public class PredictionRowView extends LinearLayout implements public class PredictionRowView extends LinearLayout implements LogContainerProvider, OnDeviceProfileChangeListener, FloatingHeaderRow { LogContainerProvider, OnDeviceProfileChangeListener, FloatingHeaderRow { Loading @@ -80,7 +80,7 @@ public class PredictionRowView extends LinearLayout implements @Override @Override public Integer get(PredictionRowView view) { public Integer get(PredictionRowView view) { return view.mIconCurrentTextAlpha; return view.mIconLastSetTextAlpha; } } }; }; Loading @@ -103,6 +103,8 @@ public class PredictionRowView extends LinearLayout implements private final int mIconTextColor; private final int mIconTextColor; private final int mIconFullTextAlpha; private final int mIconFullTextAlpha; private int mIconLastSetTextAlpha; // Might use mIconFullTextAlpha instead of mIconLastSetTextAlpha if we are translucent. private int mIconCurrentTextAlpha; private int mIconCurrentTextAlpha; private FloatingHeaderView mParent; private FloatingHeaderView mParent; Loading Loading @@ -315,14 +317,27 @@ public class PredictionRowView extends LinearLayout implements } } } } public void setTextAlpha(int alpha) { public void setTextAlpha(int textAlpha) { mIconCurrentTextAlpha = alpha; mIconLastSetTextAlpha = textAlpha; if (getAlpha() < 1 && textAlpha > 0) { // If the entire header is translucent, make sure the text is at full opacity so it's // not double-translucent. However, we support keeping the text invisible (alpha == 0). textAlpha = mIconFullTextAlpha; } mIconCurrentTextAlpha = textAlpha; int iconColor = setColorAlphaBound(mIconTextColor, mIconCurrentTextAlpha); int iconColor = setColorAlphaBound(mIconTextColor, mIconCurrentTextAlpha); for (int i = 0; i < getChildCount(); i++) { for (int i = 0; i < getChildCount(); i++) { ((BubbleTextView) getChildAt(i)).setTextColor(iconColor); ((BubbleTextView) getChildAt(i)).setTextColor(iconColor); } } } } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); // Reapply text alpha so that we update it to be full alpha if the row is now translucent. setTextAlpha(mIconLastSetTextAlpha); } @Override @Override public boolean hasOverlappingRendering() { public boolean hasOverlappingRendering() { return false; return false; Loading Loading @@ -351,23 +366,15 @@ public class PredictionRowView extends LinearLayout implements } } @Override @Override public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent, public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent, PropertySetter setter, Interpolator fadeInterpolator) { PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) { boolean isDrawn = getAlpha() > 0; // Text follows all apps visibility int textAlpha = hasHeaderExtra int textAlpha = hasHeaderExtra && hasAllAppsContent ? mIconFullTextAlpha : 0; ? (hasContent ? mIconFullTextAlpha : 0) // Text follows the content visibility setter.setInt(this, TEXT_ALPHA, textAlpha, allAppsFade); : mIconCurrentTextAlpha; // Leave as before if (!isDrawn) { // If the header is not drawn, no need to animate the text alpha setTextAlpha(textAlpha); } else { setter.setInt(this, TEXT_ALPHA, textAlpha, fadeInterpolator); } setter.setFloat(mOverviewScrollFactor, AnimatedFloat.VALUE, setter.setFloat(mOverviewScrollFactor, AnimatedFloat.VALUE, (hasHeaderExtra && !hasContent) ? 1 : 0, LINEAR); (hasHeaderExtra && !hasAllAppsContent) ? 1 : 0, LINEAR); setter.setFloat(mContentAlphaFactor, AnimatedFloat.VALUE, hasHeaderExtra ? 1 : 0, setter.setFloat(mContentAlphaFactor, AnimatedFloat.VALUE, hasHeaderExtra ? 1 : 0, fadeInterpolator); headerFade); } } @Override @Override Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewPeekState.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,9 @@ */ */ package com.android.launcher3.uioverrides.states; package com.android.launcher3.uioverrides.states; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCRIM_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; Loading Loading @@ -43,6 +45,7 @@ public class OverviewPeekState extends OverviewState { if (this == OVERVIEW_PEEK && fromState == NORMAL) { if (this == OVERVIEW_PEEK && fromState == NORMAL) { builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7); builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7); builder.setInterpolator(ANIM_OVERVIEW_SCRIM_FADE, FAST_OUT_SLOW_IN); } } } } } }
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -43,7 +43,6 @@ import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.Workspace; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.uioverrides.UiFactory; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode; Loading Loading @@ -128,14 +127,15 @@ public class OverviewState extends LauncherState { if (launcher.getDeviceProfile().isVerticalBarLayout()) { if (launcher.getDeviceProfile().isVerticalBarLayout()) { return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON; return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON; } else { } else { boolean hasAllAppsHeaderExtra = launcher.getAppsView() != null && launcher.getAppsView().getFloatingHeaderView().hasVisibleContent(); return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON | return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON | (launcher.getAppsView().getFloatingHeaderView().hasVisibleContent() (hasAllAppsHeaderExtra ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS); ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS); } } } } @Override @Override public float getWorkspaceScrimAlpha(Launcher launcher) { public float getOverviewScrimAlpha(Launcher launcher) { return 0.5f; return 0.5f; } } Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -23,13 +23,17 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_PEEK; import static com.android.launcher3.LauncherState.OVERVIEW_PEEK; import static com.android.launcher3.LauncherStateManager.ANIM_ALL; import static com.android.launcher3.LauncherStateManager.ANIM_ALL; import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT; import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_HEADER_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE; import static com.android.launcher3.anim.Interpolators.ACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; Loading @@ -43,6 +47,7 @@ import android.view.ViewConfiguration; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.util.MotionPauseDetector; Loading Loading @@ -102,6 +107,9 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { mPeekAnim.start(); mPeekAnim.start(); recentsView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, recentsView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING); HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING); mLauncher.getDragLayer().getScrim().animateToSysuiMultiplier(isPaused ? 0 : 1, peekDuration, 0); }); }); } } } } Loading @@ -120,6 +128,13 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { LauncherState toState) { LauncherState toState) { if (fromState == NORMAL && toState == ALL_APPS) { if (fromState == NORMAL && toState == ALL_APPS) { AnimatorSetBuilder builder = new AnimatorSetBuilder(); AnimatorSetBuilder builder = new AnimatorSetBuilder(); // Fade in prediction icons quickly, then rest of all apps after reaching overview. float progressToReachOverview = NORMAL.getVerticalProgress(mLauncher) - OVERVIEW.getVerticalProgress(mLauncher); builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress(ACCEL, 0, ALL_APPS_CONTENT_FADE_THRESHOLD)); builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(LINEAR, progressToReachOverview, 1)); // Get workspace out of the way quickly, to prepare for potential pause. // Get workspace out of the way quickly, to prepare for potential pause. builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3); builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3); Loading