Reduce the vertical padding of the seekbar when it's enabled by 2dp to
account for the extra height in the track. That way the height of the
SeekBar view is always 33dp.
This has a nice side effect of properly setting the height of the track
when resuming.
Bug: 160242262
Test: manual
Change-Id: I9b6888f2a6bf5fb118075dea3f849618350ec18b
(cherry picked from commit b84e6ba27f)
307 lines
12 KiB
XML
307 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
~ Copyright (C) 2019 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
|
|
-->
|
|
|
|
<!-- Layout for media controls inside QSPanel carousel -->
|
|
<com.android.systemui.util.animation.TransitionLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:id="@+id/qs_media_controls"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:gravity="center_horizontal|fill_vertical"
|
|
android:forceHasOverlappingRendering="false"
|
|
android:background="@drawable/qs_media_background">
|
|
|
|
<androidx.constraintlayout.widget.Guideline
|
|
android:id="@+id/center_vertical_guideline"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
app:layout_constraintGuide_percent="0.5"
|
|
/>
|
|
|
|
<!-- As per Material Design on Biderectionality, this is forced to LTR in code -->
|
|
<FrameLayout
|
|
android:id="@+id/notification_media_progress_time"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:forceHasOverlappingRendering="false">
|
|
<!-- width is set to "match_parent" to avoid extra layout calls -->
|
|
<TextView
|
|
android:id="@+id/media_elapsed_time"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_alignParentStart="true"
|
|
android:fontFamily="@*android:string/config_bodyFontFamily"
|
|
android:textColor="@color/media_primary_text"
|
|
android:gravity="start"
|
|
android:textSize="14sp" />
|
|
|
|
<TextView
|
|
android:id="@+id/media_total_time"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_alignParentEnd="true"
|
|
android:fontFamily="@*android:string/config_bodyFontFamily"
|
|
android:textColor="@color/media_primary_text"
|
|
android:gravity="end"
|
|
android:textSize="14sp" />
|
|
</FrameLayout>
|
|
|
|
<!-- Actions must be ordered left-to-right even in RTL layout. However, they appear in a chain
|
|
with the album art and the title, and must as a group appear at the end of that chain. This is
|
|
accomplished by having all actions appear in a LTR chain within the parent, and then biasing it
|
|
to the right side, then this barrier is used to bound the text views. -->
|
|
<androidx.constraintlayout.widget.Barrier
|
|
android:id="@+id/media_action_barrier"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
android:orientation="vertical"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:barrierDirection="start"
|
|
app:constraint_referenced_ids="action0,action1,action2,action3,action4"
|
|
/>
|
|
|
|
<ImageButton
|
|
android:id="@+id/action0"
|
|
style="@style/MediaPlayer.Button"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp" />
|
|
|
|
<ImageButton
|
|
android:id="@+id/action1"
|
|
style="@style/MediaPlayer.Button"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp" />
|
|
|
|
<ImageButton
|
|
android:id="@+id/action2"
|
|
style="@style/MediaPlayer.Button"
|
|
android:layout_width="52dp"
|
|
android:layout_height="52dp" />
|
|
|
|
<ImageButton
|
|
android:id="@+id/action3"
|
|
style="@style/MediaPlayer.Button"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp" />
|
|
|
|
<ImageButton
|
|
android:id="@+id/action4"
|
|
style="@style/MediaPlayer.Button"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp" />
|
|
|
|
<!-- Album Art -->
|
|
<ImageView
|
|
android:id="@+id/album_art"
|
|
android:layout_width="@dimen/qs_media_album_size"
|
|
android:layout_height="@dimen/qs_media_album_size" />
|
|
|
|
<!-- Seamless Output Switcher -->
|
|
<LinearLayout
|
|
android:id="@+id/media_seamless"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:foreground="@drawable/qs_media_seamless_background"
|
|
android:background="@drawable/qs_media_light_source"
|
|
android:orientation="horizontal"
|
|
android:forceHasOverlappingRendering="false"
|
|
android:paddingStart="12dp"
|
|
android:paddingTop="6dp"
|
|
android:paddingEnd="12dp"
|
|
android:paddingBottom="6dp">
|
|
|
|
<ImageView
|
|
android:id="@+id/media_seamless_image"
|
|
android:layout_width="@dimen/qs_seamless_icon_size"
|
|
android:layout_height="@dimen/qs_seamless_icon_size"
|
|
android:layout_marginEnd="8dp"
|
|
android:layout_gravity="center_vertical"
|
|
android:tint="@color/media_primary_text"
|
|
android:src="@*android:drawable/ic_media_seamless" />
|
|
|
|
<TextView
|
|
android:id="@+id/media_seamless_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:fontFamily="@*android:string/config_headlineFontFamily"
|
|
android:singleLine="true"
|
|
android:text="@*android:string/ext_media_seamless_action"
|
|
android:textColor="@color/media_primary_text"
|
|
android:textDirection="locale"
|
|
android:textSize="14sp" />
|
|
</LinearLayout>
|
|
|
|
<ImageView
|
|
android:id="@+id/media_seamless_fallback"
|
|
android:layout_width="@dimen/qs_seamless_icon_size"
|
|
android:layout_height="@dimen/qs_seamless_icon_size"
|
|
android:tint="@color/media_primary_text"
|
|
android:src="@drawable/ic_cast_connected"
|
|
android:forceHasOverlappingRendering="false" />
|
|
|
|
<!-- Seek Bar -->
|
|
<!-- As per Material Design on Biderectionality, this is forced to LTR in code -->
|
|
<SeekBar
|
|
android:id="@+id/media_progress_bar"
|
|
style="@android:style/Widget.ProgressBar.Horizontal"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
android:maxHeight="@dimen/qs_media_enabled_seekbar_height"
|
|
android:paddingVertical="@dimen/qs_media_enabled_seekbar_vertical_padding"
|
|
android:thumbTint="@color/media_primary_text"
|
|
android:progressTint="@color/media_seekbar_progress"
|
|
android:progressBackgroundTint="@color/media_disabled"
|
|
android:splitTrack="false" />
|
|
|
|
<!-- App name -->
|
|
<TextView
|
|
android:id="@+id/app_name"
|
|
android:textColor="@color/media_primary_text"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:singleLine="true"
|
|
android:fontFamily="@*android:string/config_headlineFontFamily"
|
|
android:textDirection="locale"
|
|
android:textSize="14sp" />
|
|
|
|
<!-- Song name -->
|
|
<TextView
|
|
android:id="@+id/header_title"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
|
android:singleLine="true"
|
|
android:textColor="@color/media_primary_text"
|
|
android:textSize="16sp" />
|
|
|
|
<!-- Artist name -->
|
|
<TextView
|
|
android:id="@+id/header_artist"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="@*android:string/config_headlineFontFamily"
|
|
android:singleLine="true"
|
|
android:textColor="@color/media_secondary_text"
|
|
android:textSize="14sp" />
|
|
|
|
<com.android.internal.widget.CachingIconView
|
|
android:id="@+id/icon"
|
|
android:tint="@color/media_primary_text"
|
|
android:layout_width="@dimen/qs_media_icon_size"
|
|
android:layout_height="@dimen/qs_media_icon_size" />
|
|
|
|
<!-- Constraints are set here as they are the same regardless of host -->
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
|
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
|
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
|
android:id="@+id/media_text"
|
|
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
|
android:textColor="@color/media_primary_text"
|
|
android:text="@string/controls_media_title"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintBottom_toTopOf="@id/remove_text"
|
|
app:layout_constraintVertical_chainStyle="spread_inside"/>
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
|
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
|
android:id="@+id/remove_text"
|
|
android:fontFamily="@*android:string/config_headlineFontFamily"
|
|
android:singleLine="true"
|
|
android:textColor="@color/media_primary_text"
|
|
android:text="@string/controls_media_close_session"
|
|
app:layout_constraintTop_toBottomOf="@id/media_text"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintBottom_toTopOf="@id/settings"/>
|
|
|
|
<FrameLayout
|
|
android:id="@+id/settings"
|
|
android:background="@drawable/qs_media_light_source"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
|
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
|
android:minWidth="48dp"
|
|
android:minHeight="48dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/remove_text">
|
|
|
|
<TextView
|
|
android:layout_gravity="bottom"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
|
android:textColor="@android:color/white"
|
|
android:text="@string/controls_media_settings_button" />
|
|
</FrameLayout>
|
|
|
|
<FrameLayout
|
|
android:id="@+id/cancel"
|
|
android:background="@drawable/qs_media_light_source"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
|
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
|
android:minWidth="48dp"
|
|
android:minHeight="48dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toStartOf="@id/dismiss" >
|
|
|
|
<TextView
|
|
android:layout_gravity="bottom"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
|
android:textColor="@android:color/white"
|
|
android:text="@string/cancel" />
|
|
</FrameLayout>
|
|
|
|
<FrameLayout
|
|
android:id="@+id/dismiss"
|
|
android:background="@drawable/qs_media_light_source"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
|
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
|
android:minWidth="48dp"
|
|
android:minHeight="48dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent">
|
|
|
|
<TextView
|
|
android:layout_gravity="bottom"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
|
android:textColor="@android:color/white"
|
|
android:text="@string/controls_media_dismiss_button"
|
|
/>
|
|
</FrameLayout>
|
|
</com.android.systemui.util.animation.TransitionLayout>
|