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

Commit 1a8dd985 authored by Aaron Liu's avatar Aaron Liu
Browse files

Fixes two layout issues with lockscreen compose

1. Reduce top padding by the clock. This removes the statusbar height
   added into the padding because the clock is positioned below the
   status bar and that height is already calculated in.
2. Ensure using the global rect top of the notification place holder
   view in NPVC. Instead of using whatever else calculation, we just
   want to use whereever the placeholder is when ComposeLockscreen is
   enabled.

Bug: 301968149
Test: look at small clock
Test: pull down shade in split shade
Flag: ACONFIG com.android.systemui.compose_lockscreen DEVELOPMENT

Change-Id: Ia5f793b14de6203228343ae42b7e6fa341abe66f
parent d1575cbd
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.shared.ComposeLockscreen
import com.android.systemui.keyguard.shared.model.SettingsClockSize
import com.android.systemui.plugins.clocks.ClockController
import com.android.systemui.res.R
@@ -100,12 +101,23 @@ constructor(
            initialValue = false
        )

    // Needs to use a non application context to get display cutout.
    fun getSmallClockTopMargin(context: Context) =
    /** Calculates the top margin for the small clock. */
    fun getSmallClockTopMargin(context: Context): Int {
        var topMargin: Int
        val statusBarHeight = Utils.getStatusBarHeaderHeightKeyguard(context)

        if (splitShadeStateController.shouldUseSplitNotificationShade(context.resources)) {
            topMargin =
                context.resources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin)
            if (ComposeLockscreen.isEnabled) {
                topMargin -= statusBarHeight
            }
        } else {
            context.resources.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) +
                Utils.getStatusBarHeaderHeightKeyguard(context)
            topMargin = context.resources.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin)
            if (!ComposeLockscreen.isEnabled) {
                topMargin += statusBarHeight
            }
        }
        return topMargin
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.NaturalScrollingSettingObserver;
import com.android.systemui.keyguard.shared.ComposeLockscreen;
import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl;
import com.android.systemui.keyguard.shared.model.TransitionState;
import com.android.systemui.keyguard.shared.model.TransitionStep;
@@ -2474,6 +2475,12 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        if (!isKeyguardShowing()) {
            return 0;
        }

        if (ComposeLockscreen.isEnabled()) {
            return (int) mKeyguardInteractor.getNotificationContainerBounds()
                    .getValue().getTop();
        }

        if (!mKeyguardBypassController.getBypassEnabled()) {
            if (migrateClocksToBlueprint() && !mSplitShadeEnabled) {
                return (int) mKeyguardInteractor.getNotificationContainerBounds()