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

Commit bca53562 authored by Aaron Liu's avatar Aaron Liu Committed by Android (Google) Code Review
Browse files

Merge "Fixes two layout issues with lockscreen compose" into main

parents 60f5711d 1a8dd985
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;
@@ -2476,6 +2477,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()