diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-05-27 23:13:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-05-27 23:13:36 +0000 |
commit | 192b3c3118d6ad74fed6544c5bec5d2420cf1d6c (patch) | |
tree | 7b85f478957e9b874f6b9fcb5f3959ef45c81322 /quickstep/src | |
parent | 2b6700a94cb1fdb93a3f4b8f7f9494a044f2b5c0 (diff) | |
parent | 4eebbac3b73a382455eae146310d10cf1efa7ee1 (diff) | |
download | Launcher3-192b3c3118d6ad74fed6544c5bec5d2420cf1d6c.tar.gz |
Merge "Use DeviceProfile.widthPx to initialize Taskbar touchableRegion" into tm-dev
Diffstat (limited to 'quickstep/src')
-rw-r--r-- | quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt index 21d7af9d69..6a6a693dc3 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt @@ -21,6 +21,7 @@ import android.view.InsetsState.ITYPE_BOTTOM_MANDATORY_GESTURES import android.view.WindowManager import com.android.launcher3.AbstractFloatingView import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS +import com.android.launcher3.DeviceProfile import com.android.launcher3.anim.AlphaUpdateListener import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController import com.android.quickstep.KtR @@ -38,6 +39,9 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask val taskbarHeightForIme: Int = context.resources.getDimensionPixelSize( KtR.dimen.taskbar_ime_size) private val contentRegion: Region = Region() + private val deviceProfileChangeListener = { _: DeviceProfile -> + onTaskbarWindowHeightOrInsetsChanged() + } // Initialized in init. private lateinit var controllers: TaskbarControllers @@ -63,16 +67,19 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask onTaskbarWindowHeightOrInsetsChanged() windowLayoutParams.insetsRoundedCornerFrame = true + context.addOnDeviceProfileChangeListener(deviceProfileChangeListener) } - fun onDestroy() {} + fun onDestroy() { + context.removeOnDeviceProfileChangeListener(deviceProfileChangeListener) + } fun onTaskbarWindowHeightOrInsetsChanged() { var reducingSize = getReducingInsetsForTaskbarInsetsHeight( controllers.taskbarStashController.contentHeightToReportToApps) contentRegion.set(0, reducingSize.top, - context.dragLayer.width, windowLayoutParams.height) + context.deviceProfile.widthPx, windowLayoutParams.height) windowLayoutParams.providedInternalInsets[ITYPE_EXTRA_NAVIGATION_BAR] = reducingSize windowLayoutParams.providedInternalInsets[ITYPE_BOTTOM_MANDATORY_GESTURES] = reducingSize reducingSize = getReducingInsetsForTaskbarInsetsHeight( |