Auxio/app/src/main/res/layout/item_genre_header.xml
OxygenCobalt a566a30c15
style: use colorAccent
Use colorAccent instead of colorPrimary and colorSecondary.
2021-08-06 17:47:11 -06:00

125 lines
5.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".detail.adapters.GenreDetailAdapter.GenreHeaderViewHolder">
<data>
<variable
name="genre"
type="org.oxycblt.auxio.music.Genre" />
<variable
name="detailModel"
type="org.oxycblt.auxio.detail.DetailViewModel" />
<variable
name="playbackModel"
type="org.oxycblt.auxio.playback.PlaybackViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/genre_image"
style="@style/Widget.ImageView.Full"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
app:genreImage="@{genre}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_genre" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/genre_name"
style="@style/Widget.TextView.Detail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{genre.resolvedName}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_image"
tools:text="Genre Name" />
<TextView
android:id="@+id/genre_song_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium"
android:text="@{@plurals/fmt_song_count(genre.songs.size(), genre.songs.size())}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="80 Songs" />
<TextView
android:id="@+id/genre_duration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medium"
android:text="@{genre.totalDuration}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_song_count"
tools:text="16:16" />
<com.google.android.material.button.MaterialButton
android:id="@+id/genre_play_button"
style="@style/Widget.Button.Vibrant.Secondary"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_small"
android:layout_marginEnd="@dimen/spacing_small"
android:onClick="@{() -> playbackModel.playGenre(genre, false)}"
android:text="@string/lbl_play"
app:layout_constraintEnd_toStartOf="@+id/genre_shuffle_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_duration" />
<com.google.android.material.button.MaterialButton
android:id="@+id/genre_shuffle_button"
style="@style/Widget.Button.Vibrant.Primary"
android:backgroundTint="?attr/colorAccent"
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
android:text="@string/lbl_shuffle"
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
app:layout_constraintTop_toTopOf="@+id/genre_play_button" />
<TextView
android:id="@+id/genre_song_header"
style="@style/Widget.TextView.Header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_small"
android:text="@string/lbl_songs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_play_button" />
<ImageButton
android:id="@+id/genre_sort_button"
style="@style/Widget.Button.Unbounded.Small"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@string/desc_sort_button"
android:onClick="@{() -> detailModel.incrementGenreSortMode()}"
app:layout_constraintBottom_toBottomOf="@+id/genre_song_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/genre_song_header"
app:sortIcon="@{detailModel.genreSortMode}"
tools:src="@drawable/ic_sort_alpha_down" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>