2021-06-08 20:03:43 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2021 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.taskbar;
|
|
|
|
|
|
2021-11-26 11:38:28 +00:00
|
|
|
import android.content.pm.ActivityInfo.Config;
|
|
|
|
|
|
2021-06-08 20:03:43 -07:00
|
|
|
import androidx.annotation.NonNull;
|
2021-12-15 13:09:39 -08:00
|
|
|
import androidx.annotation.Nullable;
|
2022-03-24 12:08:25 -07:00
|
|
|
import androidx.annotation.VisibleForTesting;
|
2021-06-08 20:03:43 -07:00
|
|
|
|
2022-12-08 13:00:21 -08:00
|
|
|
import com.android.launcher3.anim.AnimatedFloat;
|
2022-02-07 22:22:09 -05:00
|
|
|
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
|
2023-04-14 09:14:41 -07:00
|
|
|
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
|
2022-10-10 23:34:05 +00:00
|
|
|
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
|
2021-10-21 15:31:51 +01:00
|
|
|
import com.android.systemui.shared.rotation.RotationButtonController;
|
2021-06-08 20:03:43 -07:00
|
|
|
|
2021-12-15 13:09:39 -08:00
|
|
|
import java.io.PrintWriter;
|
2021-11-24 10:54:27 -08:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
2023-04-14 09:14:41 -07:00
|
|
|
import java.util.Optional;
|
2021-11-24 10:54:27 -08:00
|
|
|
|
2021-06-08 20:03:43 -07:00
|
|
|
/**
|
|
|
|
|
* Hosts various taskbar controllers to facilitate passing between one another.
|
|
|
|
|
*/
|
|
|
|
|
public class TaskbarControllers {
|
|
|
|
|
|
|
|
|
|
public final TaskbarActivityContext taskbarActivityContext;
|
2021-12-15 13:09:39 -08:00
|
|
|
|
2021-06-08 20:03:43 -07:00
|
|
|
public final TaskbarDragController taskbarDragController;
|
|
|
|
|
public final TaskbarNavButtonController navButtonController;
|
|
|
|
|
public final NavbarButtonsViewController navbarButtonsViewController;
|
|
|
|
|
public final RotationButtonController rotationButtonController;
|
|
|
|
|
public final TaskbarDragLayerController taskbarDragLayerController;
|
2021-09-24 10:48:01 -07:00
|
|
|
public final TaskbarScrimViewController taskbarScrimViewController;
|
2021-06-08 20:03:43 -07:00
|
|
|
public final TaskbarViewController taskbarViewController;
|
2021-08-27 14:11:53 +01:00
|
|
|
public final TaskbarUnfoldAnimationController taskbarUnfoldAnimationController;
|
2021-06-04 15:35:46 -07:00
|
|
|
public final TaskbarKeyguardController taskbarKeyguardController;
|
2021-06-01 16:54:07 -07:00
|
|
|
public final StashedHandleViewController stashedHandleViewController;
|
|
|
|
|
public final TaskbarStashController taskbarStashController;
|
2021-10-27 14:48:47 -07:00
|
|
|
public final TaskbarAutohideSuspendController taskbarAutohideSuspendController;
|
2021-10-12 12:38:55 -07:00
|
|
|
public final TaskbarPopupController taskbarPopupController;
|
2021-12-01 14:51:51 +00:00
|
|
|
public final TaskbarForceVisibleImmersiveController taskbarForceVisibleImmersiveController;
|
2022-02-07 22:22:09 -05:00
|
|
|
public final TaskbarAllAppsController taskbarAllAppsController;
|
2022-04-14 16:15:58 -07:00
|
|
|
public final TaskbarInsetsController taskbarInsetsController;
|
2022-04-04 14:58:30 -07:00
|
|
|
public final VoiceInteractionWindowController voiceInteractionWindowController;
|
2022-01-25 19:46:55 -08:00
|
|
|
public final TaskbarRecentAppsController taskbarRecentAppsController;
|
2022-11-07 13:50:49 -08:00
|
|
|
public final TaskbarTranslationController taskbarTranslationController;
|
2023-03-21 07:07:46 -07:00
|
|
|
public final TaskbarSpringOnStashController taskbarSpringOnStashController;
|
2022-10-10 23:34:05 +00:00
|
|
|
public final TaskbarOverlayController taskbarOverlayController;
|
2022-12-21 03:23:32 +00:00
|
|
|
public final TaskbarEduTooltipController taskbarEduTooltipController;
|
2023-01-24 15:27:00 -08:00
|
|
|
public final KeyboardQuickSwitchController keyboardQuickSwitchController;
|
2023-10-05 15:06:42 -07:00
|
|
|
public final TaskbarPinningController taskbarPinningController;
|
2023-04-14 09:14:41 -07:00
|
|
|
public final Optional<BubbleControllers> bubbleControllers;
|
2021-06-08 20:03:43 -07:00
|
|
|
|
2021-12-15 13:09:39 -08:00
|
|
|
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
|
2022-10-31 18:17:03 +00:00
|
|
|
@Nullable private BackgroundRendererController[] mBackgroundRendererControllers = null;
|
2021-12-15 13:09:39 -08:00
|
|
|
|
2021-06-08 20:03:43 -07:00
|
|
|
/** Do not store this controller, as it may change at runtime. */
|
|
|
|
|
@NonNull public TaskbarUIController uiController = TaskbarUIController.DEFAULT;
|
|
|
|
|
|
2021-11-24 10:54:27 -08:00
|
|
|
private boolean mAreAllControllersInitialized;
|
|
|
|
|
private final List<Runnable> mPostInitCallbacks = new ArrayList<>();
|
|
|
|
|
|
2022-03-24 14:47:32 -07:00
|
|
|
@Nullable private TaskbarSharedState mSharedState = null;
|
|
|
|
|
|
2022-10-31 18:17:03 +00:00
|
|
|
// Roundness property for round corner above taskbar .
|
|
|
|
|
private final AnimatedFloat mCornerRoundness = new AnimatedFloat(this::updateCornerRoundness);
|
|
|
|
|
|
2023-01-17 14:48:36 -08:00
|
|
|
/**
|
|
|
|
|
* Want to add a new controller? Don't forget to:
|
|
|
|
|
* * Call init
|
|
|
|
|
* * Call onDestroy
|
|
|
|
|
* * Add to mControllersToLog
|
|
|
|
|
* * Add tests by adding this controller to TaskbarBaseTestCase.kt and extending that class
|
|
|
|
|
*/
|
2021-06-08 20:03:43 -07:00
|
|
|
public TaskbarControllers(TaskbarActivityContext taskbarActivityContext,
|
|
|
|
|
TaskbarDragController taskbarDragController,
|
|
|
|
|
TaskbarNavButtonController navButtonController,
|
|
|
|
|
NavbarButtonsViewController navbarButtonsViewController,
|
|
|
|
|
RotationButtonController rotationButtonController,
|
|
|
|
|
TaskbarDragLayerController taskbarDragLayerController,
|
2021-06-04 15:35:46 -07:00
|
|
|
TaskbarViewController taskbarViewController,
|
2021-09-24 10:48:01 -07:00
|
|
|
TaskbarScrimViewController taskbarScrimViewController,
|
2021-08-27 14:11:53 +01:00
|
|
|
TaskbarUnfoldAnimationController taskbarUnfoldAnimationController,
|
2021-06-01 16:54:07 -07:00
|
|
|
TaskbarKeyguardController taskbarKeyguardController,
|
|
|
|
|
StashedHandleViewController stashedHandleViewController,
|
2021-07-30 16:00:20 -10:00
|
|
|
TaskbarStashController taskbarStashController,
|
2021-10-12 12:38:55 -07:00
|
|
|
TaskbarAutohideSuspendController taskbarAutoHideSuspendController,
|
2021-12-01 14:51:51 +00:00
|
|
|
TaskbarPopupController taskbarPopupController,
|
2022-01-24 22:54:21 -05:00
|
|
|
TaskbarForceVisibleImmersiveController taskbarForceVisibleImmersiveController,
|
2022-10-10 23:34:05 +00:00
|
|
|
TaskbarOverlayController taskbarOverlayController,
|
2022-04-14 16:15:58 -07:00
|
|
|
TaskbarAllAppsController taskbarAllAppsController,
|
2022-04-04 14:58:30 -07:00
|
|
|
TaskbarInsetsController taskbarInsetsController,
|
2022-01-25 19:46:55 -08:00
|
|
|
VoiceInteractionWindowController voiceInteractionWindowController,
|
2022-11-07 13:50:49 -08:00
|
|
|
TaskbarTranslationController taskbarTranslationController,
|
2023-03-21 07:07:46 -07:00
|
|
|
TaskbarSpringOnStashController taskbarSpringOnStashController,
|
2022-12-21 03:23:32 +00:00
|
|
|
TaskbarRecentAppsController taskbarRecentAppsController,
|
2023-01-24 15:27:00 -08:00
|
|
|
TaskbarEduTooltipController taskbarEduTooltipController,
|
2023-04-03 16:57:32 -07:00
|
|
|
KeyboardQuickSwitchController keyboardQuickSwitchController,
|
2023-10-05 15:06:42 -07:00
|
|
|
TaskbarPinningController taskbarPinningController,
|
2023-04-14 09:14:41 -07:00
|
|
|
Optional<BubbleControllers> bubbleControllers) {
|
2021-06-08 20:03:43 -07:00
|
|
|
this.taskbarActivityContext = taskbarActivityContext;
|
|
|
|
|
this.taskbarDragController = taskbarDragController;
|
|
|
|
|
this.navButtonController = navButtonController;
|
|
|
|
|
this.navbarButtonsViewController = navbarButtonsViewController;
|
|
|
|
|
this.rotationButtonController = rotationButtonController;
|
|
|
|
|
this.taskbarDragLayerController = taskbarDragLayerController;
|
|
|
|
|
this.taskbarViewController = taskbarViewController;
|
2021-09-24 10:48:01 -07:00
|
|
|
this.taskbarScrimViewController = taskbarScrimViewController;
|
2021-08-27 14:11:53 +01:00
|
|
|
this.taskbarUnfoldAnimationController = taskbarUnfoldAnimationController;
|
2021-06-04 15:35:46 -07:00
|
|
|
this.taskbarKeyguardController = taskbarKeyguardController;
|
2021-06-01 16:54:07 -07:00
|
|
|
this.stashedHandleViewController = stashedHandleViewController;
|
|
|
|
|
this.taskbarStashController = taskbarStashController;
|
2021-10-27 14:48:47 -07:00
|
|
|
this.taskbarAutohideSuspendController = taskbarAutoHideSuspendController;
|
2021-10-12 12:38:55 -07:00
|
|
|
this.taskbarPopupController = taskbarPopupController;
|
2021-12-01 14:51:51 +00:00
|
|
|
this.taskbarForceVisibleImmersiveController = taskbarForceVisibleImmersiveController;
|
2022-10-10 23:34:05 +00:00
|
|
|
this.taskbarOverlayController = taskbarOverlayController;
|
2022-02-07 22:22:09 -05:00
|
|
|
this.taskbarAllAppsController = taskbarAllAppsController;
|
2022-04-14 16:15:58 -07:00
|
|
|
this.taskbarInsetsController = taskbarInsetsController;
|
2022-04-04 14:58:30 -07:00
|
|
|
this.voiceInteractionWindowController = voiceInteractionWindowController;
|
2022-11-07 13:50:49 -08:00
|
|
|
this.taskbarTranslationController = taskbarTranslationController;
|
2023-03-21 07:07:46 -07:00
|
|
|
this.taskbarSpringOnStashController = taskbarSpringOnStashController;
|
2022-01-25 19:46:55 -08:00
|
|
|
this.taskbarRecentAppsController = taskbarRecentAppsController;
|
2022-12-21 03:23:32 +00:00
|
|
|
this.taskbarEduTooltipController = taskbarEduTooltipController;
|
2023-01-24 15:27:00 -08:00
|
|
|
this.keyboardQuickSwitchController = keyboardQuickSwitchController;
|
2023-04-03 16:57:32 -07:00
|
|
|
this.taskbarPinningController = taskbarPinningController;
|
2023-04-14 09:14:41 -07:00
|
|
|
this.bubbleControllers = bubbleControllers;
|
2021-06-08 20:03:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initializes all controllers. Note that controllers can now reference each other through this
|
|
|
|
|
* TaskbarControllers instance, but should be careful to only access things that were created
|
|
|
|
|
* in constructors for now, as some controllers may still be waiting for init().
|
|
|
|
|
*/
|
2022-03-24 14:47:32 -07:00
|
|
|
public void init(@NonNull TaskbarSharedState sharedState) {
|
2021-11-24 10:54:27 -08:00
|
|
|
mAreAllControllersInitialized = false;
|
2022-03-24 14:47:32 -07:00
|
|
|
mSharedState = sharedState;
|
2021-11-24 10:54:27 -08:00
|
|
|
|
2021-10-27 14:48:47 -07:00
|
|
|
taskbarDragController.init(this);
|
2021-10-28 16:39:32 -07:00
|
|
|
navbarButtonsViewController.init(this);
|
2021-10-21 15:31:51 +01:00
|
|
|
rotationButtonController.init();
|
2021-06-08 20:03:43 -07:00
|
|
|
taskbarDragLayerController.init(this);
|
|
|
|
|
taskbarViewController.init(this);
|
2021-09-24 10:48:01 -07:00
|
|
|
taskbarScrimViewController.init(this);
|
2021-08-27 14:11:53 +01:00
|
|
|
taskbarUnfoldAnimationController.init(this);
|
2021-06-04 15:35:46 -07:00
|
|
|
taskbarKeyguardController.init(navbarButtonsViewController);
|
2023-03-21 07:07:46 -07:00
|
|
|
taskbarSpringOnStashController.init(this);
|
2021-06-01 16:54:07 -07:00
|
|
|
stashedHandleViewController.init(this);
|
2023-03-23 18:37:04 -07:00
|
|
|
taskbarStashController.init(this, sharedState.setupUIVisible, mSharedState);
|
2021-10-19 14:47:23 -07:00
|
|
|
taskbarPopupController.init(this);
|
2021-12-01 14:51:51 +00:00
|
|
|
taskbarForceVisibleImmersiveController.init(this);
|
2022-10-10 23:34:05 +00:00
|
|
|
taskbarOverlayController.init(this);
|
2022-03-24 14:47:32 -07:00
|
|
|
taskbarAllAppsController.init(this, sharedState.allAppsVisible);
|
2022-03-24 12:08:25 -07:00
|
|
|
navButtonController.init(this);
|
2022-04-14 16:15:58 -07:00
|
|
|
taskbarInsetsController.init(this);
|
2022-04-04 14:58:30 -07:00
|
|
|
voiceInteractionWindowController.init(this);
|
2022-01-25 19:46:55 -08:00
|
|
|
taskbarRecentAppsController.init(this);
|
2022-11-07 13:50:49 -08:00
|
|
|
taskbarTranslationController.init(this);
|
2022-12-21 03:23:32 +00:00
|
|
|
taskbarEduTooltipController.init(this);
|
2023-01-24 15:27:00 -08:00
|
|
|
keyboardQuickSwitchController.init(this);
|
2023-10-05 15:06:42 -07:00
|
|
|
taskbarPinningController.init(this, mSharedState);
|
2023-04-14 09:14:41 -07:00
|
|
|
bubbleControllers.ifPresent(controllers -> controllers.init(this));
|
2021-11-24 10:54:27 -08:00
|
|
|
|
2021-12-15 13:09:39 -08:00
|
|
|
mControllersToLog = new LoggableTaskbarController[] {
|
|
|
|
|
taskbarDragController, navButtonController, navbarButtonsViewController,
|
|
|
|
|
taskbarDragLayerController, taskbarScrimViewController, taskbarViewController,
|
|
|
|
|
taskbarUnfoldAnimationController, taskbarKeyguardController,
|
2023-04-03 12:05:13 -04:00
|
|
|
stashedHandleViewController, taskbarStashController,
|
2022-04-04 14:58:30 -07:00
|
|
|
taskbarAutohideSuspendController, taskbarPopupController, taskbarInsetsController,
|
2024-05-21 21:21:43 +00:00
|
|
|
voiceInteractionWindowController, taskbarRecentAppsController,
|
|
|
|
|
taskbarTranslationController, taskbarEduTooltipController,
|
|
|
|
|
keyboardQuickSwitchController, taskbarPinningController,
|
2021-12-15 13:09:39 -08:00
|
|
|
};
|
2022-10-31 18:17:03 +00:00
|
|
|
mBackgroundRendererControllers = new BackgroundRendererController[] {
|
|
|
|
|
taskbarDragLayerController, taskbarScrimViewController,
|
|
|
|
|
voiceInteractionWindowController
|
|
|
|
|
};
|
|
|
|
|
mCornerRoundness.updateValue(TaskbarBackgroundRenderer.DEFAULT_ROUNDNESS);
|
2021-12-15 13:09:39 -08:00
|
|
|
|
2021-11-24 10:54:27 -08:00
|
|
|
mAreAllControllersInitialized = true;
|
|
|
|
|
for (Runnable postInitCallback : mPostInitCallbacks) {
|
|
|
|
|
postInitCallback.run();
|
|
|
|
|
}
|
|
|
|
|
mPostInitCallbacks.clear();
|
2021-06-08 20:03:43 -07:00
|
|
|
}
|
|
|
|
|
|
2023-07-06 22:01:49 +00:00
|
|
|
/**
|
|
|
|
|
* Sets the ui controller.
|
|
|
|
|
*/
|
|
|
|
|
public void setUiController(@NonNull TaskbarUIController newUiController) {
|
|
|
|
|
uiController.onDestroy();
|
|
|
|
|
uiController = newUiController;
|
|
|
|
|
uiController.init(this);
|
|
|
|
|
uiController.updateStateForSysuiFlags(mSharedState.sysuiStateFlags);
|
|
|
|
|
|
|
|
|
|
// Notify that the ui controller has changed
|
|
|
|
|
navbarButtonsViewController.onUiControllerChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-24 14:47:32 -07:00
|
|
|
@Nullable
|
|
|
|
|
public TaskbarSharedState getSharedState() {
|
|
|
|
|
// This should only be null if called before init() and after destroy().
|
|
|
|
|
return mSharedState;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-26 11:38:28 +00:00
|
|
|
public void onConfigurationChanged(@Config int configChanges) {
|
|
|
|
|
navbarButtonsViewController.onConfigurationChanged(configChanges);
|
2022-11-04 14:36:36 -07:00
|
|
|
taskbarDragLayerController.onConfigurationChanged();
|
2023-01-24 15:27:00 -08:00
|
|
|
keyboardQuickSwitchController.onConfigurationChanged(configChanges);
|
2021-11-26 11:38:28 +00:00
|
|
|
}
|
|
|
|
|
|
2021-06-08 20:03:43 -07:00
|
|
|
/**
|
|
|
|
|
* Cleans up all controllers.
|
|
|
|
|
*/
|
|
|
|
|
public void onDestroy() {
|
2022-10-05 15:46:31 +01:00
|
|
|
mAreAllControllersInitialized = false;
|
2022-03-24 14:47:32 -07:00
|
|
|
mSharedState = null;
|
|
|
|
|
|
2021-10-05 17:44:06 -07:00
|
|
|
navbarButtonsViewController.onDestroy();
|
2021-06-08 20:03:43 -07:00
|
|
|
uiController.onDestroy();
|
|
|
|
|
rotationButtonController.onDestroy();
|
|
|
|
|
taskbarDragLayerController.onDestroy();
|
2021-08-27 14:11:53 +01:00
|
|
|
taskbarUnfoldAnimationController.onDestroy();
|
2021-06-23 12:36:18 -07:00
|
|
|
taskbarViewController.onDestroy();
|
2021-08-17 16:07:22 -07:00
|
|
|
stashedHandleViewController.onDestroy();
|
2021-10-27 14:48:47 -07:00
|
|
|
taskbarAutohideSuspendController.onDestroy();
|
2021-10-19 14:47:23 -07:00
|
|
|
taskbarPopupController.onDestroy();
|
2021-12-01 14:51:51 +00:00
|
|
|
taskbarForceVisibleImmersiveController.onDestroy();
|
2022-10-10 23:34:05 +00:00
|
|
|
taskbarOverlayController.onDestroy();
|
2023-05-17 21:54:16 +00:00
|
|
|
taskbarAllAppsController.onDestroy();
|
2022-03-24 12:08:25 -07:00
|
|
|
navButtonController.onDestroy();
|
2022-04-20 14:43:39 -07:00
|
|
|
taskbarInsetsController.onDestroy();
|
2022-04-04 14:58:30 -07:00
|
|
|
voiceInteractionWindowController.onDestroy();
|
2022-01-25 19:46:55 -08:00
|
|
|
taskbarRecentAppsController.onDestroy();
|
2023-01-24 15:27:00 -08:00
|
|
|
keyboardQuickSwitchController.onDestroy();
|
2023-03-23 18:37:04 -07:00
|
|
|
taskbarStashController.onDestroy();
|
2023-04-14 09:14:41 -07:00
|
|
|
bubbleControllers.ifPresent(controllers -> controllers.onDestroy());
|
2021-12-15 13:09:39 -08:00
|
|
|
|
|
|
|
|
mControllersToLog = null;
|
2022-10-31 18:17:03 +00:00
|
|
|
mBackgroundRendererControllers = null;
|
2021-06-08 20:03:43 -07:00
|
|
|
}
|
2021-11-24 10:54:27 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If all controllers are already initialized, runs the given callback immediately. Otherwise,
|
|
|
|
|
* queues it to run after calling init() on all controllers. This should likely be used in any
|
|
|
|
|
* case where one controller is telling another controller to do something inside init().
|
|
|
|
|
*/
|
|
|
|
|
public void runAfterInit(Runnable callback) {
|
|
|
|
|
if (mAreAllControllersInitialized) {
|
|
|
|
|
callback.run();
|
|
|
|
|
} else {
|
|
|
|
|
mPostInitCallbacks.add(callback);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-15 13:09:39 -08:00
|
|
|
|
|
|
|
|
protected void dumpLogs(String prefix, PrintWriter pw) {
|
|
|
|
|
pw.println(prefix + "TaskbarControllers:");
|
|
|
|
|
|
|
|
|
|
if (mControllersToLog == null) {
|
|
|
|
|
pw.println(String.format(
|
|
|
|
|
"%s\t%s", prefix, "All taskbar controllers have already been destroyed."));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-07 12:49:56 -08:00
|
|
|
pw.println(String.format(
|
|
|
|
|
"%s\tmAreAllControllersInitialized=%b", prefix, mAreAllControllersInitialized));
|
2021-12-15 13:09:39 -08:00
|
|
|
for (LoggableTaskbarController controller : mControllersToLog) {
|
|
|
|
|
controller.dumpLogs(prefix + "\t", pw);
|
|
|
|
|
}
|
2022-03-07 12:49:56 -08:00
|
|
|
uiController.dumpLogs(prefix + "\t", pw);
|
2021-12-15 13:09:39 -08:00
|
|
|
rotationButtonController.dumpLogs(prefix + "\t", pw);
|
2024-07-08 16:28:58 -04:00
|
|
|
if (bubbleControllers.isPresent()) {
|
|
|
|
|
bubbleControllers.get().dump(pw);
|
|
|
|
|
} else {
|
|
|
|
|
pw.println(String.format("%s\t%s", prefix, "Bubble controllers are empty."));
|
|
|
|
|
}
|
2021-12-15 13:09:39 -08:00
|
|
|
}
|
|
|
|
|
|
2022-10-31 18:17:03 +00:00
|
|
|
/**
|
|
|
|
|
* Returns a float property that animates roundness of the round corner above Taskbar.
|
|
|
|
|
*/
|
|
|
|
|
public AnimatedFloat getTaskbarCornerRoundness() {
|
|
|
|
|
return mCornerRoundness;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateCornerRoundness() {
|
|
|
|
|
if (mBackgroundRendererControllers == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (BackgroundRendererController controller : mBackgroundRendererControllers) {
|
|
|
|
|
controller.setCornerRoundness(mCornerRoundness.value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-24 12:08:25 -07:00
|
|
|
@VisibleForTesting
|
|
|
|
|
TaskbarActivityContext getTaskbarActivityContext() {
|
|
|
|
|
// Used to mock
|
|
|
|
|
return taskbarActivityContext;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-15 13:09:39 -08:00
|
|
|
protected interface LoggableTaskbarController {
|
|
|
|
|
void dumpLogs(String prefix, PrintWriter pw);
|
|
|
|
|
}
|
2022-10-31 18:17:03 +00:00
|
|
|
|
|
|
|
|
protected interface BackgroundRendererController {
|
|
|
|
|
/**
|
|
|
|
|
* Sets the roundness of the round corner above Taskbar.
|
|
|
|
|
* @param cornerRoundness 0 has no round corner, 1 has complete round corner.
|
|
|
|
|
*/
|
|
|
|
|
void setCornerRoundness(float cornerRoundness);
|
|
|
|
|
}
|
2021-06-08 20:03:43 -07:00
|
|
|
}
|