BubbleBarView shows BubbleViews in a bar similar to transient taskbar. BubbleBarView can be collapsed (bubbles in a stack) or expanded (bubbles all visible). When expanded, WMShell will be notified to show the appropriate expanded bubble view (not part of this CL). Also creates BubbleControllers which contains BubbleBarViewController and will eventually contain other controllers related to stashing for the bubble bar. Bug: 253318833 Test: manual, with other CLs, see go/bubble-bar-tests Flag: WM_BUBBLE_BAR Change-Id: I990ab3da6614db90ffff8c40281dc7f16b3957f6
67 lines
2.3 KiB
Java
67 lines
2.3 KiB
Java
/*
|
|
* Copyright (C) 2023 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.bubbles;
|
|
|
|
import com.android.launcher3.taskbar.TaskbarControllers;
|
|
import com.android.launcher3.util.RunnableList;
|
|
|
|
/**
|
|
* Hosts various bubble controllers to facilitate passing between one another.
|
|
*/
|
|
public class BubbleControllers {
|
|
|
|
public final BubbleBarViewController bubbleBarViewController;
|
|
|
|
private final RunnableList mPostInitRunnables = new RunnableList();
|
|
|
|
/**
|
|
* Want to add a new controller? Don't forget to:
|
|
* * Call init
|
|
* * Call onDestroy
|
|
*/
|
|
public BubbleControllers(BubbleBarViewController bubbleBarViewController) {
|
|
this.bubbleBarViewController = bubbleBarViewController;
|
|
}
|
|
|
|
/**
|
|
* Initializes all controllers. Note that controllers can now reference each other through this
|
|
* BubbleControllers 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().
|
|
*/
|
|
public void init(TaskbarControllers taskbarControllers) {
|
|
bubbleBarViewController.init(taskbarControllers, this);
|
|
|
|
mPostInitRunnables.executeAllAndDestroy();
|
|
}
|
|
|
|
/**
|
|
* 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 runnable) {
|
|
// If this has been executed in init, it automatically runs adds to it.
|
|
mPostInitRunnables.add(runnable);
|
|
}
|
|
|
|
/**
|
|
* Cleans up all controllers.
|
|
*/
|
|
public void onDestroy() {
|
|
// TODO
|
|
}
|
|
}
|