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

Commit 6fd1fcc1 authored by Chris Göllner's avatar Chris Göllner
Browse files

Shortcut Helper - Fix bottom sheet height

The DisplayMetrics API was reporting the wrong height. The fix is to
use WindowManager#maximumWindowMetrics.

Flag: com.android.systemui.keyboard_shortcut_helper_rewrite
Test: Manual
Bug: 327364197
Change-Id: I6ea0ae736fdbd9092d899eae4955607935856d77
parent 64e23d81
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ constructor(
            resources.getFloat(R.dimen.shortcut_helper_screen_width_fraction)
        // maxWidth needs to be set before the sheet is drawn, otherwise the call will have no
        // effect.
        val screenWidth = resources.displayMetrics.widthPixels
        val screenWidth = windowManager.maximumWindowMetrics.bounds.width()
        bottomSheetBehavior.maxWidth = (sheetScreenWidthFraction * screenWidth).toInt()
    }

@@ -121,7 +121,7 @@ constructor(
            val safeDrawingInsets = insets.safeDrawing
            // Make sure the bottom sheet is not covered by the status bar.
            bottomSheetBehavior.maxHeight =
                resources.displayMetrics.heightPixels - safeDrawingInsets.top
                windowManager.maximumWindowMetrics.bounds.height() - safeDrawingInsets.top
            // Make sure the contents inside of the bottom sheet are not hidden by system bars, or
            // cutouts.
            bottomSheet.updatePadding(