Merge "Clean up QS/NSSL bottom margin calculation" into tm-qpr-dev
This commit is contained in:
@@ -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,34 +175,24 @@ 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) {
|
|
||||||
// only default cutout padding, taskbar always hides
|
|
||||||
containerPadding = bottomCutoutInsets
|
|
||||||
} else if (taskbarVisible) {
|
|
||||||
// navigation buttons + visible taskbar means we're NOT on homescreen
|
|
||||||
containerPadding = bottomStableInsets
|
|
||||||
} else {
|
|
||||||
// navigation buttons + hidden taskbar means we're on homescreen
|
|
||||||
containerPadding = 0
|
|
||||||
// we need extra margin for notifications as navigation buttons are below them
|
|
||||||
stackScrollMargin = bottomStableInsets + notificationsBottomMargin
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (isQSCustomizing || isQSDetailShowing) {
|
|
||||||
// Clear out bottom paddings/margins so the qs customization can be full height.
|
// Clear out bottom paddings/margins so the qs customization can be full height.
|
||||||
containerPadding = 0
|
containerPadding = 0
|
||||||
stackScrollMargin = 0
|
stackScrollMargin = 0
|
||||||
} else if (isGestureNavigation) {
|
} else if (isGestureNavigation) {
|
||||||
|
// only default cutout padding, taskbar always hides
|
||||||
containerPadding = bottomCutoutInsets
|
containerPadding = bottomCutoutInsets
|
||||||
|
stackScrollMargin = notificationsBottomMargin
|
||||||
} else if (taskbarVisible) {
|
} else if (taskbarVisible) {
|
||||||
|
// navigation buttons + visible taskbar means we're NOT on homescreen
|
||||||
containerPadding = bottomStableInsets
|
containerPadding = bottomStableInsets
|
||||||
|
stackScrollMargin = notificationsBottomMargin
|
||||||
} else {
|
} else {
|
||||||
|
// navigation buttons + hidden taskbar means we're on homescreen
|
||||||
containerPadding = 0
|
containerPadding = 0
|
||||||
stackScrollMargin = bottomStableInsets + notificationsBottomMargin
|
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
|
||||||
if (splitShadeEnabled) {
|
if (splitShadeEnabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user