Merge "Clean up QS/NSSL bottom margin calculation" into tm-qpr-dev am: 7aa7aeff3b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18868863

Change-Id: Ifbb447e3862c765422c1f23e654a11e83fa0a94a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Julia Tuttle
2022-08-10 19:28:36 +00:00
committed by Automerger Merge Worker

View File

@@ -6,7 +6,11 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.view.WindowInsets import android.view.WindowInsets
import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting
import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet
import androidx.constraintlayout.widget.ConstraintSet.* import androidx.constraintlayout.widget.ConstraintSet.BOTTOM
import androidx.constraintlayout.widget.ConstraintSet.END
import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID
import androidx.constraintlayout.widget.ConstraintSet.START
import androidx.constraintlayout.widget.ConstraintSet.TOP
import com.android.systemui.R import com.android.systemui.R
import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.FeatureFlags
@@ -171,33 +175,23 @@ class NotificationsQSContainerController @Inject constructor(
private fun calculateBottomSpacing(): Paddings { private fun calculateBottomSpacing(): Paddings {
val containerPadding: Int val containerPadding: Int
var stackScrollMargin = notificationsBottomMargin val stackScrollMargin: Int
if (splitShadeEnabled) { if (!splitShadeEnabled && (isQSCustomizing || isQSDetailShowing)) {
if (isGestureNavigation) { // Clear out bottom paddings/margins so the qs customization can be full height.
// only default cutout padding, taskbar always hides containerPadding = 0
containerPadding = bottomCutoutInsets stackScrollMargin = 0
} else if (taskbarVisible) { } else if (isGestureNavigation) {
// navigation buttons + visible taskbar means we're NOT on homescreen // only default cutout padding, taskbar always hides
containerPadding = bottomStableInsets containerPadding = bottomCutoutInsets
} else { stackScrollMargin = notificationsBottomMargin
// navigation buttons + hidden taskbar means we're on homescreen } else if (taskbarVisible) {
containerPadding = 0 // navigation buttons + visible taskbar means we're NOT on homescreen
// we need extra margin for notifications as navigation buttons are below them containerPadding = bottomStableInsets
stackScrollMargin = bottomStableInsets + notificationsBottomMargin stackScrollMargin = notificationsBottomMargin
}
} else { } else {
if (isQSCustomizing || isQSDetailShowing) { // navigation buttons + hidden taskbar means we're on homescreen
// Clear out bottom paddings/margins so the qs customization can be full height. containerPadding = 0
containerPadding = 0 stackScrollMargin = bottomStableInsets + notificationsBottomMargin
stackScrollMargin = 0
} else if (isGestureNavigation) {
containerPadding = bottomCutoutInsets
} else if (taskbarVisible) {
containerPadding = bottomStableInsets
} else {
containerPadding = 0
stackScrollMargin = bottomStableInsets + notificationsBottomMargin
}
} }
val qsContainerPadding = if (!(isQSCustomizing || isQSDetailShowing)) { val qsContainerPadding = if (!(isQSCustomizing || isQSDetailShowing)) {
// We also want this padding in the bottom in these cases // We also want this padding in the bottom in these cases