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

Commit f40858f2 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Moves NSSL up on wide lockscreen scene.

On unfolded foldables and tablets, the NSSL was positioned too far down.
The reason was twofold:
1. The padding was duplicative, the NSSL is already being placed in the
   right spot in the layout, which makes it take account for the status
   bar height (it's placed below it on the Y axis)
2. The padding value was incorrect. A px amount was treated as dp which
   incorrectly showed a multiple value of the height, exaggerating the
   bug

The fix was simply to set the padding to a minimal 12dp which makes it
match the position of the NSSL on pre-Flexiglass layouts.

Fix: 377903994
Test: manually verified that the NSSL position is the same with
Flexiglass on and off on both an unfolded foldable and a tablet
Flag: com.android.systemui.scene_container

Change-Id: I9d06cf2df984b9e40dd64b851f638ba2497c47bf
parent 9477f6b2
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -29,11 +29,8 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -52,7 +49,6 @@ import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack
import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace
import com.android.systemui.res.R
import com.android.systemui.shade.LargeScreenHeaderHelper
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.AlwaysOnDisplayNotificationIconViewStore
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder
@@ -179,16 +175,13 @@ constructor(
            return
        }

        val splitShadeTopMargin: Dp =
            LargeScreenHeaderHelper.getLargeScreenHeaderHeight(LocalContext.current).dp

        ConstrainedNotificationStack(
            stackScrollView = stackScrollView.get(),
            viewModel = rememberViewModel("Notifications") { viewModelFactory.create() },
            modifier =
                modifier
                    .fillMaxWidth()
                    .thenIf(isShadeLayoutWide) { Modifier.padding(top = splitShadeTopMargin) }
                    .thenIf(isShadeLayoutWide) { Modifier.padding(top = 12.dp) }
                    .let {
                        if (burnInParams == null) {
                            it