ui: animate play/pause button shape

Make the shape of the play/pause buttons throughout the app morph from
a circle if paused to a square if playing.

Android 13 seemingly does this to their play/pause button, so we copy
it too.

Tangentally related to #162.
This commit is contained in:
Alexander Capehart
2022-08-27 15:21:08 -06:00
parent a34541e95d
commit 0b43dd011c
10 changed files with 108 additions and 13 deletions
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/size_corners_mid_large" />
<solid android:color="?attr/colorPrimary" />
</shape>
</item>
<item>
<ripple android:color="@color/sel_remote_fab_ripple">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
<corners android:radius="@dimen/size_corners_mid_large" />
</shape>
</item>
</ripple>
</item>
</layer-list>
@@ -121,7 +121,7 @@
app:layout_constraintStart_toEndOf="@+id/playback_repeat"
app:layout_constraintTop_toTopOf="@+id/playback_play_pause" />
<com.google.android.material.button.MaterialButton
<org.oxycblt.auxio.playback.AnimatedMaterialButton
android:id="@+id/playback_play_pause"
style="@style/Widget.Auxio.Button.PlayPause"
android:layout_width="wrap_content"
@@ -124,7 +124,7 @@
app:layout_constraintEnd_toStartOf="@+id/playback_play_pause"
app:layout_constraintTop_toTopOf="@+id/playback_play_pause" />
<com.google.android.material.button.MaterialButton
<org.oxycblt.auxio.playback.AnimatedMaterialButton
android:id="@+id/playback_play_pause"
style="@style/Widget.Auxio.Button.PlayPause"
android:layout_width="wrap_content"
@@ -138,7 +138,7 @@
app:layout_constraintStart_toEndOf="@+id/playback_repeat"
app:layout_constraintTop_toTopOf="@+id/playback_play_pause" />
<com.google.android.material.button.MaterialButton
<org.oxycblt.auxio.playback.AnimatedMaterialButton
android:id="@+id/playback_play_pause"
style="@style/Widget.Auxio.Button.PlayPause"
android:layout_width="wrap_content"
+1 -1
View File
@@ -87,7 +87,7 @@
<!-- A variant of button that emulates a FAB-ish button that plays along with widget restrictions -->
<style name="Widget.Auxio.MaterialButton.AppWidget.PlayPause" parent="Widget.AppCompat.Button.Borderless">
<item name="android:minWidth">@dimen/size_btn</item>
<item name="android:background">@drawable/ui_remote_fab_bg</item>
<item name="android:background">@drawable/ui_remote_fab_container_paused</item>
<item name="android:tint">?attr/colorOnPrimary</item>
</style>
</resources>