music: make resolvedName standard

Make resolvedName the standard name to use across all music items.

Previously, the way Auxio differentiated between names in UIs was to
use name for normal items and resolvedName for parents. This was odd
and disjointed, as it muddled the meanings of the two fields and lead
to a lot of bugs. Fix this by making resolvedName *the* standard name
to use across all music items, even in ones that don't have to resolve
their name.
This commit is contained in:
OxygenCobalt 2022-03-13 20:18:26 -06:00
parent 2ff7d93263
commit 0417a77b33
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
33 changed files with 83 additions and 99 deletions

View file

@ -40,8 +40,8 @@ import org.oxycblt.auxio.util.systemBarInsetsCompat
/** /**
* The single [AppCompatActivity] for Auxio. * The single [AppCompatActivity] for Auxio.
* *
* TODO: Add a new view for crashes with a stack trace * TODO: Add a new view for crashes with a stack trace TODO: Custom language support TODO: Rework
* TODO: Custom language support TODO: Rework menus [perhaps add multi-select] * menus [perhaps add multi-select]
*/ */
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
private val playbackModel: PlaybackViewModel by viewModels() private val playbackModel: PlaybackViewModel by viewModels()

View file

@ -127,10 +127,10 @@ class AlbumDetailAdapter(
override fun onBind(data: Album) { override fun onBind(data: Album) {
binding.detailCover.apply { binding.detailCover.apply {
bindAlbumArt(data) bindAlbumArt(data)
contentDescription = context.getString(R.string.desc_album_cover, data.name) contentDescription = context.getString(R.string.desc_album_cover, data.resolvedName)
} }
binding.detailName.text = data.name binding.detailName.text = data.resolvedName
binding.detailSubhead.apply { binding.detailSubhead.apply {
text = data.artist.resolvedName text = data.artist.resolvedName

View file

@ -55,8 +55,7 @@ import org.oxycblt.auxio.util.logTraceOrThrow
* respective item. * respective item.
* @author OxygenCobalt * @author OxygenCobalt
* *
* TODO: Make tabs invisible when there is only one * TODO: Make tabs invisible when there is only one TODO: Add duration and song count sorts
* TODO: Add duration and song count sorts
*/ */
class HomeFragment : Fragment() { class HomeFragment : Fragment() {
private val playbackModel: PlaybackViewModel by activityViewModels() private val playbackModel: PlaybackViewModel by activityViewModels()

View file

@ -67,7 +67,7 @@ class AlbumListFragment : HomeListFragment() {
// Change how we display the popup depending on the mode. // Change how we display the popup depending on the mode.
when (homeModel.getSortForDisplay(DisplayMode.SHOW_ALBUMS)) { when (homeModel.getSortForDisplay(DisplayMode.SHOW_ALBUMS)) {
// By Name -> Use Name // By Name -> Use Name
is Sort.ByName -> album.name.sliceArticle().first().uppercase() is Sort.ByName -> album.resolvedName.sliceArticle().first().uppercase()
// By Artist -> Use Artist Name // By Artist -> Use Artist Name
is Sort.ByArtist -> album.artist.resolvedName.sliceArticle().first().uppercase() is Sort.ByArtist -> album.artist.resolvedName.sliceArticle().first().uppercase()

View file

@ -62,14 +62,14 @@ class SongListFragment : HomeListFragment() {
// based off the names of the parent objects and not the child objects. // based off the names of the parent objects and not the child objects.
when (homeModel.getSortForDisplay(DisplayMode.SHOW_SONGS)) { when (homeModel.getSortForDisplay(DisplayMode.SHOW_SONGS)) {
// Name -> Use name // Name -> Use name
is Sort.ByName -> song.name.sliceArticle().first().uppercase() is Sort.ByName -> song.resolvedName.sliceArticle().first().uppercase()
// Artist -> Use Artist Name // Artist -> Use Artist Name
is Sort.ByArtist -> is Sort.ByArtist ->
song.album.artist.resolvedName.sliceArticle().first().uppercase() song.album.artist.resolvedName.sliceArticle().first().uppercase()
// Album -> Use Album Name // Album -> Use Album Name
is Sort.ByAlbum -> song.album.name.sliceArticle().first().uppercase() is Sort.ByAlbum -> song.album.resolvedName.sliceArticle().first().uppercase()
// Year -> Use Full Year // Year -> Use Full Year
is Sort.ByYear -> song.album.year?.toString() ?: getString(R.string.def_date) is Sort.ByYear -> song.album.year?.toString() ?: getString(R.string.def_date)

View file

@ -25,8 +25,8 @@ import androidx.recyclerview.widget.RecyclerView
* A simple [ItemTouchHelper.Callback] that handles dragging items in the tab customization menu. * A simple [ItemTouchHelper.Callback] that handles dragging items in the tab customization menu.
* Unlike QueueAdapter's ItemTouchHelper, this one is bare and simple. * Unlike QueueAdapter's ItemTouchHelper, this one is bare and simple.
* *
* TODO: Consider unifying the * TODO: Consider unifying the shared behavior between this and QueueDragCallback into a single
* shared behavior between this and QueueDragCallback into a single class. * class.
*/ */
class TabDragCallback(private val getTabs: () -> Array<Tab>) : ItemTouchHelper.Callback() { class TabDragCallback(private val getTabs: () -> Array<Tab>) : ItemTouchHelper.Callback() {
private val tabs: Array<Tab> private val tabs: Array<Tab>

View file

@ -32,23 +32,10 @@ sealed class Item {
abstract val id: Long abstract val id: Long
} }
/** /** [Item] variant that represents a music item. */
* [Item] variant that represents a music item.
*
* TODO: Make name the actual display name and move raw names (including file names) to a
* new field called rawName.
*/
sealed class Music : Item() { sealed class Music : Item() {
/** The raw name of this item. */ /** The raw name of this item. */
abstract val name: String abstract val rawName: String
}
/**
* [Music] variant that denotes that this object is a parent of other data objects, such as an
* [Album] or [Artist]
* @property resolvedName
*/
sealed class MusicParent : Music() {
/** /**
* A name resolved from it's raw form to a form suitable to be shown in a ui. Ex. "unknown" * A name resolved from it's raw form to a form suitable to be shown in a ui. Ex. "unknown"
* would become Unknown Artist, (124) would become its proper genre name, etc. * would become Unknown Artist, (124) would become its proper genre name, etc.
@ -56,9 +43,15 @@ sealed class MusicParent : Music() {
abstract val resolvedName: String abstract val resolvedName: String
} }
/**
* [Music] variant that denotes that this object is a parent of other data objects, such as an
* [Album] or [Artist]
*/
sealed class MusicParent : Music()
/** The data object for a song. */ /** The data object for a song. */
data class Song( data class Song(
override val name: String, override val rawName: String,
/** The file name of this song, excluding the full path. */ /** The file name of this song, excluding the full path. */
val fileName: String, val fileName: String,
/** The total duration of this song, in millis. */ /** The total duration of this song, in millis. */
@ -80,14 +73,17 @@ data class Song(
) : Music() { ) : Music() {
override val id: Long override val id: Long
get() { get() {
var result = name.hashCode().toLong() var result = rawName.hashCode().toLong()
result = 31 * result + album.name.hashCode() result = 31 * result + album.rawName.hashCode()
result = 31 * result + album.artist.name.hashCode() result = 31 * result + album.artist.rawName.hashCode()
result = 31 * result + (track ?: 0) result = 31 * result + (track ?: 0)
result = 31 * result + duration.hashCode() result = 31 * result + duration.hashCode()
return result return result
} }
override val resolvedName: String
get() = rawName
/** The URI for this song. */ /** The URI for this song. */
val uri: Uri val uri: Uri
get() = get() =
@ -155,7 +151,7 @@ data class Song(
/** The data object for an album. */ /** The data object for an album. */
data class Album( data class Album(
override val name: String, override val rawName: String,
/** The latest year of the songs in this album. Null if none of the songs had metadata. */ /** The latest year of the songs in this album. Null if none of the songs had metadata. */
val year: Int?, val year: Int?,
/** The URI for the cover art corresponding to this album. */ /** The URI for the cover art corresponding to this album. */
@ -173,14 +169,14 @@ data class Album(
override val id: Long override val id: Long
get() { get() {
var result = name.hashCode().toLong() var result = rawName.hashCode().toLong()
result = 31 * result + artist.name.hashCode() result = 31 * result + artist.rawName.hashCode()
result = 31 * result + (year ?: 0) result = 31 * result + (year ?: 0)
return result return result
} }
override val resolvedName: String override val resolvedName: String
get() = name get() = rawName
/** The formatted total duration of this album */ /** The formatted total duration of this album */
val totalDuration: String val totalDuration: String
@ -214,7 +210,7 @@ data class Album(
* artist or artist field, not the individual performers of an artist. * artist or artist field, not the individual performers of an artist.
*/ */
data class Artist( data class Artist(
override val name: String, override val rawName: String,
override val resolvedName: String, override val resolvedName: String,
/** The albums of this artist. */ /** The albums of this artist. */
val albums: List<Album> val albums: List<Album>
@ -225,7 +221,7 @@ data class Artist(
} }
} }
override val id = name.hashCode().toLong() override val id = rawName.hashCode().toLong()
/** The songs of this artist. */ /** The songs of this artist. */
val songs = albums.flatMap { it.songs } val songs = albums.flatMap { it.songs }
@ -233,7 +229,7 @@ data class Artist(
/** The data object for a genre. */ /** The data object for a genre. */
data class Genre( data class Genre(
override val name: String, override val rawName: String,
override val resolvedName: String, override val resolvedName: String,
val songs: List<Song> val songs: List<Song>
) : MusicParent() { ) : MusicParent() {
@ -243,7 +239,7 @@ data class Genre(
} }
} }
override val id = name.hashCode().toLong() override val id = rawName.hashCode().toLong()
/** The formatted total duration of this genre */ /** The formatted total duration of this genre */
val totalDuration: String val totalDuration: String

View file

@ -112,7 +112,7 @@ class MusicLoader {
song.internalIsMissingArtist || song.internalIsMissingArtist ||
song.internalIsMissingGenre) { song.internalIsMissingGenre) {
throw IllegalStateException( throw IllegalStateException(
"Found malformed song: ${song.name} [" + "Found malformed song: ${song.rawName} [" +
"album: ${!song.internalIsMissingAlbum} " + "album: ${!song.internalIsMissingAlbum} " +
"artist: ${!song.internalIsMissingArtist} " + "artist: ${!song.internalIsMissingArtist} " +
"genre: ${!song.internalIsMissingGenre}]") "genre: ${!song.internalIsMissingGenre}]")
@ -240,7 +240,7 @@ class MusicLoader {
songs = songs =
songs songs
.distinctBy { .distinctBy {
it.name to it.rawName to
it.internalMediaStoreAlbumName to it.internalMediaStoreAlbumName to
it.internalMediaStoreArtistName to it.internalMediaStoreArtistName to
it.internalMediaStoreAlbumArtistName to it.internalMediaStoreAlbumArtistName to
@ -366,8 +366,8 @@ class MusicLoader {
// Songs that don't have a genre will be thrown into an unknown genre. // Songs that don't have a genre will be thrown into an unknown genre.
val unknownGenre = val unknownGenre =
Genre( Genre(
name = MediaStore.UNKNOWN_STRING, MediaStore.UNKNOWN_STRING,
resolvedName = context.getString(R.string.def_genre), context.getString(R.string.def_genre),
songsWithoutGenres) songsWithoutGenres)
genres.add(unknownGenre) genres.add(unknownGenre)

View file

@ -65,9 +65,7 @@ class PlaybackFragment : Fragment() {
binding.root.setOnApplyWindowInsetsListener { _, insets -> binding.root.setOnApplyWindowInsetsListener { _, insets ->
val bars = insets.systemBarInsetsCompat val bars = insets.systemBarInsetsCompat
binding.root.updatePadding(top = bars.top, bottom = bars.bottom) binding.root.updatePadding(top = bars.top, bottom = bars.bottom)
insets insets
} }
@ -97,7 +95,7 @@ class PlaybackFragment : Fragment() {
playbackModel.song.observe(viewLifecycleOwner) { song -> playbackModel.song.observe(viewLifecycleOwner) { song ->
if (song != null) { if (song != null) {
logD("Updating song display to ${song.name}") logD("Updating song display to ${song.rawName}")
binding.song = song binding.song = song
binding.playbackSeekBar.setDuration(song.seconds) binding.playbackSeekBar.setDuration(song.seconds)
} else { } else {

View file

@ -150,7 +150,7 @@ class PlaybackStateManager private constructor() {
* @param mode The [PlaybackMode] to construct the queue off of. * @param mode The [PlaybackMode] to construct the queue off of.
*/ */
fun playSong(song: Song, mode: PlaybackMode) { fun playSong(song: Song, mode: PlaybackMode) {
logD("Updating song to ${song.name} and mode to $mode") logD("Updating song to ${song.rawName} and mode to $mode")
when (mode) { when (mode) {
PlaybackMode.ALL_SONGS -> { PlaybackMode.ALL_SONGS -> {
@ -185,7 +185,7 @@ class PlaybackStateManager private constructor() {
* @param shuffled Whether the queue is shuffled or not * @param shuffled Whether the queue is shuffled or not
*/ */
fun playParent(parent: MusicParent, shuffled: Boolean) { fun playParent(parent: MusicParent, shuffled: Boolean) {
logD("Playing ${parent.name}") logD("Playing ${parent.rawName}")
mParent = parent mParent = parent
mIndex = 0 mIndex = 0
@ -270,7 +270,7 @@ class PlaybackStateManager private constructor() {
return false return false
} }
logD("Removing item ${mQueue[index].name}") logD("Removing item ${mQueue[index].rawName}")
mQueue.removeAt(index) mQueue.removeAt(index)
pushQueueUpdate() pushQueueUpdate()
return true return true

View file

@ -73,7 +73,7 @@ private constructor(private val context: Context, mediaToken: MediaSessionCompat
* @param onDone What to do when the loading of the album art is finished * @param onDone What to do when the loading of the album art is finished
*/ */
fun setMetadata(song: Song, onDone: () -> Unit) { fun setMetadata(song: Song, onDone: () -> Unit) {
setContentTitle(song.name) setContentTitle(song.resolvedName)
setContentText(song.resolvedArtistName) setContentText(song.resolvedArtistName)
// On older versions of android [API <24], show the song's album on the subtext instead of // On older versions of android [API <24], show the song's album on the subtext instead of

View file

@ -256,7 +256,7 @@ class PlaybackService :
override fun onSongUpdate(song: Song?) { override fun onSongUpdate(song: Song?) {
if (song != null) { if (song != null) {
logD("Setting player to ${song.name}") logD("Setting player to ${song.rawName}")
player.setMediaItem(MediaItem.fromUri(song.uri)) player.setMediaItem(MediaItem.fromUri(song.uri))
player.prepare() player.prepare()
notification.setMetadata(song, ::startForegroundOrNotify) notification.setMetadata(song, ::startForegroundOrNotify)
@ -500,8 +500,8 @@ class PlaybackService :
/** /**
* Pause from a headset plug. * Pause from a headset plug.
* *
* TODO: Find a way to centralize this stuff into a single BroadcastReceiver instead of * TODO: Find a way to centralize this stuff into a single BroadcastReceiver instead of the
* the weird disjointed arrangement between MediaSession and this. * weird disjointed arrangement between MediaSession and this.
*/ */
private fun pauseFromPlug() { private fun pauseFromPlug() {
if (playbackManager.song != null) { if (playbackManager.song != null) {

View file

@ -118,8 +118,8 @@ class PlaybackSessionConnector(
val builder = val builder =
MediaMetadataCompat.Builder() MediaMetadataCompat.Builder()
.putString(MediaMetadataCompat.METADATA_KEY_TITLE, song.name) .putString(MediaMetadataCompat.METADATA_KEY_TITLE, song.resolvedName)
.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, song.name) .putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, song.resolvedName)
.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, artistName) .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, artistName)
.putString(MediaMetadataCompat.METADATA_KEY_AUTHOR, artistName) .putString(MediaMetadataCompat.METADATA_KEY_AUTHOR, artistName)
.putString(MediaMetadataCompat.METADATA_KEY_COMPOSER, artistName) .putString(MediaMetadataCompat.METADATA_KEY_COMPOSER, artistName)

View file

@ -180,7 +180,7 @@ class SearchFragment : Fragment() {
if (!searchModel.isNavigating) { if (!searchModel.isNavigating) {
searchModel.setNavigating(true) searchModel.setNavigating(true)
logD("Navigating to the detail fragment for ${item.name}") logD("Navigating to the detail fragment for ${item.rawName}")
findNavController() findNavController()
.navigate( .navigate(

View file

@ -28,7 +28,6 @@ import org.oxycblt.auxio.R
import org.oxycblt.auxio.music.Header import org.oxycblt.auxio.music.Header
import org.oxycblt.auxio.music.Item import org.oxycblt.auxio.music.Item
import org.oxycblt.auxio.music.Music import org.oxycblt.auxio.music.Music
import org.oxycblt.auxio.music.MusicParent
import org.oxycblt.auxio.music.MusicStore import org.oxycblt.auxio.music.MusicStore
import org.oxycblt.auxio.settings.SettingsManager import org.oxycblt.auxio.settings.SettingsManager
import org.oxycblt.auxio.ui.DisplayMode import org.oxycblt.auxio.ui.DisplayMode
@ -144,19 +143,11 @@ class SearchViewModel : ViewModel() {
*/ */
private fun <T : Music> List<T>.filterByOrNull(value: String): List<T>? { private fun <T : Music> List<T>.filterByOrNull(value: String): List<T>? {
val filtered = filter { val filtered = filter {
// Ensure the name we match with is correct.
val name =
if (it is MusicParent) {
it.resolvedName
} else {
it.name
}
// First see if the normal item name will work. If that fails, try the "normalized" // First see if the normal item name will work. If that fails, try the "normalized"
// [e.g all accented/unicode chars become latin chars] instead. Hopefully this // [e.g all accented/unicode chars become latin chars] instead. Hopefully this
// shouldn't break other language's search functionality. // shouldn't break other language's search functionality.
name.contains(value, ignoreCase = true) || it.resolvedName.contains(value, ignoreCase = true) ||
name.normalized().contains(value, ignoreCase = true) it.resolvedName.normalized().contains(value, ignoreCase = true)
} }
return filtered.ifEmpty { null } return filtered.ifEmpty { null }

View file

@ -56,8 +56,8 @@ fun Fragment.newMenu(anchor: View, data: Item, flag: Int = ActionMenu.FLAG_NONE)
* @throws IllegalStateException When there is no menu for this specific datatype/flag * @throws IllegalStateException When there is no menu for this specific datatype/flag
* @author OxygenCobalt * @author OxygenCobalt
* *
* TODO: Stop scrolling when a menu is open TODO: Prevent duplicate menus from showing up * TODO: Stop scrolling when a menu is open TODO: Prevent duplicate menus from showing up TODO:
* TODO: Maybe replace this with a bottom sheet? * Maybe replace this with a bottom sheet?
*/ */
class ActionMenu( class ActionMenu(
activity: AppCompatActivity, activity: AppCompatActivity,

View file

@ -98,7 +98,7 @@ sealed class Sort(open val isAscending: Boolean) {
*/ */
fun sortSongs(songs: Collection<Song>): List<Song> { fun sortSongs(songs: Collection<Song>): List<Song> {
return when (this) { return when (this) {
is ByName -> songs.stringSort { it.name } is ByName -> songs.stringSort { it.resolvedName }
else -> else ->
sortAlbums(songs.groupBy { it.album }.keys).flatMap { album -> sortAlbums(songs.groupBy { it.album }.keys).flatMap { album ->
album.songs.intSort(true) { it.track ?: 0 } album.songs.intSort(true) { it.track ?: 0 }

View file

@ -90,7 +90,7 @@ private fun createViews(context: Context, @LayoutRes layout: Int): RemoteViews {
private fun RemoteViews.applyMeta(context: Context, state: WidgetState): RemoteViews { private fun RemoteViews.applyMeta(context: Context, state: WidgetState): RemoteViews {
applyCover(context, state) applyCover(context, state)
setTextViewText(R.id.widget_song, state.song.name) setTextViewText(R.id.widget_song, state.song.resolvedName)
setTextViewText(R.id.widget_artist, state.song.resolvedArtistName) setTextViewText(R.id.widget_artist, state.song.resolvedArtistName)
return this return this

View file

@ -39,7 +39,7 @@
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_marginStart="@dimen/spacing_mid_large" android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginTop="@dimen/spacing_mid_large" android:layout_marginTop="@dimen/spacing_mid_large"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar" app:layout_constraintBottom_toTopOf="@+id/playback_seek_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -68,7 +68,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}" android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
android:text="@{song.name}" android:text="@{song.resolvedName}"
tools:text="Song Name" /> tools:text="Song Name" />
</FrameLayout> </FrameLayout>

View file

@ -38,7 +38,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_mid_large" android:layout_margin="@dimen/spacing_mid_large"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/playback_song_container" app:layout_constraintEnd_toStartOf="@+id/playback_song_container"
@ -67,7 +67,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}" android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
android:text="@{song.name}" android:text="@{song.resolvedName}"
tools:text="Song Name" /> tools:text="Song Name" />
</FrameLayout> </FrameLayout>

View file

@ -38,7 +38,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_large" android:layout_margin="@dimen/spacing_large"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_song" app:layout_constraintBottom_toTopOf="@+id/playback_song"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -54,7 +54,7 @@
android:layout_marginStart="@dimen/spacing_large" android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large" android:layout_marginEnd="@dimen/spacing_large"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}" android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
android:text="@{song.name}" android:text="@{song.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/playback_artist" app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View file

@ -21,7 +21,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Medium" style="@style/Widget.Auxio.Image.Medium"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar" app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -35,7 +35,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_small" android:layout_marginStart="@dimen/spacing_small"
android:text="@{song.name}" android:text="@{song.resolvedName}"
android:layout_marginEnd="@dimen/spacing_small" android:layout_marginEnd="@dimen/spacing_small"
app:layout_constraintBottom_toTopOf="@+id/playback_info" app:layout_constraintBottom_toTopOf="@+id/playback_info"
app:layout_constraintEnd_toStartOf="@+id/playback_skip_prev" app:layout_constraintEnd_toStartOf="@+id/playback_skip_prev"

View file

@ -38,7 +38,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_mid_large" android:layout_margin="@dimen/spacing_mid_large"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -66,7 +66,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}" android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
android:text="@{song.name}" android:text="@{song.resolvedName}"
tools:text="Song Name" /> tools:text="Song Name" />
</FrameLayout> </FrameLayout>

View file

@ -21,7 +21,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar" app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -34,7 +34,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_small" android:layout_marginStart="@dimen/spacing_small"
android:text="@{song.name}" android:text="@{song.resolvedName}"
android:layout_marginEnd="@dimen/spacing_small" android:layout_marginEnd="@dimen/spacing_small"
app:layout_constraintBottom_toTopOf="@+id/playback_info" app:layout_constraintBottom_toTopOf="@+id/playback_info"
app:layout_constraintEnd_toStartOf="@+id/playback_skip_prev" app:layout_constraintEnd_toStartOf="@+id/playback_skip_prev"

View file

@ -37,7 +37,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Full" style="@style/Widget.Auxio.Image.Full"
android:layout_margin="@dimen/spacing_mid_large" android:layout_margin="@dimen/spacing_mid_large"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_song" app:layout_constraintBottom_toTopOf="@+id/playback_song"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -53,7 +53,7 @@
android:layout_marginStart="@dimen/spacing_mid_large" android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large" android:layout_marginEnd="@dimen/spacing_mid_large"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}" android:onClick="@{() -> detailModel.navToItem(playbackModel.song)}"
android:text="@{song.name}" android:text="@{song.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/playback_artist" app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View file

@ -16,7 +16,7 @@
<org.oxycblt.auxio.coil.RoundableImageView <org.oxycblt.auxio.coil.RoundableImageView
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Medium" style="@style/Widget.Auxio.Image.Medium"
android:contentDescription="@{@string/desc_album_cover(album.name)}" android:contentDescription="@{@string/desc_album_cover(album.resolvedName)}"
app:albumArt="@{album}" app:albumArt="@{album}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -28,7 +28,7 @@
style="@style/Widget.Auxio.TextView.Item.Primary" style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{album.name}" android:text="@{album.rawName}"
app:layout_constraintBottom_toTopOf="@+id/album_info" app:layout_constraintBottom_toTopOf="@+id/album_info"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/album_cover" app:layout_constraintStart_toEndOf="@+id/album_cover"

View file

@ -52,7 +52,7 @@
style="@style/Widget.Auxio.TextView.Item.Primary" style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{song.name}" android:text="@{song.resolvedName}"
android:textColor="@color/sel_accented_primary" android:textColor="@color/sel_accented_primary"
app:layout_constraintBottom_toTopOf="@+id/song_duration" app:layout_constraintBottom_toTopOf="@+id/song_duration"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,7 +16,7 @@
<org.oxycblt.auxio.coil.RoundableImageView <org.oxycblt.auxio.coil.RoundableImageView
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Medium" style="@style/Widget.Auxio.Image.Medium"
android:contentDescription="@{@string/desc_album_cover(album.name)}" android:contentDescription="@{@string/desc_album_cover(album.resolvedName)}"
app:albumArt="@{album}" app:albumArt="@{album}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -28,7 +28,7 @@
style="@style/Widget.Auxio.TextView.Item.Primary" style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{album.name}" android:text="@{album.resolvedName}"
android:textColor="@color/sel_accented_primary" android:textColor="@color/sel_accented_primary"
app:layout_constraintBottom_toTopOf="@+id/album_year" app:layout_constraintBottom_toTopOf="@+id/album_year"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,7 +16,7 @@
<org.oxycblt.auxio.coil.RoundableImageView <org.oxycblt.auxio.coil.RoundableImageView
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -29,7 +29,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{song.name}" android:text="@{song.resolvedName}"
android:textColor="@color/sel_accented_primary" android:textColor="@color/sel_accented_primary"
app:layout_constraintBottom_toTopOf="@+id/song_info" app:layout_constraintBottom_toTopOf="@+id/song_info"
app:layout_constraintEnd_toStartOf="@+id/song_duration" app:layout_constraintEnd_toStartOf="@+id/song_duration"

View file

@ -16,7 +16,7 @@
<org.oxycblt.auxio.coil.RoundableImageView <org.oxycblt.auxio.coil.RoundableImageView
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -29,7 +29,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{song.name}" android:text="@{song.resolvedName}"
android:textColor="@color/sel_accented_primary" android:textColor="@color/sel_accented_primary"
app:layout_constraintBottom_toTopOf="@+id/song_info" app:layout_constraintBottom_toTopOf="@+id/song_info"
app:layout_constraintEnd_toStartOf="@+id/song_duration" app:layout_constraintEnd_toStartOf="@+id/song_duration"

View file

@ -42,7 +42,7 @@
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:layout_margin="@dimen/spacing_medium" android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -55,7 +55,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_medium" android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{song.name}" android:text="@{song.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/song_info" app:layout_constraintBottom_toTopOf="@+id/song_info"
app:layout_constraintEnd_toStartOf="@+id/song_drag_handle" app:layout_constraintEnd_toStartOf="@+id/song_drag_handle"
app:layout_constraintStart_toEndOf="@+id/album_cover" app:layout_constraintStart_toEndOf="@+id/album_cover"

View file

@ -16,7 +16,7 @@
<org.oxycblt.auxio.coil.RoundableImageView <org.oxycblt.auxio.coil.RoundableImageView
android:id="@+id/album_cover" android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -28,7 +28,7 @@
style="@style/Widget.Auxio.TextView.Item.Primary" style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{song.name}" android:text="@{song.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/song_info" app:layout_constraintBottom_toTopOf="@+id/song_info"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/album_cover" app:layout_constraintStart_toEndOf="@+id/album_cover"

View file

@ -21,7 +21,7 @@
android:id="@+id/playback_cover" android:id="@+id/playback_cover"
style="@style/Widget.Auxio.Image.Small" style="@style/Widget.Auxio.Image.Small"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:contentDescription="@{@string/desc_album_cover(song.name)}" android:contentDescription="@{@string/desc_album_cover(song.resolvedName)}"
app:albumArt="@{song}" app:albumArt="@{song}"
app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar" app:layout_constraintBottom_toTopOf="@+id/playback_progress_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -35,7 +35,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_small" android:layout_marginStart="@dimen/spacing_small"
android:layout_marginEnd="@dimen/spacing_small" android:layout_marginEnd="@dimen/spacing_small"
android:text="@{song.name}" android:text="@{song.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/playback_info" app:layout_constraintBottom_toTopOf="@+id/playback_info"
app:layout_constraintEnd_toStartOf="@+id/playback_play_pause" app:layout_constraintEnd_toStartOf="@+id/playback_play_pause"
app:layout_constraintStart_toEndOf="@+id/playback_cover" app:layout_constraintStart_toEndOf="@+id/playback_cover"