Files
auxio-fork/app/src/main/res/layout/fragment_compact_playback.xml
T
OxygenCobalt dae334b1d6 home: re-add sorting
Re-add sorting to HomeFragment, except heavily improved. The major
improvement here is the addition of song sorting, which was a heavily
requested feature judging by #16. The setting does not save yet and
is not present in the detail fragments, but it is still a major
milestone for the new home ui.
2021-09-05 16:11:37 -06:00

84 lines
3.6 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=".playback.CompactPlaybackFragment">
<data>
<variable
name="song"
type="org.oxycblt.auxio.music.Song" />
<variable
name="playbackModel"
type="org.oxycblt.auxio.playback.PlaybackViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/playback_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="@drawable/ui_background_ripple"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="@+id/playback_cover"
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_toTopOf="@+id/playback_progress"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_song" />
<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"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toTopOf="@+id/playback_cover"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Song Name" />
<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"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
app:layout_constraintTop_toBottomOf="@+id/playback_song"
tools:text="Artist Name / Album Name" />
<ImageButton
android:id="@+id/playback_play_pause"
style="@style/Widget.Button.Unbounded"
android:src="@drawable/sel_playing_state"
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"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="@+id/playback_progress"
style="@style/Widget.ProgressBar.Compact"
android:progress="@{playbackModel.positionAsProgress}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:progress="70" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>