Merge "Adds BubbleControllers to TaskbarControllers" into udc-dev am: 764608263f am: 05683fcefd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22534247 Change-Id: I4088227fca9ea5ffa34d9cb8ed00d729ebced41d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -38,6 +38,20 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
<com.android.launcher3.taskbar.bubbles.BubbleBarView
|
||||||
|
android:id="@+id/taskbar_bubbles"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/bubblebar_size"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_marginEnd="@dimen/transient_taskbar_bottom_margin"
|
||||||
|
android:layout_marginBottom="@dimen/transient_taskbar_bottom_margin"
|
||||||
|
android:paddingEnd="@dimen/taskbar_icon_spacing"
|
||||||
|
android:paddingStart="@dimen/taskbar_icon_spacing"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:gravity="center"
|
||||||
|
android:clipChildren="false"
|
||||||
|
/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/navbuttons_view"
|
android:id="@+id/navbuttons_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -74,10 +88,20 @@
|
|||||||
<com.android.launcher3.taskbar.StashedHandleView
|
<com.android.launcher3.taskbar.StashedHandleView
|
||||||
android:id="@+id/stashed_handle"
|
android:id="@+id/stashed_handle"
|
||||||
tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
|
tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/taskbar_stashed_handle_dark_color"
|
android:background="@color/taskbar_stashed_handle_dark_color"
|
||||||
android:clipToOutline="true"
|
android:clipToOutline="true"
|
||||||
android:layout_gravity="bottom"/>
|
android:layout_gravity="bottom"/>
|
||||||
|
|
||||||
|
<com.android.launcher3.taskbar.StashedHandleView
|
||||||
|
android:id="@+id/stashed_bubble_handle"
|
||||||
|
tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:background="@color/taskbar_stashed_handle_dark_color"
|
||||||
|
android:clipToOutline="true"
|
||||||
|
android:layout_gravity="bottom"/>
|
||||||
|
|
||||||
</com.android.launcher3.taskbar.TaskbarDragLayer>
|
</com.android.launcher3.taskbar.TaskbarDragLayer>
|
||||||
@@ -84,6 +84,12 @@ import com.android.launcher3.popup.PopupDataProvider;
|
|||||||
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.AutohideSuspendFlag;
|
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.AutohideSuspendFlag;
|
||||||
import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback;
|
import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback;
|
||||||
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
|
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleBarController;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleBarView;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleStashController;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController;
|
||||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
|
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
|
||||||
import com.android.launcher3.testing.TestLogging;
|
import com.android.launcher3.testing.TestLogging;
|
||||||
import com.android.launcher3.testing.shared.TestProtocol;
|
import com.android.launcher3.testing.shared.TestProtocol;
|
||||||
@@ -107,6 +113,7 @@ import com.android.systemui.unfold.updates.RotationChangeProvider;
|
|||||||
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
|
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link ActivityContext} with which we inflate Taskbar-related Views. This allows UI elements
|
* The {@link ActivityContext} with which we inflate Taskbar-related Views. This allows UI elements
|
||||||
@@ -196,11 +203,23 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
|||||||
TaskbarScrimView taskbarScrimView = mDragLayer.findViewById(R.id.taskbar_scrim);
|
TaskbarScrimView taskbarScrimView = mDragLayer.findViewById(R.id.taskbar_scrim);
|
||||||
FrameLayout navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
|
FrameLayout navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
|
||||||
StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
|
StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
|
||||||
|
BubbleBarView bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
|
||||||
|
StashedHandleView bubbleHandleView = mDragLayer.findViewById(R.id.stashed_bubble_handle);
|
||||||
|
|
||||||
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
|
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
|
||||||
|
|
||||||
final boolean isDesktopMode = getPackageManager().hasSystemFeature(FEATURE_PC);
|
final boolean isDesktopMode = getPackageManager().hasSystemFeature(FEATURE_PC);
|
||||||
|
|
||||||
|
// If Bubble bar is present, TaskbarControllers depends on it so build it first.
|
||||||
|
Optional<BubbleControllers> bubbleControllersOptional = Optional.empty();
|
||||||
|
if (BubbleBarController.BUBBLE_BAR_ENABLED) {
|
||||||
|
bubbleControllersOptional = Optional.of(new BubbleControllers(
|
||||||
|
new BubbleBarController(this, bubbleBarView),
|
||||||
|
new BubbleBarViewController(this, bubbleBarView),
|
||||||
|
new BubbleStashController(this),
|
||||||
|
new BubbleStashedHandleViewController(this, bubbleHandleView)));
|
||||||
|
}
|
||||||
|
|
||||||
// Construct controllers.
|
// Construct controllers.
|
||||||
mControllers = new TaskbarControllers(this,
|
mControllers = new TaskbarControllers(this,
|
||||||
new TaskbarDragController(this),
|
new TaskbarDragController(this),
|
||||||
@@ -240,7 +259,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
|||||||
: TaskbarRecentAppsController.DEFAULT,
|
: TaskbarRecentAppsController.DEFAULT,
|
||||||
new TaskbarEduTooltipController(this),
|
new TaskbarEduTooltipController(this),
|
||||||
new KeyboardQuickSwitchController(),
|
new KeyboardQuickSwitchController(),
|
||||||
new TaskbarDividerPopupController(this));
|
new TaskbarDividerPopupController(this),
|
||||||
|
bubbleControllersOptional);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(@NonNull TaskbarSharedState sharedState) {
|
public void init(@NonNull TaskbarSharedState sharedState) {
|
||||||
|
|||||||
@@ -23,12 +23,14 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
|
|
||||||
import com.android.launcher3.anim.AnimatedFloat;
|
import com.android.launcher3.anim.AnimatedFloat;
|
||||||
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
|
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleControllers;
|
||||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
|
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController;
|
||||||
import com.android.systemui.shared.rotation.RotationButtonController;
|
import com.android.systemui.shared.rotation.RotationButtonController;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hosts various taskbar controllers to facilitate passing between one another.
|
* Hosts various taskbar controllers to facilitate passing between one another.
|
||||||
@@ -61,6 +63,7 @@ public class TaskbarControllers {
|
|||||||
public final TaskbarEduTooltipController taskbarEduTooltipController;
|
public final TaskbarEduTooltipController taskbarEduTooltipController;
|
||||||
public final KeyboardQuickSwitchController keyboardQuickSwitchController;
|
public final KeyboardQuickSwitchController keyboardQuickSwitchController;
|
||||||
public final TaskbarDividerPopupController taskbarPinningController;
|
public final TaskbarDividerPopupController taskbarPinningController;
|
||||||
|
public final Optional<BubbleControllers> bubbleControllers;
|
||||||
|
|
||||||
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
|
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
|
||||||
@Nullable private BackgroundRendererController[] mBackgroundRendererControllers = null;
|
@Nullable private BackgroundRendererController[] mBackgroundRendererControllers = null;
|
||||||
@@ -107,7 +110,8 @@ public class TaskbarControllers {
|
|||||||
TaskbarRecentAppsController taskbarRecentAppsController,
|
TaskbarRecentAppsController taskbarRecentAppsController,
|
||||||
TaskbarEduTooltipController taskbarEduTooltipController,
|
TaskbarEduTooltipController taskbarEduTooltipController,
|
||||||
KeyboardQuickSwitchController keyboardQuickSwitchController,
|
KeyboardQuickSwitchController keyboardQuickSwitchController,
|
||||||
TaskbarDividerPopupController taskbarPinningController) {
|
TaskbarDividerPopupController taskbarPinningController,
|
||||||
|
Optional<BubbleControllers> bubbleControllers) {
|
||||||
this.taskbarActivityContext = taskbarActivityContext;
|
this.taskbarActivityContext = taskbarActivityContext;
|
||||||
this.taskbarDragController = taskbarDragController;
|
this.taskbarDragController = taskbarDragController;
|
||||||
this.navButtonController = navButtonController;
|
this.navButtonController = navButtonController;
|
||||||
@@ -133,6 +137,7 @@ public class TaskbarControllers {
|
|||||||
this.taskbarEduTooltipController = taskbarEduTooltipController;
|
this.taskbarEduTooltipController = taskbarEduTooltipController;
|
||||||
this.keyboardQuickSwitchController = keyboardQuickSwitchController;
|
this.keyboardQuickSwitchController = keyboardQuickSwitchController;
|
||||||
this.taskbarPinningController = taskbarPinningController;
|
this.taskbarPinningController = taskbarPinningController;
|
||||||
|
this.bubbleControllers = bubbleControllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,6 +172,7 @@ public class TaskbarControllers {
|
|||||||
taskbarEduTooltipController.init(this);
|
taskbarEduTooltipController.init(this);
|
||||||
keyboardQuickSwitchController.init(this);
|
keyboardQuickSwitchController.init(this);
|
||||||
taskbarPinningController.init(this);
|
taskbarPinningController.init(this);
|
||||||
|
bubbleControllers.ifPresent(controllers -> controllers.init(this));
|
||||||
|
|
||||||
mControllersToLog = new LoggableTaskbarController[] {
|
mControllersToLog = new LoggableTaskbarController[] {
|
||||||
taskbarDragController, navButtonController, navbarButtonsViewController,
|
taskbarDragController, navButtonController, navbarButtonsViewController,
|
||||||
@@ -226,6 +232,7 @@ public class TaskbarControllers {
|
|||||||
taskbarRecentAppsController.onDestroy();
|
taskbarRecentAppsController.onDestroy();
|
||||||
keyboardQuickSwitchController.onDestroy();
|
keyboardQuickSwitchController.onDestroy();
|
||||||
taskbarStashController.onDestroy();
|
taskbarStashController.onDestroy();
|
||||||
|
bubbleControllers.ifPresent(controllers -> controllers.onDestroy());
|
||||||
|
|
||||||
mControllersToLog = null;
|
mControllersToLog = null;
|
||||||
mBackgroundRendererControllers = null;
|
mBackgroundRendererControllers = null;
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
package com.android.launcher3.taskbar
|
package com.android.launcher3.taskbar
|
||||||
|
|
||||||
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController
|
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController
|
||||||
|
import com.android.launcher3.taskbar.bubbles.BubbleControllers
|
||||||
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController
|
import com.android.launcher3.taskbar.overlay.TaskbarOverlayController
|
||||||
import com.android.systemui.shared.rotation.RotationButtonController
|
import com.android.systemui.shared.rotation.RotationButtonController
|
||||||
|
import java.util.Optional
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.MockitoAnnotations
|
import org.mockito.MockitoAnnotations
|
||||||
@@ -54,6 +56,7 @@ abstract class TaskbarBaseTestCase {
|
|||||||
@Mock lateinit var taskbarEduTooltipController: TaskbarEduTooltipController
|
@Mock lateinit var taskbarEduTooltipController: TaskbarEduTooltipController
|
||||||
@Mock lateinit var keyboardQuickSwitchController: KeyboardQuickSwitchController
|
@Mock lateinit var keyboardQuickSwitchController: KeyboardQuickSwitchController
|
||||||
@Mock lateinit var taskbarPinningController: TaskbarDividerPopupController
|
@Mock lateinit var taskbarPinningController: TaskbarDividerPopupController
|
||||||
|
@Mock lateinit var optionalBubbleControllers: Optional<BubbleControllers>
|
||||||
|
|
||||||
lateinit var taskbarControllers: TaskbarControllers
|
lateinit var taskbarControllers: TaskbarControllers
|
||||||
|
|
||||||
@@ -94,6 +97,7 @@ abstract class TaskbarBaseTestCase {
|
|||||||
taskbarEduTooltipController,
|
taskbarEduTooltipController,
|
||||||
keyboardQuickSwitchController,
|
keyboardQuickSwitchController,
|
||||||
taskbarPinningController,
|
taskbarPinningController,
|
||||||
|
optionalBubbleControllers,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user