Merge "Address a couple small followups for TaskbarInsetsController" into tm-dev am: 357c622572

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17873349

Change-Id: I738ec06f57015fd664944b87204e2f6919173f31
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tony Wickham
2022-04-22 23:18:20 +00:00
committed by Automerger Merge Worker
3 changed files with 13 additions and 9 deletions

View File

@@ -160,6 +160,7 @@ public class TaskbarControllers {
taskbarForceVisibleImmersiveController.onDestroy();
taskbarAllAppsController.onDestroy();
navButtonController.onDestroy();
taskbarInsetsController.onDestroy();
mControllersToLog = null;
}

View File

@@ -18,6 +18,7 @@ package com.android.launcher3.taskbar
import android.graphics.Insets
import android.view.WindowManager
import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS
import com.android.launcher3.R
import com.android.launcher3.anim.AlphaUpdateListener
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
@@ -61,6 +62,8 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask
windowLayoutParams.insetsRoundedCornerFrame = true
}
fun onDestroy() {}
fun onTaskbarWindowHeightOrInsetsChanged() {
var reducingSize = getReducingInsetsForTaskbarInsetsHeight(
controllers.taskbarStashController.contentHeightToReportToApps)
@@ -106,18 +109,11 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask
} else if (controllers.taskbarDragController.isSystemDragInProgress) {
// Let touches pass through us.
insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
} else if (AbstractFloatingView.getOpenView<AbstractFloatingView?>(
context,
AbstractFloatingView.TYPE_TASKBAR_ALL_APPS
) != null
) {
} else if (AbstractFloatingView.hasOpenView(context, TYPE_TASKBAR_ALL_APPS)) {
// Let touches pass through us.
insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION)
} else if (controllers.taskbarViewController.areIconsVisible()
|| AbstractFloatingView.getOpenView<AbstractFloatingView?>(
context,
AbstractFloatingView.TYPE_ALL
) != null
|| AbstractFloatingView.hasOpenView(context, AbstractFloatingView.TYPE_ALL)
|| context.isNavBarKidsModeActive
) {
// Taskbar has some touchable elements, take over the full taskbar area

View File

@@ -207,6 +207,13 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
return getView(activity, type, true /* mustBeOpen */);
}
/**
* Returns whether there is at least one view of the given type where {@link #isOpen()} == true.
*/
public static boolean hasOpenView(ActivityContext activity, @FloatingViewType int type) {
return getOpenView(activity, type) != null;
}
/**
* Returns a view matching FloatingViewType, and {@link #isOpen()} may be false (if animating
* closed).