Merge "Expansion animations" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bd7424947c
@@ -14,7 +14,7 @@
|
|||||||
~ See the License for the specific language governing permissions and
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.motion.widget.MotionLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/split_shade_status_bar"
|
android:id="@+id/split_shade_status_bar"
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
android:paddingLeft="@dimen/qs_panel_padding"
|
android:paddingLeft="@dimen/qs_panel_padding"
|
||||||
android:paddingRight="@dimen/qs_panel_padding"
|
android:paddingRight="@dimen/qs_panel_padding"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:theme="@style/Theme.SystemUI.QuickSettings.Header">
|
android:theme="@style/Theme.SystemUI.QuickSettings.Header"
|
||||||
|
app:layoutDescription="@xml/combined_qs_header_scene">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -39,76 +40,65 @@
|
|||||||
android:id="@+id/clock"
|
android:id="@+id/clock"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
|
||||||
android:gravity="start|center_vertical"
|
android:gravity="start|center_vertical"
|
||||||
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
||||||
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.QS.Status"
|
android:textAppearance="@style/TextAppearance.QS.Status"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/date"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<com.android.systemui.statusbar.policy.DateView
|
<com.android.systemui.statusbar.policy.DateView
|
||||||
android:id="@+id/date"
|
android:id="@+id/date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.QS.Status"
|
android:textAppearance="@style/TextAppearance.QS.Status"
|
||||||
app:datePattern="@string/abbrev_wday_month_day_no_year_alarm"
|
app:datePattern="@string/abbrev_wday_month_day_no_year_alarm"
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/carrier_group"
|
android:id="@+id/carrier_group"
|
||||||
layout="@layout/qs_carrier_group"
|
layout="@layout/qs_carrier_group"
|
||||||
|
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
||||||
|
android:minHeight="@dimen/split_shade_header_min_height"
|
||||||
|
app:layout_constraintWidth_min="48dp"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="end|center_vertical"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:focusable="false"
|
|
||||||
android:minHeight="@dimen/split_shade_header_min_height"
|
|
||||||
android:minWidth="48dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/date"
|
app:layout_constraintStart_toEndOf="@id/date"
|
||||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="@id/clock"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1"
|
app:layout_constraintHorizontal_bias="1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.StatusIconContainer
|
<com.android.systemui.statusbar.phone.StatusIconContainer
|
||||||
android:id="@+id/statusIcons"
|
android:id="@+id/statusIcons"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
||||||
android:paddingEnd="@dimen/signal_cluster_battery_padding"
|
android:paddingEnd="@dimen/signal_cluster_battery_padding"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="48dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
||||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="@id/clock"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<com.android.systemui.battery.BatteryMeterView
|
<com.android.systemui.battery.BatteryMeterView
|
||||||
android:id="@+id/batteryRemainingIcon"
|
android:id="@+id/batteryRemainingIcon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="48dp"
|
||||||
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
app:layout_constraintHeight_min="@dimen/split_shade_header_min_height"
|
||||||
app:textAppearance="@style/TextAppearance.QS.Status"
|
app:textAppearance="@style/TextAppearance.QS.Status"
|
||||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="@id/clock"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||||
50
packages/SystemUI/res/xml/combined_qs_header_scene.xml
Normal file
50
packages/SystemUI/res/xml/combined_qs_header_scene.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 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.
|
||||||
|
-->
|
||||||
|
<MotionScene
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<Transition
|
||||||
|
android:id="@+id/header_transition"
|
||||||
|
app:constraintSetEnd="@id/qs_header_constraint"
|
||||||
|
app:constraintSetStart="@id/qqs_header_constraint">
|
||||||
|
<KeyFrameSet>
|
||||||
|
<KeyPosition
|
||||||
|
app:keyPositionType="pathRelative"
|
||||||
|
app:percentX="0"
|
||||||
|
app:framePosition="50"
|
||||||
|
app:motionTarget="@id/date" />
|
||||||
|
</KeyFrameSet>
|
||||||
|
</Transition>
|
||||||
|
|
||||||
|
<Transition
|
||||||
|
android:id="@+id/split_header_transition"
|
||||||
|
app:constraintSetStart="@id/split_header_constraint"
|
||||||
|
app:constraintSetEnd="@id/split_header_constraint"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Placeholder ConstraintSet. They are populated in the controller for this class.
|
||||||
|
This is needed because there's no easy way to just refer to a `ConstraintSet` file. The
|
||||||
|
options are either a layout file or inline the ConstraintSets.
|
||||||
|
-->
|
||||||
|
<ConstraintSet android:id="@id/qqs_header_constraint"/>
|
||||||
|
|
||||||
|
<ConstraintSet android:id="@id/qs_header_constraint"/>
|
||||||
|
|
||||||
|
<ConstraintSet android:id="@id/split_header_constraint" />
|
||||||
|
|
||||||
|
</MotionScene>
|
||||||
@@ -17,66 +17,45 @@
|
|||||||
|
|
||||||
<ConstraintSet
|
<ConstraintSet
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/qqs_header_constraint"
|
||||||
|
>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/clock"
|
android:id="@+id/clock">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="0dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/date"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintEnd_toStartOf="@id/date"
|
||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
app:layout_constraintHorizontal_bias="0"
|
||||||
/>
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/date"
|
android:id="@+id/date">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="0dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
app:layout_constraintStart_toEndOf="@id/clock"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
app:layout_constraintHorizontal_bias="0"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/carrier_group"
|
android:id="@+id/carrier_group">
|
||||||
android:layout_width="0dp"
|
<CustomAttribute
|
||||||
android:layout_height="0dp"
|
app:attributeName="alpha"
|
||||||
app:layout_constrainedWidth="true"
|
app:customFloatValue="0"
|
||||||
android:layout_gravity="end|center_vertical"
|
/>
|
||||||
android:layout_marginStart="8dp"
|
</Constraint>
|
||||||
app:layout_constraintStart_toEndOf="@id/date"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/statusIcons"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/batteryRemainingIcon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</ConstraintSet>
|
</ConstraintSet>
|
||||||
@@ -17,63 +17,46 @@
|
|||||||
|
|
||||||
<ConstraintSet
|
<ConstraintSet
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/qs_header_constraint"
|
||||||
|
>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/clock"
|
android:id="@+id/clock">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="48dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="48dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/date"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/date"
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
||||||
/>
|
app:layout_constraintHorizontal_bias="0"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/date"
|
android:id="@+id/date">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="48dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="48dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/clock"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintBottom_toTopOf="@id/clock"
|
||||||
/>
|
app:layout_constraintHorizontal_bias="0"
|
||||||
|
/>
|
||||||
|
<Motion
|
||||||
|
app:motionStagger="0.5"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/carrier_group"
|
android:id="@+id/carrier_group">
|
||||||
android:layout_width="0dp"
|
<CustomAttribute
|
||||||
android:layout_height="48dp"
|
app:attributeName="alpha"
|
||||||
app:layout_constrainedWidth="true"
|
app:customFloatValue="1"
|
||||||
android:layout_gravity="end|center_vertical"
|
/>
|
||||||
android:layout_marginStart="8dp"
|
</Constraint>
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/statusIcons"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/batteryRemainingIcon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/clock"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</ConstraintSet>
|
</ConstraintSet>
|
||||||
@@ -17,61 +17,41 @@
|
|||||||
|
|
||||||
<ConstraintSet
|
<ConstraintSet
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/split_header_constraint">
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/clock"
|
android:id="@+id/clock">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="0dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/date"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
app:layout_constraintEnd_toStartOf="@id/date"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/date"
|
android:id="@+id/date">
|
||||||
android:layout_width="wrap_content"
|
<Layout
|
||||||
android:layout_height="0dp"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toEndOf="@id/clock"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
app:layout_constraintStart_toEndOf="@id/clock"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintEnd_toStartOf="@id/carrier_group"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
app:layout_constraintHorizontal_bias="0"
|
||||||
|
/>
|
||||||
|
</Constraint>
|
||||||
|
|
||||||
<Constraint
|
<Constraint
|
||||||
android:id="@+id/carrier_group"
|
android:id="@+id/carrier_group">
|
||||||
android:layout_width="0dp"
|
<PropertySet
|
||||||
android:layout_height="0dp"
|
android:alpha="1"
|
||||||
app:layout_constrainedWidth="true"
|
app:customFloatValue="1"
|
||||||
android:layout_gravity="end|center_vertical"
|
/>
|
||||||
android:layout_marginStart="8dp"
|
</Constraint>
|
||||||
app:layout_constraintStart_toEndOf="@id/date"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/statusIcons"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/statusIcons"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/carrier_group"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/batteryRemainingIcon"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/batteryRemainingIcon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/statusIcons"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</ConstraintSet>
|
</ConstraintSet>
|
||||||
@@ -309,6 +309,10 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAnimators() {
|
private void updateAnimators() {
|
||||||
|
if (mUseCombinedQSHeader) {
|
||||||
|
mTranslationAnimator = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
updateAlphaAnimator();
|
updateAlphaAnimator();
|
||||||
int offset = mTopViewMeasureHeight;
|
int offset = mTopViewMeasureHeight;
|
||||||
|
|
||||||
@@ -321,6 +325,10 @@ public class QuickStatusBarHeader extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlphaAnimator() {
|
private void updateAlphaAnimator() {
|
||||||
|
if (mUseCombinedQSHeader) {
|
||||||
|
mAlphaAnimator = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
TouchAnimator.Builder builder = new TouchAnimator.Builder()
|
TouchAnimator.Builder builder = new TouchAnimator.Builder()
|
||||||
.addFloat(mSecurityHeaderView, "alpha", 0, 1)
|
.addFloat(mSecurityHeaderView, "alpha", 0, 1)
|
||||||
// These views appear on expanding down
|
// These views appear on expanding down
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
package com.android.systemui.statusbar.phone
|
package com.android.systemui.statusbar.phone
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||||
import androidx.constraintlayout.widget.ConstraintSet
|
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.animation.ShadeInterpolation
|
import com.android.systemui.animation.ShadeInterpolation
|
||||||
import com.android.systemui.battery.BatteryMeterView
|
import com.android.systemui.battery.BatteryMeterView
|
||||||
@@ -39,6 +38,11 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
batteryMeterViewController: BatteryMeterViewController
|
batteryMeterViewController: BatteryMeterViewController
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val HEADER_TRANSITION_ID = R.id.header_transition
|
||||||
|
private val SPLIT_HEADER_TRANSITION_ID = R.id.split_header_transition
|
||||||
|
}
|
||||||
|
|
||||||
private val combinedHeaders = featureFlags.useCombinedQSHeaders()
|
private val combinedHeaders = featureFlags.useCombinedQSHeaders()
|
||||||
// TODO(b/194178072) Handle RSSI hiding when multi carrier
|
// TODO(b/194178072) Handle RSSI hiding when multi carrier
|
||||||
private val iconManager: StatusBarIconController.IconManager
|
private val iconManager: StatusBarIconController.IconManager
|
||||||
@@ -59,6 +63,7 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
}
|
}
|
||||||
field = value
|
field = value
|
||||||
updateVisibility()
|
updateVisibility()
|
||||||
|
updatePosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
var splitShadeMode = false
|
var splitShadeMode = false
|
||||||
@@ -68,6 +73,7 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
}
|
}
|
||||||
field = value
|
field = value
|
||||||
updateVisibility()
|
updateVisibility()
|
||||||
|
updateConstraints()
|
||||||
}
|
}
|
||||||
|
|
||||||
var shadeExpandedFraction = -1f
|
var shadeExpandedFraction = -1f
|
||||||
@@ -83,13 +89,22 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
if (visible && field != value) {
|
if (visible && field != value) {
|
||||||
field = value
|
field = value
|
||||||
updateVisibility()
|
updateVisibility()
|
||||||
|
updatePosition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val constraintSplit = ConstraintSet()
|
init {
|
||||||
.apply { load(statusBar.context, R.xml.split_header) }
|
if (statusBar is MotionLayout) {
|
||||||
private val constraintQQS = ConstraintSet().apply { load(statusBar.context, R.xml.qqs_header) }
|
val context = statusBar.context
|
||||||
private val constraintQS = ConstraintSet().apply { load(statusBar.context, R.xml.qs_header) }
|
val resources = statusBar.resources
|
||||||
|
statusBar.getConstraintSet(R.id.qqs_header_constraint)
|
||||||
|
.load(context, resources.getXml(R.xml.qqs_header))
|
||||||
|
statusBar.getConstraintSet(R.id.qs_header_constraint)
|
||||||
|
.load(context, resources.getXml(R.xml.qs_header))
|
||||||
|
statusBar.getConstraintSet(R.id.split_header_constraint)
|
||||||
|
.load(context, resources.getXml(R.xml.split_header))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
batteryMeterViewController.init()
|
batteryMeterViewController.init()
|
||||||
@@ -104,6 +119,8 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
qsCarrierGroupController = qsCarrierGroupControllerBuilder
|
qsCarrierGroupController = qsCarrierGroupControllerBuilder
|
||||||
.setQSCarrierGroup(statusBar.findViewById(R.id.carrier_group))
|
.setQSCarrierGroup(statusBar.findViewById(R.id.carrier_group))
|
||||||
.build()
|
.build()
|
||||||
|
updateVisibility()
|
||||||
|
updateConstraints()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateVisibility() {
|
private fun updateVisibility() {
|
||||||
@@ -118,20 +135,25 @@ class SplitShadeHeaderController @Inject constructor(
|
|||||||
statusBar.visibility = visibility
|
statusBar.visibility = visibility
|
||||||
visible = visibility == View.VISIBLE
|
visible = visibility == View.VISIBLE
|
||||||
}
|
}
|
||||||
updateConstraints()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateConstraints() {
|
private fun updateConstraints() {
|
||||||
if (!combinedHeaders) {
|
if (!combinedHeaders) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
statusBar as ConstraintLayout
|
statusBar as MotionLayout
|
||||||
if (splitShadeMode) {
|
if (splitShadeMode) {
|
||||||
constraintSplit.applyTo(statusBar)
|
statusBar.setTransition(SPLIT_HEADER_TRANSITION_ID)
|
||||||
} else if (qsExpandedFraction == 1f) {
|
|
||||||
constraintQS.applyTo(statusBar)
|
|
||||||
} else {
|
} else {
|
||||||
constraintQQS.applyTo(statusBar)
|
statusBar.setTransition(HEADER_TRANSITION_ID)
|
||||||
|
statusBar.transitionToStart()
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updatePosition() {
|
||||||
|
if (statusBar is MotionLayout && !splitShadeMode && visible) {
|
||||||
|
statusBar.setProgress(qsExpandedFraction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user