Prevent animated icons from animation on startup

Make ImageButtons that use animated icons not animate when the fragment is initially created.
This commit is contained in:
OxygenCobalt
2020-10-18 13:45:13 -06:00
parent 2811c83543
commit d01aa3ea4a
12 changed files with 50 additions and 22 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/background">
android:tint="@color/control_color">
<path
android:fillColor="@android:color/white"
android:pathData="m 7.5,6 h 3 v 12 h -3 z m 9,0 h -3 v 12 h 3 z" />
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/background">
@@ -110,11 +110,12 @@
android:layout_height="0dp"
android:layout_marginTop="@dimen/margin_tiny"
android:layout_marginEnd="@dimen/margin_tiny"
android:tint="@color/background"
android:background="@drawable/ui_circular_button"
android:backgroundTint="?android:attr/colorPrimary"
android:contentDescription="@string/description_play"
android:onClick="@{() -> playbackModel.play(album, false)}"
android:src="@drawable/ic_play"
android:onClick="@{() -> playbackModel.play(album, false)}"
app:layout_constraintBottom_toBottomOf="@+id/album_details"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/album_shuffle"
@@ -98,7 +98,7 @@
app:layout_constraintTop_toBottomOf="@+id/artist_genre"
tools:text="2 Albums, 20 Songs" />
<!-- TODO: Improve these two buttons so that they don't look as cluttered -->
<!-- TODO: Improve these two buttons so that they dont look as cluttered -->
<ImageButton
android:id="@+id/artist_play"
style="@style/Widget.AppCompat.Button.Borderless"
@@ -106,6 +106,7 @@
android:layout_height="0dp"
android:layout_marginTop="@dimen/margin_tiny"
android:layout_marginEnd="@dimen/margin_tiny"
android:tint="@color/background"
android:background="@drawable/ui_circular_button"
android:backgroundTint="?android:attr/colorPrimary"
android:contentDescription="@string/description_play"
@@ -91,12 +91,12 @@
android:layout_width="@dimen/size_play_pause_compact"
android:layout_height="@dimen/size_play_pause_compact"
android:background="@drawable/ui_unbounded_ripple"
android:tint="@color/control_color"
android:onClick="@{() -> playbackModel.invertPlayingStatus()}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_play_to_pause"
android:tint="@color/control_color" />
tools:src="@drawable/ic_play_to_pause" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
+1
View File
@@ -14,6 +14,7 @@
<dimen name="margin_mid_small">10dp</dimen>
<dimen name="margin_medium">16dp</dimen>
<dimen name="margin_mid_large">24dp</dimen>
<dimen name="margin_play">26dp</dimen>
<dimen name="margin_large">32dp</dimen>
<dimen name="margin_huge">64dp</dimen>
+1
View File
@@ -24,6 +24,7 @@
<string name="label_sort_alpha_down">A-Z</string>
<string name="label_sort_alpha_up">Z-A</string>
<string name="label_shuffle">Shuffle</string>
<string name="label_play">Play</string>
<!-- Hint Namespace | EditText Hints -->
<string name="hint_search_library">Search Library…</string>