Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db9a5bb8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Use DeviceProfile.widthPx to initialize Taskbar touchableRegion" into...

Merge "Use DeviceProfile.widthPx to initialize Taskbar touchableRegion" into tm-dev am: 192b3c31 am: a947c74b

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



Change-Id: I9246c6ca0df462853195bf11d29dc210bcc9fa55
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ef64789d a947c74b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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(