styles: refactor styles
Refactor styles again, this time trying to seperate the more layout-specific attributes so that layouts become more re-usable. This also updates the naming conventions of styles.
This commit is contained in:
@@ -26,8 +26,9 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/playback_cover"
|
||||
style="@style/CompactImageView"
|
||||
android:contentDescription="@{@string/description_album_cover(song.name)}"
|
||||
style="@style/Widget.ImageView.Compact"
|
||||
android:layout_margin="@dimen/spacing_small"
|
||||
android:contentDescription="@{@string/desc_album_cover(song.name)}"
|
||||
app:albumArt="@{song}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -37,6 +38,8 @@
|
||||
<TextView
|
||||
android:id="@+id/playback_song"
|
||||
style="@style/Widget.TextView.Compact.Primary"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:text="@{song.name}"
|
||||
app:layout_constraintBottom_toTopOf="@+id/playback_info"
|
||||
app:layout_constraintEnd_toStartOf="@+id/playback_play_pause"
|
||||
@@ -48,6 +51,8 @@
|
||||
<TextView
|
||||
android:id="@+id/playback_info"
|
||||
style="@style/Widget.TextView.Compact.Secondary"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:text="@{@string/format_info(song.album.artist.name, song.album.name)}"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playback_cover"
|
||||
app:layout_constraintEnd_toStartOf="@+id/playback_play_pause"
|
||||
@@ -57,8 +62,10 @@
|
||||
|
||||
<org.oxycblt.auxio.playback.PlayPauseButton
|
||||
android:id="@+id/playback_play_pause"
|
||||
style="@style/Widget.Button.Unbounded.PlayPause"
|
||||
android:contentDescription="@string/description_play_pause"
|
||||
style="@style/Widget.Button.Unbounded"
|
||||
android:padding="0dp"
|
||||
android:layout_margin="@dimen/spacing_small"
|
||||
android:contentDescription="@string/desc_play_pause"
|
||||
android:onClick="@{() -> playbackModel.invertPlayingStatus()}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -29,18 +29,18 @@
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/playback_toolbar"
|
||||
style="@style/Toolbar.Style.Icon.Down"
|
||||
style="@style/Widget.Toolbar.Icon.Down"
|
||||
android:elevation="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:menu="@menu/menu_playback"
|
||||
app:title="@string/label_playback" />
|
||||
app:title="@string/lbl_playback" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/playback_cover"
|
||||
style="@style/ElevatedImageView"
|
||||
style="@style/Widget.ImageView.Full"
|
||||
android:layout_margin="@dimen/spacing_large"
|
||||
android:contentDescription="@{@string/description_album_cover(song.name)}"
|
||||
android:contentDescription="@{@string/desc_album_cover(song.name)}"
|
||||
app:albumArt="@{song}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1"
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_song"
|
||||
style="@style/Widget.TextView.Playback.Primary"
|
||||
style="@style/Widget.TextView.Primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_artist"
|
||||
style="@style/Widget.TextView.Playback.Secondary"
|
||||
style="@style/Widget.TextView.Secondary"
|
||||
android:layout_marginStart="@dimen/spacing_mid_large"
|
||||
android:layout_marginEnd="@dimen/spacing_mid_large"
|
||||
android:onClick="@{() -> detailModel.navToItem(playbackModel.song.album.artist)}"
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_album"
|
||||
style="@style/Widget.TextView.Playback.Secondary"
|
||||
style="@style/Widget.TextView.Secondary"
|
||||
android:layout_marginStart="@dimen/spacing_mid_large"
|
||||
android:layout_marginEnd="@dimen/spacing_mid_large"
|
||||
android:onClick="@{() -> detailModel.navToItem(playbackModel.song.album)}"
|
||||
@@ -137,7 +137,7 @@
|
||||
android:id="@+id/playback_loop"
|
||||
style="@style/Widget.Button.Unbounded"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:contentDescription="@string/description_change_loop"
|
||||
android:contentDescription="@string/desc_change_loop"
|
||||
android:onClick="@{() -> playbackModel.incrementLoopStatus()}"
|
||||
android:src="@drawable/ic_loop"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playback_skip_prev"
|
||||
@@ -148,7 +148,7 @@
|
||||
<ImageButton
|
||||
android:id="@+id/playback_skip_prev"
|
||||
style="@style/Widget.Button.Unbounded"
|
||||
android:contentDescription="@string/description_skip_prev"
|
||||
android:contentDescription="@string/desc_skip_prev"
|
||||
android:onClick="@{() -> playbackModel.skipPrev()}"
|
||||
android:src="@drawable/ic_skip_prev"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playback_play_pause"
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
<org.oxycblt.auxio.playback.PlayPauseButton
|
||||
android:id="@+id/playback_play_pause"
|
||||
style="@style/PlayPause"
|
||||
style="@style/Widget.Component.Playback.PlayPause"
|
||||
android:onClick="@{() -> playbackModel.invertPlayingStatus()}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/playback_song_duration"
|
||||
@@ -169,7 +169,7 @@
|
||||
<ImageButton
|
||||
android:id="@+id/playback_skip_next"
|
||||
style="@style/Widget.Button.Unbounded"
|
||||
android:contentDescription="@string/description_skip_next"
|
||||
android:contentDescription="@string/desc_skip_next"
|
||||
android:onClick="@{() -> playbackModel.skipNext()}"
|
||||
android:src="@drawable/ic_skip_next"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playback_play_pause"
|
||||
@@ -181,7 +181,7 @@
|
||||
android:id="@+id/playback_shuffle"
|
||||
style="@style/Widget.Button.Unbounded"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:contentDescription="@string/description_shuffle"
|
||||
android:contentDescription="@string/desc_shuffle"
|
||||
android:onClick="@{() -> playbackModel.invertShuffleStatus()}"
|
||||
android:src="@drawable/ic_shuffle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playback_skip_next"
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
android:layout_height="@dimen/size_cover_detail_land"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
android:layout_marginTop="@dimen/spacing_medium"
|
||||
android:contentDescription="@{@string/description_album_cover(album.name)}"
|
||||
style="@style/ElevatedImageView"
|
||||
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
||||
style="@style/Widget.ImageView.Full"
|
||||
app:albumArt="@{album}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_name"
|
||||
style="@style/DetailTitleText"
|
||||
style="@style/Widget.TextView.Detail"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -83,9 +83,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_play_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Unimportant"
|
||||
style="@style/Widget.Button.Vibrant.Secondary"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, false)}"
|
||||
android:text="@string/label_play"
|
||||
android:text="@string/lbl_play"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
app:layout_constraintEnd_toStartOf="@+id/album_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -93,10 +96,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/album_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
style="@style/Widget.Button.Vibrant.Primary"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playAlbum(album, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:text="@string/lbl_shuffle"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/album_play_button"
|
||||
@@ -104,21 +109,29 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_song_header"
|
||||
style="@style/HeaderText"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/label_songs"
|
||||
style="@style/Widget.TextView.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:background="@drawable/ui_header_dividers"
|
||||
android:text="@string/lbl_songs"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_play_button" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/album_sort_button"
|
||||
style="@style/HeaderAction"
|
||||
android:contentDescription="@string/description_sort_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Button.Unbounded.Small"
|
||||
android:contentDescription="@string/desc_sort_button"
|
||||
android:onClick="@{() -> detailModel.incrementAlbumSortMode()}"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/album_song_header"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/album_song_header"
|
||||
app:sortIcon="@{detailModel.albumSortMode}"
|
||||
tools:src="@drawable/ic_sort_numeric_down" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -24,8 +24,8 @@
|
||||
android:layout_width="@dimen/size_cover_detail_land"
|
||||
android:layout_height="@dimen/size_cover_detail_land"
|
||||
android:layout_margin="@dimen/spacing_medium"
|
||||
android:contentDescription="@{@string/description_artist_image(artist.name)}"
|
||||
style="@style/ElevatedImageView"
|
||||
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
||||
style="@style/Widget.ImageView.Full"
|
||||
app:artistImage="@{artist}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_name"
|
||||
style="@style/DetailTitleText"
|
||||
style="@style/Widget.TextView.Detail"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -75,9 +75,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_play_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Unimportant"
|
||||
style="@style/Widget.Button.Vibrant.Secondary"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, false)}"
|
||||
android:text="@string/label_play"
|
||||
android:text="@string/lbl_play"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
app:layout_constraintEnd_toStartOf="@+id/artist_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -85,10 +88,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/artist_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
style="@style/Widget.Button.Vibrant.Primary"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playArtist(artist, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:text="@string/lbl_shuffle"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/artist_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/artist_play_button"
|
||||
@@ -96,9 +101,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_header"
|
||||
style="@style/HeaderText"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
style="@style/Widget.TextView.Header"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:text="@string/label_albums"
|
||||
android:text="@string/lbl_albums"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_play_button" />
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
android:layout_width="@dimen/size_cover_detail_land"
|
||||
android:layout_height="@dimen/size_cover_detail_land"
|
||||
android:layout_margin="@dimen/spacing_medium"
|
||||
android:contentDescription="@{@string/description_genre_image(genre.name)}"
|
||||
style="@style/ElevatedImageView"
|
||||
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
||||
style="@style/Widget.ImageView.Full"
|
||||
app:genreImage="@{genre}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/genre_name"
|
||||
style="@style/DetailTitleText"
|
||||
style="@style/Widget.TextView.Detail"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -56,7 +56,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
android:text="@{@plurals/format_song_count(genre.songs.size(), genre.songs.size())}"
|
||||
android:text="@{@plurals/fmt_song_count(genre.songs.size(), genre.songs.size())}"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:layout_constraintBottom_toTopOf="@+id/genre_duration"
|
||||
@@ -66,9 +66,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_play_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Unimportant"
|
||||
style="@style/Widget.Button.Vibrant.Secondary"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, false)}"
|
||||
android:text="@string/label_play"
|
||||
android:text="@string/lbl_play"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
app:layout_constraintEnd_toStartOf="@+id/genre_shuffle_button"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -76,10 +79,12 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/genre_shuffle_button"
|
||||
style="@style/Widget.MaterialComponents.Button.Highlighted"
|
||||
style="@style/Widget.Button.Vibrant.Primary"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||
android:text="@string/label_shuffle"
|
||||
android:text="@string/lbl_shuffle"
|
||||
android:layout_marginStart="@dimen/spacing_small"
|
||||
android:layout_marginEnd="@dimen/spacing_medium"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||
@@ -98,18 +103,23 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/genre_song_count"
|
||||
tools:text="16:16" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/genre_song_header"
|
||||
style="@style/HeaderText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.TextView.Header"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:text="@string/label_songs"
|
||||
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/HeaderAction"
|
||||
android:contentDescription="@string/description_sort_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Button.Unbounded.Small"
|
||||
android:contentDescription="@string/desc_sort_button"
|
||||
android:onClick="@{() -> detailModel.incrementGenreSortMode()}"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/genre_song_header"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user