mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Fade out the taskbar icons when animating to overview in 3 button nav." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f6003ff070
@@ -785,17 +785,12 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "NavbarButtonsViewController:");
|
||||
|
||||
pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
|
||||
pw.println(String.format(
|
||||
"%s\tmLightIconColor=0x%s", prefix, Integer.toHexString(mLightIconColor)));
|
||||
pw.println(String.format(
|
||||
"%s\tmDarkIconColor=0x%s", prefix, Integer.toHexString(mDarkIconColor)));
|
||||
pw.println(String.format(
|
||||
"%s\tmFloatingRotationButtonBounds=%s", prefix, mFloatingRotationButtonBounds));
|
||||
pw.println(String.format(
|
||||
"%s\tmSysuiStateFlags=%s",
|
||||
prefix,
|
||||
QuickStepContract.getSystemUiStateString(mSysuiStateFlags)));
|
||||
pw.println(prefix + "\tmState=" + getStateString(mState));
|
||||
pw.println(prefix + "\tmLightIconColor=" + Integer.toHexString(mLightIconColor));
|
||||
pw.println(prefix + "\tmDarkIconColor=" + Integer.toHexString(mDarkIconColor));
|
||||
pw.println(prefix + "\tmFloatingRotationButtonBounds=" + mFloatingRotationButtonBounds);
|
||||
pw.println(prefix + "\tmSysuiStateFlags=" + QuickStepContract.getSystemUiStateString(
|
||||
mSysuiStateFlags));
|
||||
}
|
||||
|
||||
private static String getStateString(int flags) {
|
||||
|
||||
@@ -209,10 +209,9 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "StashedHandleViewController:");
|
||||
|
||||
pw.println(String.format(
|
||||
"%s\tisStashedHandleVisible=%b", prefix, isStashedHandleVisible()));
|
||||
pw.println(String.format("%s\tmStashedHandleWidth=%dpx", prefix, mStashedHandleWidth));
|
||||
pw.println(String.format("%s\tmStashedHandleHeight=%dpx", prefix, mStashedHandleHeight));
|
||||
pw.println(prefix + "\tisStashedHandleVisible=" + isStashedHandleVisible());
|
||||
pw.println(prefix + "\tmStashedHandleWidth=" + mStashedHandleWidth);
|
||||
pw.println(prefix + "\tmStashedHandleHeight=" + mStashedHandleHeight);
|
||||
mRegionSamplingHelper.dump(prefix, pw);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,7 @@ public class TaskbarAutohideSuspendController implements
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarAutohideSuspendController:");
|
||||
|
||||
pw.println(String.format(
|
||||
"%s\tmAutohideSuspendFlags=%s", prefix, getStateString(mAutohideSuspendFlags)));
|
||||
pw.println(prefix + "\tmAutohideSuspendFlags=" + getStateString(mAutohideSuspendFlags));
|
||||
}
|
||||
|
||||
private static String getStateString(int flags) {
|
||||
|
||||
@@ -559,13 +559,11 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarDragController:");
|
||||
|
||||
pw.println(String.format("%s\tmDragIconSize=%dpx", prefix, mDragIconSize));
|
||||
pw.println(String.format("%s\tmTempXY=%s", prefix, Arrays.toString(mTempXY)));
|
||||
pw.println(String.format("%s\tmRegistrationX=%d", prefix, mRegistrationX));
|
||||
pw.println(String.format("%s\tmRegistrationY=%d", prefix, mRegistrationY));
|
||||
pw.println(String.format(
|
||||
"%s\tmIsSystemDragInProgress=%b", prefix, mIsSystemDragInProgress));
|
||||
pw.println(String.format(
|
||||
"%s\tisInternalDragInProgess=%b", prefix, super.isDragging()));
|
||||
pw.println(prefix + "\tmDragIconSize=" + mDragIconSize);
|
||||
pw.println(prefix + "\tmTempXY=" + Arrays.toString(mTempXY));
|
||||
pw.println(prefix + "\tmRegistrationX=" + mRegistrationX);
|
||||
pw.println(prefix + "\tmRegistrationY=" + mRegistrationY);
|
||||
pw.println(prefix + "\tmIsSystemDragInProgress=" + mIsSystemDragInProgress);
|
||||
pw.println(prefix + "\tisInternalDragInProgess=" + super.isDragging());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,10 +144,9 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarDragLayerController:");
|
||||
|
||||
pw.println(String.format("%s\tmBgOffset=%.2f", prefix, mBgOffset.value));
|
||||
pw.println(String.format("%s\tmFolderMargin=%dpx", prefix, mFolderMargin));
|
||||
pw.println(String.format(
|
||||
"%s\tmLastSetBackgroundAlpha=%.2f", prefix, mLastSetBackgroundAlpha));
|
||||
pw.println(prefix + "\tmBgOffset=" + mBgOffset.value);
|
||||
pw.println(prefix + "\tmFolderMargin=" + mFolderMargin);
|
||||
pw.println(prefix + "\tmLastSetBackgroundAlpha=" + mLastSetBackgroundAlpha);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -191,12 +191,10 @@ public class TaskbarEduController implements TaskbarControllers.LoggableTaskbarC
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarEduController:");
|
||||
|
||||
pw.println(String.format("%s\tisShowingEdu=%b", prefix, mTaskbarEduView != null));
|
||||
pw.println(String.format("%s\tmWaveAnimTranslationY=%.2f", prefix, mWaveAnimTranslationY));
|
||||
pw.println(String.format(
|
||||
"%s\tmWaveAnimTranslationYReturnOvershoot=%.2f",
|
||||
prefix,
|
||||
mWaveAnimTranslationYReturnOvershoot));
|
||||
pw.println(prefix + "\tisShowingEdu=" + (mTaskbarEduView != null));
|
||||
pw.println(prefix + "\tmWaveAnimTranslationY=" + mWaveAnimTranslationY);
|
||||
pw.println(prefix + "\tmWaveAnimTranslationYReturnOvershoot="
|
||||
+ mWaveAnimTranslationYReturnOvershoot);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,11 +111,9 @@ public class TaskbarKeyguardController implements TaskbarControllers.LoggableTas
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarKeyguardController:");
|
||||
|
||||
pw.println(String.format(
|
||||
"%s\tmKeyguardSysuiFlags=%s",
|
||||
prefix,
|
||||
QuickStepContract.getSystemUiStateString(mKeyguardSysuiFlags)));
|
||||
pw.println(String.format("%s\tmBouncerShowing=%b", prefix, mBouncerShowing));
|
||||
pw.println(String.format("%s\tmIsScreenOff=%b", prefix, mIsScreenOff));
|
||||
pw.println(prefix + "\tmKeyguardSysuiFlags=" + QuickStepContract.getSystemUiStateString(
|
||||
mKeyguardSysuiFlags));
|
||||
pw.println(prefix + "\tmBouncerShowing=" + mBouncerShowing);
|
||||
pw.println(prefix + "\tmIsScreenOff=" + mIsScreenOff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.QuickstepTransitionManager;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimatorListeners;
|
||||
import com.android.launcher3.statemanager.StateManager;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.quickstep.AnimatedFloat;
|
||||
@@ -367,11 +368,14 @@ import java.util.function.Supplier;
|
||||
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
|
||||
boolean committed) {
|
||||
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
|
||||
float toAlignment = mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) ? 1 : 0;
|
||||
boolean willStashVisually =
|
||||
isInStashedState && mControllers.taskbarStashController.supportsVisualStashing();
|
||||
float toAlignment =
|
||||
mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) && !willStashVisually ? 1 : 0;
|
||||
|
||||
TaskbarStashController controller = mControllers.taskbarStashController;
|
||||
controller.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
|
||||
Animator stashAnimator = controller.applyStateWithoutStart(duration);
|
||||
TaskbarStashController stashController = mControllers.taskbarStashController;
|
||||
stashController.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
|
||||
Animator stashAnimator = stashController.applyStateWithoutStart(duration);
|
||||
if (stashAnimator != null) {
|
||||
stashAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@@ -391,9 +395,13 @@ import java.util.function.Supplier;
|
||||
});
|
||||
animatorSet.play(stashAnimator);
|
||||
}
|
||||
|
||||
// If we're already animating to the value, just leave it be instead of restarting it.
|
||||
if (mIconAlignmentForLauncherState.value == toAlignment) {
|
||||
// Already at expected value, but make sure we run the callback at the end.
|
||||
animatorSet.addListener(AnimatorListeners.forEndCallback(
|
||||
this::onIconAlignmentRatioChangedForStateTransition));
|
||||
}
|
||||
if (!mIconAlignmentForLauncherState.isAnimatingToValue(toAlignment)) {
|
||||
// If we're already animating to the value, just leave it be instead of restarting it.
|
||||
mIconAlignmentForLauncherState.finishAnimation();
|
||||
animatorSet.play(mIconAlignmentForLauncherState.animateToValue(toAlignment)
|
||||
.setDuration(duration));
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.launcher3.taskbar;
|
||||
|
||||
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS;
|
||||
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_KEY;
|
||||
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_LONGPRESS;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_TAP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_LONGPRESS;
|
||||
@@ -28,6 +27,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
|
||||
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
|
||||
|
||||
import android.os.Bundle;
|
||||
@@ -72,9 +72,8 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarNavButtonController:");
|
||||
|
||||
pw.println(String.format(
|
||||
"%s\tmLastScreenPinLongPress=%dms", prefix, mLastScreenPinLongPress));
|
||||
pw.println(String.format("%s\tmScreenPinned=%b", prefix, mScreenPinned));
|
||||
pw.println(prefix + "\tmLastScreenPinLongPress=" + mLastScreenPinLongPress);
|
||||
pw.println(prefix + "\tmScreenPinned=" + mScreenPinned);
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
|
||||
@@ -98,6 +98,6 @@ public class TaskbarScrimViewController implements TaskbarControllers.LoggableTa
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarScrimViewController:");
|
||||
|
||||
pw.println(String.format("%s\tmScrimAlpha.value=%.2f", prefix, mScrimAlpha.value));
|
||||
pw.println(prefix + "\tmScrimAlpha.value=" + mScrimAlpha.value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,16 +728,14 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarStashController:");
|
||||
|
||||
pw.println(String.format("%s\tmStashedHeight=%dpx", prefix, mStashedHeight));
|
||||
pw.println(String.format("%s\tmUnstashedHeight=%dpx", prefix, mUnstashedHeight));
|
||||
pw.println(String.format("%s\tmIsStashed=%b", prefix, mIsStashed));
|
||||
pw.println(String.format(
|
||||
"%s\tappliedState=%s", prefix, getStateString(mStatePropertyHolder.mPrevFlags)));
|
||||
pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
|
||||
pw.println(String.format(
|
||||
"%s\tmIsSystemGestureInProgress=%b", prefix, mIsSystemGestureInProgress));
|
||||
pw.println(String.format("%s\tmIsImeShowing=%b", prefix, mIsImeShowing));
|
||||
pw.println(String.format("%s\tmIsImeSwitcherShowing=%b", prefix, mIsImeSwitcherShowing));
|
||||
pw.println(prefix + "\tmStashedHeight=" + mStashedHeight);
|
||||
pw.println(prefix + "\tmUnstashedHeight=" + mUnstashedHeight);
|
||||
pw.println(prefix + "\tmIsStashed=" + mIsStashed);
|
||||
pw.println(prefix + "\tappliedState=" + getStateString(mStatePropertyHolder.mPrevFlags));
|
||||
pw.println(prefix + "\tmState=" + getStateString(mState));
|
||||
pw.println(prefix + "\tmIsSystemGestureInProgress=" + mIsSystemGestureInProgress);
|
||||
pw.println(prefix + "\tmIsImeShowing=" + mIsImeShowing);
|
||||
pw.println(prefix + "\tmIsImeSwitcherShowing=" + mIsImeSwitcherShowing);
|
||||
}
|
||||
|
||||
private static String getStateString(int flags) {
|
||||
|
||||
@@ -373,6 +373,19 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
@Override
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "TaskbarViewController:");
|
||||
|
||||
mTaskbarIconAlpha.dump(
|
||||
prefix + "\t",
|
||||
pw,
|
||||
"mTaskbarIconAlpha",
|
||||
"ALPHA_INDEX_HOME",
|
||||
"ALPHA_INDEX_KEYGUARD",
|
||||
"ALPHA_INDEX_STASH",
|
||||
"ALPHA_INDEX_RECENTS_DISABLED",
|
||||
"ALPHA_INDEX_NOTIFICATION_EXPANDED",
|
||||
"ALPHA_INDEX_ASSISTANT_INVOKED",
|
||||
"ALPHA_INDEX_IME_BUTTON_NAV");
|
||||
|
||||
mModelCallbacks.dumpLogs(prefix + "\t", pw);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.quickstep.util.LayoutUtils;
|
||||
@@ -95,13 +93,7 @@ public class OverviewState extends LauncherState {
|
||||
|
||||
@Override
|
||||
public boolean isTaskbarStashed(Launcher launcher) {
|
||||
if (launcher instanceof BaseQuickstepLauncher) {
|
||||
LauncherTaskbarUIController uiController =
|
||||
((BaseQuickstepLauncher) launcher).getTaskbarUIController();
|
||||
|
||||
return uiController != null && uiController.supportsVisualStashing();
|
||||
}
|
||||
return super.isTaskbarStashed(launcher);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -208,14 +208,18 @@ public abstract class LauncherState implements BaseState<LauncherState> {
|
||||
return (getVisibleElements(launcher) & elements) == elements;
|
||||
}
|
||||
|
||||
/** Returns whether taskbar is stashed and thus should replace hotseat with a handle */
|
||||
/**
|
||||
* Returns whether taskbar is stashed and thus should either:
|
||||
* 1) replace hotseat or taskbar icons with a handle in gesture navigation mode or
|
||||
* 2) fade out the hotseat or taskbar icons in 3-button navigation mode.
|
||||
*/
|
||||
public boolean isTaskbarStashed(Launcher launcher) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Returns whether taskbar is aligned with the hotseat vs position inside apps */
|
||||
public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
|
||||
return !isTaskbarStashed(launcher);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.View;
|
||||
|
||||
import com.android.launcher3.anim.AlphaUpdateListener;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -78,6 +79,29 @@ public class MultiValueAlpha {
|
||||
mUpdateVisibility = updateVisibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the alpha channel values to the given PrintWriter
|
||||
*
|
||||
* @param prefix String to be used before every line
|
||||
* @param pw PrintWriter where the logs should be dumped
|
||||
* @param label String used to help identify this object
|
||||
* @param alphaIndexLabels Strings that represent each alpha channel, these should be entered
|
||||
* in the order of the indexes they represent, starting from 0.
|
||||
*/
|
||||
public void dump(String prefix, PrintWriter pw, String label, String... alphaIndexLabels) {
|
||||
pw.println(prefix + label);
|
||||
|
||||
String innerPrefix = prefix + '\t';
|
||||
for (int i = 0; i < alphaIndexLabels.length; i++) {
|
||||
if (i >= mMyProperties.length) {
|
||||
pw.println(innerPrefix + alphaIndexLabels[i] + " given for alpha index " + i
|
||||
+ " however there are only " + mMyProperties.length + " alpha channels.");
|
||||
continue;
|
||||
}
|
||||
pw.println(innerPrefix + alphaIndexLabels[i] + "=" + getProperty(i).getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public class AlphaProperty {
|
||||
|
||||
private final int mMyMask;
|
||||
|
||||
Reference in New Issue
Block a user