Improved adaptive theme controls
This commit is contained in:
parent
66c376d0c4
commit
6f7054c141
1 changed files with 127 additions and 134 deletions
|
@ -1,21 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/playbackControls"
|
android:id="@+id/playbackControls"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:ignore="MissingPrefix">
|
tools:ignore="MissingPrefix">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/songCurrentProgress"
|
android:id="@+id/songCurrentProgress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -37,8 +30,9 @@
|
||||||
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:layout_weight="8"
|
android:layout_weight="8"
|
||||||
android:maxHeight="2dp"
|
android:maxHeight="1.5dp"
|
||||||
android:progressDrawable="@drawable/color_progress_seek"
|
android:progressDrawable="@drawable/color_progress_seek"
|
||||||
android:splitTrack="false"
|
android:splitTrack="false"
|
||||||
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
||||||
|
@ -63,90 +57,81 @@
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry"
|
tools:ignore="RtlHardcoded,RtlSymmetry"
|
||||||
tools:text="00:22" />
|
tools:text="00:22" />
|
||||||
|
|
||||||
</LinearLayout>
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
android:id="@+id/repeatButton"
|
||||||
<RelativeLayout
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/playerMediaControllerContainer"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:background="?attr/roundSelector"
|
||||||
android:layout_weight="1"
|
android:padding="16dp"
|
||||||
android:layoutDirection="ltr"
|
android:scaleType="fitCenter"
|
||||||
android:paddingStart="4dp"
|
app:layout_constraintBottom_toBottomOf="@+id/previousButton"
|
||||||
android:paddingEnd="4dp"
|
app:layout_constraintEnd_toStartOf="@+id/previousButton"
|
||||||
tools:ignore="ContentDescription,UnusedAttribute">
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/previousButton"
|
||||||
|
app:srcCompat="@drawable/ic_repeat_white_24dp"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/previousButton"
|
android:id="@+id/previousButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_toStartOf="@+id/dummy_fab"
|
|
||||||
android:background="?attr/roundSelector"
|
android:background="?attr/roundSelector"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/playPauseButton"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/repeatButton"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/playPauseButton"
|
||||||
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
|
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/playPauseButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:background="?attr/roundSelector"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/nextButton"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/previousButton"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/progressSlider"
|
||||||
|
app:srcCompat="@drawable/ic_pause_white_64dp"
|
||||||
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/nextButton"
|
android:id="@+id/nextButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_toEndOf="@+id/dummy_fab"
|
|
||||||
android:background="?attr/roundSelector"
|
android:background="?attr/roundSelector"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/shuffleButton"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/playPauseButton"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/playPauseButton"
|
||||||
app:srcCompat="@drawable/ic_skip_next_white_24dp"
|
app:srcCompat="@drawable/ic_skip_next_white_24dp"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:id="@+id/repeatButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:background="?attr/roundSelector"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
app:srcCompat="@drawable/ic_repeat_white_24dp"
|
|
||||||
tools:ignore="MissingPrefix"
|
|
||||||
tools:tint="@color/md_black_1000" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/shuffleButton"
|
android:id="@+id/shuffleButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:background="?attr/roundSelector"
|
android:background="?attr/roundSelector"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/nextButton"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/nextButton"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/nextButton"
|
||||||
app:srcCompat="@drawable/ic_shuffle_white_24dp"
|
app:srcCompat="@drawable/ic_shuffle_white_24dp"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:id="@+id/dummy_fab"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_centerInParent="true" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:id="@+id/playPauseButton"
|
|
||||||
android:layout_width="52dp"
|
|
||||||
android:layout_height="52dp"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:background="@drawable/color_circle_gradient"
|
|
||||||
android:elevation="4dp"
|
|
||||||
android:padding="16dp"
|
|
||||||
app:srcCompat="@drawable/ic_play_arrow_white_32dp" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/volumeFragmentContainer"
|
android:id="@+id/volumeFragmentContainer"
|
||||||
|
@ -154,7 +139,13 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:paddingStart="8dp"
|
android:paddingStart="8dp"
|
||||||
android:paddingEnd="8dp" />
|
android:paddingEnd="8dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/songInfo"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/playPauseButton"
|
||||||
|
tools:backgroundTint="@color/md_red_400"
|
||||||
|
tools:layout_height="52dp" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/songInfo"
|
android:id="@+id/songInfo"
|
||||||
|
@ -163,12 +154,14 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="2"
|
android:maxLines="1"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/text"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:text="@tools:sample/lorem/random" />
|
tools:text="@tools:sample/lorem/random" />
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
Loading…
Reference in a new issue