Loading packages/SystemUI/res/layout/combined_qs_header.xml +2 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ android:paddingStart="@dimen/status_bar_left_clock_starting_padding" android:paddingEnd="@dimen/status_bar_left_clock_end_padding" android:singleLine="true" android:textDirection="locale" android:textAppearance="@style/TextAppearance.QS.Status" android:transformPivotX="0sp" android:transformPivotY="20sp" Loading @@ -85,6 +86,7 @@ android:layout_gravity="start|center_vertical" android:gravity="center_vertical" android:singleLine="true" android:textDirection="locale" android:textAppearance="@style/TextAppearance.QS.Status" app:longDatePattern="@string/abbrev_wday_month_day_no_year_alarm" app:shortDatePattern="@string/abbrev_month_day_no_year" Loading packages/SystemUI/res/xml/large_screen_shade_header.xml +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ app:layout_constraintTop_toTopOf="@id/date" app:layout_constraintBottom_toBottomOf="@id/date" app:layout_constraintStart_toEndOf="@id/batteryRemainingIcon" app:layout_constraintHorizontal_bias="1" /> </Constraint> Loading packages/SystemUI/res/xml/qqs_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ app:layout_constraintTop_toTopOf="parent" /> <PropertySet app:alpha="0" android:alpha="0" /> </Constraint> Loading packages/SystemUI/res/xml/qs_header_new.xml +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ app:layout_constraintEnd_toEndOf="@id/end_guide" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@id/carrier_group" app:layout_constraintHorizontal_bias="1" /> </Constraint> Loading packages/SystemUI/src/com/android/systemui/shade/CombinedShadeHeadersConstraintManager.kt 0 → 100644 +79 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.shade import androidx.constraintlayout.widget.ConstraintSet typealias ConstraintChange = ConstraintSet.() -> Unit operator fun ConstraintChange?.plus(other: ConstraintChange?): ConstraintChange? { // Prevent wrapping if (this == null) return other if (other == null) return this else return { this@plus() other() } } /** * Contains all changes that need to be performed to the different [ConstraintSet] in * [LargeScreenShadeHeaderController]. */ data class ConstraintsChanges( val qqsConstraintsChanges: ConstraintChange? = null, val qsConstraintsChanges: ConstraintChange? = null, val largeScreenConstraintsChanges: ConstraintChange? = null ) { operator fun plus(other: ConstraintsChanges) = ConstraintsChanges( qqsConstraintsChanges + other.qqsConstraintsChanges, qsConstraintsChanges + other.qsConstraintsChanges, largeScreenConstraintsChanges + other.largeScreenConstraintsChanges ) } /** * Determines [ConstraintChanges] for [LargeScreenShadeHeaderController] based on configurations. * * Given that the number of different scenarios is not that large, having specific methods instead * of a full map between state and [ConstraintSet] was preferred. */ interface CombinedShadeHeadersConstraintManager { /** * Changes for when the visibility of the privacy chip changes */ fun privacyChipVisibilityConstraints(visible: Boolean): ConstraintsChanges /** * Changes for situations with no top center cutout (there may be a corner cutout) */ fun emptyCutoutConstraints(): ConstraintsChanges /** * Changes to incorporate side insets due to rounded corners/corner cutouts */ fun edgesGuidelinesConstraints( cutoutStart: Int, paddingStart: Int, cutoutEnd: Int, paddingEnd: Int ): ConstraintsChanges /** * Changes for situations with top center cutout (in this case, there are no corner cutouts). */ fun centerCutoutConstraints(rtl: Boolean, offsetFromEdge: Int): ConstraintsChanges } Loading
packages/SystemUI/res/layout/combined_qs_header.xml +2 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ android:paddingStart="@dimen/status_bar_left_clock_starting_padding" android:paddingEnd="@dimen/status_bar_left_clock_end_padding" android:singleLine="true" android:textDirection="locale" android:textAppearance="@style/TextAppearance.QS.Status" android:transformPivotX="0sp" android:transformPivotY="20sp" Loading @@ -85,6 +86,7 @@ android:layout_gravity="start|center_vertical" android:gravity="center_vertical" android:singleLine="true" android:textDirection="locale" android:textAppearance="@style/TextAppearance.QS.Status" app:longDatePattern="@string/abbrev_wday_month_day_no_year_alarm" app:shortDatePattern="@string/abbrev_month_day_no_year" Loading
packages/SystemUI/res/xml/large_screen_shade_header.xml +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ app:layout_constraintTop_toTopOf="@id/date" app:layout_constraintBottom_toBottomOf="@id/date" app:layout_constraintStart_toEndOf="@id/batteryRemainingIcon" app:layout_constraintHorizontal_bias="1" /> </Constraint> Loading
packages/SystemUI/res/xml/qqs_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ app:layout_constraintTop_toTopOf="parent" /> <PropertySet app:alpha="0" android:alpha="0" /> </Constraint> Loading
packages/SystemUI/res/xml/qs_header_new.xml +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ app:layout_constraintEnd_toEndOf="@id/end_guide" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@id/carrier_group" app:layout_constraintHorizontal_bias="1" /> </Constraint> Loading
packages/SystemUI/src/com/android/systemui/shade/CombinedShadeHeadersConstraintManager.kt 0 → 100644 +79 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.shade import androidx.constraintlayout.widget.ConstraintSet typealias ConstraintChange = ConstraintSet.() -> Unit operator fun ConstraintChange?.plus(other: ConstraintChange?): ConstraintChange? { // Prevent wrapping if (this == null) return other if (other == null) return this else return { this@plus() other() } } /** * Contains all changes that need to be performed to the different [ConstraintSet] in * [LargeScreenShadeHeaderController]. */ data class ConstraintsChanges( val qqsConstraintsChanges: ConstraintChange? = null, val qsConstraintsChanges: ConstraintChange? = null, val largeScreenConstraintsChanges: ConstraintChange? = null ) { operator fun plus(other: ConstraintsChanges) = ConstraintsChanges( qqsConstraintsChanges + other.qqsConstraintsChanges, qsConstraintsChanges + other.qsConstraintsChanges, largeScreenConstraintsChanges + other.largeScreenConstraintsChanges ) } /** * Determines [ConstraintChanges] for [LargeScreenShadeHeaderController] based on configurations. * * Given that the number of different scenarios is not that large, having specific methods instead * of a full map between state and [ConstraintSet] was preferred. */ interface CombinedShadeHeadersConstraintManager { /** * Changes for when the visibility of the privacy chip changes */ fun privacyChipVisibilityConstraints(visible: Boolean): ConstraintsChanges /** * Changes for situations with no top center cutout (there may be a corner cutout) */ fun emptyCutoutConstraints(): ConstraintsChanges /** * Changes to incorporate side insets due to rounded corners/corner cutouts */ fun edgesGuidelinesConstraints( cutoutStart: Int, paddingStart: Int, cutoutEnd: Int, paddingEnd: Int ): ConstraintsChanges /** * Changes for situations with top center cutout (in this case, there are no corner cutouts). */ fun centerCutoutConstraints(rtl: Boolean, offsetFromEdge: Int): ConstraintsChanges }