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

Commit 80cb13f8 authored by axfordjc's avatar axfordjc
Browse files

Reduce lockscreen bottom area on small landscape screens

- this CL only 'adds support for the new lockscreen implementation'
- but this is currently also guarded by flags:
    - MIGRATE_SPLIT_KEYGUARD_BOTTOM_AREA (b/290652751)
    - MIGRATE_LOCK_ICON (b/290652751)

- lock icon moved downwards (reduced margins), and centred by including left + right insets when calculating midpoint (screen centre is used when UDFPS is not enabled)
- indication area moved downwards (reduced margins)

This is a required feature for landscape lockscreen for small screens

Guarded by flag "lockscreen.enable_landscape" (b/293252410)

Bug: 296571001
Bug: 293252410

Test: LockIconViewControllerTest
Change-Id: I9c178052cd22af781f145bdb23db41a44164c743
parent 72dbcc03
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -88,4 +88,7 @@
         overlaid -->
    <dimen name="global_actions_button_size">72dp</dimen>
    <dimen name="global_actions_button_padding">26dp</dimen>

    <dimen name="keyguard_indication_margin_bottom">8dp</dimen>
    <dimen name="lock_icon_margin_bottom">24dp</dimen>
</resources>
+0 −2
Original line number Diff line number Diff line
@@ -134,8 +134,6 @@ public class LockIconView extends FrameLayout implements Dumpable {
        mLockIcon.setPadding(mLockIconPadding, mLockIconPadding, mLockIconPadding,
                mLockIconPadding);

        // mSensorProps coordinates assume portrait mode which is OK b/c the keyguard is always in
        // portrait.
        mSensorRect.set(mLockIconCenter.x - mRadius,
                mLockIconCenter.y - mRadius,
                mLockIconCenter.x + mRadius,
+7 −1
Original line number Diff line number Diff line
@@ -73,7 +73,13 @@ constructor(
        val mBottomPaddingPx =
            context.resources.getDimensionPixelSize(R.dimen.lock_icon_margin_bottom)
        val bounds = windowManager.currentWindowMetrics.bounds
        val widthPixels = bounds.right.toFloat()
        val insets = windowManager.currentWindowMetrics.windowInsets
        var widthPixels = bounds.right.toFloat()
        if (featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE)) {
            // Assumed to be initially neglected as there are no left or right insets in portrait.
            // However, on landscape, these insets need to included when calculating the midpoint.
            widthPixels -= (insets.systemWindowInsetLeft + insets.systemWindowInsetRight).toFloat()
        }
        val heightPixels = bounds.bottom.toFloat()
        val defaultDensity =
            DisplayMetrics.DENSITY_DEVICE_STABLE.toFloat() /