Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +28 −2 Original line number Diff line number Diff line Loading @@ -116,6 +116,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11; private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12; private static final int FLAG_SMALL_SCREEN = 1 << 13; private static final int FLAG_SLIDE_IN_VIEW_VISIBLE = 1 << 14; /** Flags where a UI could be over a slide in view, so the color override should be disabled. */ private static final int FLAGS_SLIDE_IN_VIEW_ICON_COLOR_OVERRIDE_DISABLED = FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_VOICE_INTERACTION_WINDOW_SHOWING; private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons"; Loading @@ -135,6 +140,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private final ViewGroup mStartContextualContainer; private final int mLightIconColor; private final int mDarkIconColor; /** Color to use for navigation bar buttons, if a slide in view is visible. */ private final int mSlideInViewIconColor; private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat( this::updateNavButtonTranslationY); Loading @@ -149,6 +156,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT this::updateNavButtonDarkIntensity); private final AnimatedFloat mNavButtonDarkIntensityMultiplier = new AnimatedFloat( this::updateNavButtonDarkIntensity); /** Overrides the navigation button color to {@code mSlideInViewIconColor} when {@code 1}. */ private final AnimatedFloat mSlideInViewNavButtonColorOverride = new AnimatedFloat( this::updateNavButtonDarkIntensity); private final RotationButtonListener mRotationButtonListener = new RotationButtonListener(); private final Rect mFloatingRotationButtonBounds = new Rect(); Loading Loading @@ -180,6 +190,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mLightIconColor = context.getColor(R.color.taskbar_nav_icon_light_color); mDarkIconColor = context.getColor(R.color.taskbar_nav_icon_dark_color); // Can precompute color since dark theme change recreates taskbar. mSlideInViewIconColor = Utilities.isDarkTheme(context) ? mLightIconColor : mDarkIconColor; } /** Loading Loading @@ -243,6 +255,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT flags -> (flags & FLAG_IME_VISIBLE) != 0 && !isInKidsMode, AnimatedFloat.VALUE, transForIme, defaultButtonTransY)); mPropertyHolders.add(new StatePropertyHolder( mSlideInViewNavButtonColorOverride, flags -> ((flags & FLAG_SLIDE_IN_VIEW_VISIBLE) != 0) && ((flags & FLAGS_SLIDE_IN_VIEW_ICON_COLOR_OVERRIDE_DISABLED) == 0))); if (alwaysShowButtons) { initButtons(mNavButtonContainer, mEndContextualContainer, mControllers.navButtonController); Loading Loading @@ -524,6 +541,12 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT applyState(); } /** {@code true} if a slide in view is currently visible over taskbar. */ public void setSlideInViewVisible(boolean isSlideInViewVisible) { updateStateForFlag(FLAG_SLIDE_IN_VIEW_VISIBLE, isSlideInViewVisible); applyState(); } /** * Returns true if IME bar is visible */ Loading Loading @@ -669,8 +692,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private void updateNavButtonDarkIntensity() { float darkIntensity = mTaskbarNavButtonDarkIntensity.value * mNavButtonDarkIntensityMultiplier.value; int iconColor = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightIconColor, mDarkIconColor); ArgbEvaluator argbEvaluator = ArgbEvaluator.getInstance(); int iconColor = (int) argbEvaluator.evaluate( darkIntensity, mLightIconColor, mDarkIconColor); iconColor = (int) argbEvaluator.evaluate( mSlideInViewNavButtonColorOverride.value, iconColor, mSlideInViewIconColor); for (ImageView button : mAllButtons) { button.setImageTintList(ColorStateList.valueOf(iconColor)); } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java +3 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ public class TaskbarEduController implements TaskbarControllers.LoggableTaskbarC mTaskbarEduView = (TaskbarEduView) mActivity.getLayoutInflater().inflate( R.layout.taskbar_edu, mActivity.getDragLayer(), false); mTaskbarEduView.init(new TaskbarEduCallbacks()); mControllers.navbarButtonsViewController.setSlideInViewVisible(true); mTaskbarEduView.setOnCloseBeginListener( () -> mControllers.navbarButtonsViewController.setSlideInViewVisible(false)); mTaskbarEduView.addOnCloseListener(() -> mTaskbarEduView = null); mTaskbarEduView.show(); startAnim(createWaveAnim()); Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +4 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.taskbar.BaseTaskbarContext; import com.android.launcher3.taskbar.TaskbarActivityContext; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.taskbar.TaskbarDragController; import com.android.launcher3.taskbar.TaskbarStashController; import com.android.launcher3.testing.TestLogging; Loading Loading @@ -72,7 +73,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { TaskbarAllAppsContext( TaskbarActivityContext taskbarContext, TaskbarAllAppsController windowController, TaskbarStashController taskbarStashController) { TaskbarControllers taskbarControllers) { super(taskbarContext.createWindowContext(TYPE_APPLICATION_OVERLAY, null)); mTaskbarContext = taskbarContext; mWindowController = windowController; Loading @@ -86,9 +87,10 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { this, slideInView, windowController, taskbarStashController); taskbarControllers); mAppsView = slideInView.getAppsView(); TaskbarStashController taskbarStashController = taskbarControllers.taskbarStashController; mWillTaskbarBeVisuallyStashed = taskbarStashController.supportsVisualStashing(); mStashedTaskbarHeight = taskbarStashController.getStashedHeight(); } Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +1 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,7 @@ public final class TaskbarAllAppsController { // to catch invalid states. mControllers.getSharedState().allAppsVisible = true; mAllAppsContext = new TaskbarAllAppsContext(mTaskbarContext, this, mControllers.taskbarStashController); mAllAppsContext = new TaskbarAllAppsContext(mTaskbarContext, this, mControllers); mAllAppsContext.getDragController().init(mControllers); TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener); Optional.ofNullable(mAllAppsContext.getSystemService(WindowManager.class)) Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +0 −9 Original line number Diff line number Diff line Loading @@ -30,13 +30,10 @@ import com.android.launcher3.Insettable; import com.android.launcher3.R; import com.android.launcher3.views.AbstractSlideInView; import java.util.Optional; /** Wrapper for taskbar all apps with slide-in behavior. */ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllAppsContext> implements Insettable, DeviceProfile.OnDeviceProfileChangeListener { private TaskbarAllAppsContainerView mAppsView; private OnCloseListener mOnCloseBeginListener; private float mShiftRange; public TaskbarAllAppsSlideInView(Context context, AttributeSet attrs) { Loading Loading @@ -72,14 +69,8 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp return mAppsView; } /** Callback invoked when the view is beginning to close (e.g. close animation is started). */ void setOnCloseBeginListener(OnCloseListener onCloseBeginListener) { mOnCloseBeginListener = onCloseBeginListener; } @Override protected void handleClose(boolean animate) { Optional.ofNullable(mOnCloseBeginListener).ifPresent(OnCloseListener::onSlideInViewClosed); handleClose(animate, ALL_APPS.getTransitionDuration(mActivityContext, false /* isToState */)); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +28 −2 Original line number Diff line number Diff line Loading @@ -116,6 +116,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11; private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12; private static final int FLAG_SMALL_SCREEN = 1 << 13; private static final int FLAG_SLIDE_IN_VIEW_VISIBLE = 1 << 14; /** Flags where a UI could be over a slide in view, so the color override should be disabled. */ private static final int FLAGS_SLIDE_IN_VIEW_ICON_COLOR_OVERRIDE_DISABLED = FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_VOICE_INTERACTION_WINDOW_SHOWING; private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons"; Loading @@ -135,6 +140,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private final ViewGroup mStartContextualContainer; private final int mLightIconColor; private final int mDarkIconColor; /** Color to use for navigation bar buttons, if a slide in view is visible. */ private final int mSlideInViewIconColor; private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat( this::updateNavButtonTranslationY); Loading @@ -149,6 +156,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT this::updateNavButtonDarkIntensity); private final AnimatedFloat mNavButtonDarkIntensityMultiplier = new AnimatedFloat( this::updateNavButtonDarkIntensity); /** Overrides the navigation button color to {@code mSlideInViewIconColor} when {@code 1}. */ private final AnimatedFloat mSlideInViewNavButtonColorOverride = new AnimatedFloat( this::updateNavButtonDarkIntensity); private final RotationButtonListener mRotationButtonListener = new RotationButtonListener(); private final Rect mFloatingRotationButtonBounds = new Rect(); Loading Loading @@ -180,6 +190,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mLightIconColor = context.getColor(R.color.taskbar_nav_icon_light_color); mDarkIconColor = context.getColor(R.color.taskbar_nav_icon_dark_color); // Can precompute color since dark theme change recreates taskbar. mSlideInViewIconColor = Utilities.isDarkTheme(context) ? mLightIconColor : mDarkIconColor; } /** Loading Loading @@ -243,6 +255,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT flags -> (flags & FLAG_IME_VISIBLE) != 0 && !isInKidsMode, AnimatedFloat.VALUE, transForIme, defaultButtonTransY)); mPropertyHolders.add(new StatePropertyHolder( mSlideInViewNavButtonColorOverride, flags -> ((flags & FLAG_SLIDE_IN_VIEW_VISIBLE) != 0) && ((flags & FLAGS_SLIDE_IN_VIEW_ICON_COLOR_OVERRIDE_DISABLED) == 0))); if (alwaysShowButtons) { initButtons(mNavButtonContainer, mEndContextualContainer, mControllers.navButtonController); Loading Loading @@ -524,6 +541,12 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT applyState(); } /** {@code true} if a slide in view is currently visible over taskbar. */ public void setSlideInViewVisible(boolean isSlideInViewVisible) { updateStateForFlag(FLAG_SLIDE_IN_VIEW_VISIBLE, isSlideInViewVisible); applyState(); } /** * Returns true if IME bar is visible */ Loading Loading @@ -669,8 +692,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT private void updateNavButtonDarkIntensity() { float darkIntensity = mTaskbarNavButtonDarkIntensity.value * mNavButtonDarkIntensityMultiplier.value; int iconColor = (int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightIconColor, mDarkIconColor); ArgbEvaluator argbEvaluator = ArgbEvaluator.getInstance(); int iconColor = (int) argbEvaluator.evaluate( darkIntensity, mLightIconColor, mDarkIconColor); iconColor = (int) argbEvaluator.evaluate( mSlideInViewNavButtonColorOverride.value, iconColor, mSlideInViewIconColor); for (ImageView button : mAllButtons) { button.setImageTintList(ColorStateList.valueOf(iconColor)); } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java +3 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ public class TaskbarEduController implements TaskbarControllers.LoggableTaskbarC mTaskbarEduView = (TaskbarEduView) mActivity.getLayoutInflater().inflate( R.layout.taskbar_edu, mActivity.getDragLayer(), false); mTaskbarEduView.init(new TaskbarEduCallbacks()); mControllers.navbarButtonsViewController.setSlideInViewVisible(true); mTaskbarEduView.setOnCloseBeginListener( () -> mControllers.navbarButtonsViewController.setSlideInViewVisible(false)); mTaskbarEduView.addOnCloseListener(() -> mTaskbarEduView = null); mTaskbarEduView.show(); startAnim(createWaveAnim()); Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +4 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.taskbar.BaseTaskbarContext; import com.android.launcher3.taskbar.TaskbarActivityContext; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.taskbar.TaskbarDragController; import com.android.launcher3.taskbar.TaskbarStashController; import com.android.launcher3.testing.TestLogging; Loading Loading @@ -72,7 +73,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { TaskbarAllAppsContext( TaskbarActivityContext taskbarContext, TaskbarAllAppsController windowController, TaskbarStashController taskbarStashController) { TaskbarControllers taskbarControllers) { super(taskbarContext.createWindowContext(TYPE_APPLICATION_OVERLAY, null)); mTaskbarContext = taskbarContext; mWindowController = windowController; Loading @@ -86,9 +87,10 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { this, slideInView, windowController, taskbarStashController); taskbarControllers); mAppsView = slideInView.getAppsView(); TaskbarStashController taskbarStashController = taskbarControllers.taskbarStashController; mWillTaskbarBeVisuallyStashed = taskbarStashController.supportsVisualStashing(); mStashedTaskbarHeight = taskbarStashController.getStashedHeight(); } Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +1 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,7 @@ public final class TaskbarAllAppsController { // to catch invalid states. mControllers.getSharedState().allAppsVisible = true; mAllAppsContext = new TaskbarAllAppsContext(mTaskbarContext, this, mControllers.taskbarStashController); mAllAppsContext = new TaskbarAllAppsContext(mTaskbarContext, this, mControllers); mAllAppsContext.getDragController().init(mControllers); TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener); Optional.ofNullable(mAllAppsContext.getSystemService(WindowManager.class)) Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +0 −9 Original line number Diff line number Diff line Loading @@ -30,13 +30,10 @@ import com.android.launcher3.Insettable; import com.android.launcher3.R; import com.android.launcher3.views.AbstractSlideInView; import java.util.Optional; /** Wrapper for taskbar all apps with slide-in behavior. */ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllAppsContext> implements Insettable, DeviceProfile.OnDeviceProfileChangeListener { private TaskbarAllAppsContainerView mAppsView; private OnCloseListener mOnCloseBeginListener; private float mShiftRange; public TaskbarAllAppsSlideInView(Context context, AttributeSet attrs) { Loading Loading @@ -72,14 +69,8 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllApp return mAppsView; } /** Callback invoked when the view is beginning to close (e.g. close animation is started). */ void setOnCloseBeginListener(OnCloseListener onCloseBeginListener) { mOnCloseBeginListener = onCloseBeginListener; } @Override protected void handleClose(boolean animate) { Optional.ofNullable(mOnCloseBeginListener).ifPresent(OnCloseListener::onSlideInViewClosed); handleClose(animate, ALL_APPS.getTransitionDuration(mActivityContext, false /* isToState */)); } Loading