home: simplify no music indicator
This is not the most ideal communication of the UI, but for the sake of delivering faster this will be the setup until I can implement some kind of scaffold system (which will be annoying and hard).
This commit is contained in:
@@ -37,7 +37,6 @@ import org.oxycblt.auxio.list.adapter.SelectionIndicatorAdapter
|
||||
import org.oxycblt.auxio.list.recycler.AlbumViewHolder
|
||||
import org.oxycblt.auxio.list.recycler.FastScrollRecyclerView
|
||||
import org.oxycblt.auxio.list.sort.Sort
|
||||
import org.oxycblt.auxio.music.IndexingState
|
||||
import org.oxycblt.auxio.music.MusicViewModel
|
||||
import org.oxycblt.auxio.music.resolve
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
@@ -82,11 +81,11 @@ class AlbumListFragment :
|
||||
listener = this@AlbumListFragment
|
||||
}
|
||||
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_no_albums)
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_empty_albums)
|
||||
|
||||
binding.homeChooseMusicSources.setOnClickListener { homeModel.startChooseMusicLocations() }
|
||||
|
||||
collectImmediately(homeModel.albumList, musicModel.indexingState, ::updateAlbums)
|
||||
collectImmediately(homeModel.albumList, ::updateAlbums)
|
||||
collectImmediately(listModel.selected, ::updateSelection)
|
||||
collectImmediately(
|
||||
playbackModel.song, playbackModel.parent, playbackModel.isPlaying, ::updatePlayback)
|
||||
@@ -150,11 +149,10 @@ class AlbumListFragment :
|
||||
listModel.openMenu(R.menu.album, item)
|
||||
}
|
||||
|
||||
private fun updateAlbums(albums: List<Album>, indexingState: IndexingState?) {
|
||||
private fun updateAlbums(albums: List<Album>) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = albums.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || albums.isNotEmpty()
|
||||
homeNoMusic.isInvisible = albums.isNotEmpty()
|
||||
}
|
||||
albumAdapter.update(albums, homeModel.albumInstructions.consume())
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.oxycblt.auxio.list.adapter.SelectionIndicatorAdapter
|
||||
import org.oxycblt.auxio.list.recycler.ArtistViewHolder
|
||||
import org.oxycblt.auxio.list.recycler.FastScrollRecyclerView
|
||||
import org.oxycblt.auxio.list.sort.Sort
|
||||
import org.oxycblt.auxio.music.IndexingState
|
||||
import org.oxycblt.auxio.music.MusicViewModel
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.formatDurationMs
|
||||
@@ -76,11 +75,11 @@ class ArtistListFragment :
|
||||
listener = this@ArtistListFragment
|
||||
}
|
||||
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_no_artists)
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_empty_artists)
|
||||
|
||||
binding.homeChooseMusicSources.setOnClickListener { homeModel.startChooseMusicLocations() }
|
||||
|
||||
collectImmediately(homeModel.artistList, musicModel.indexingState, ::updateArtists)
|
||||
collectImmediately(homeModel.artistList, ::updateArtists)
|
||||
collectImmediately(listModel.selected, ::updateSelection)
|
||||
collectImmediately(
|
||||
playbackModel.song, playbackModel.parent, playbackModel.isPlaying, ::updatePlayback)
|
||||
@@ -125,11 +124,10 @@ class ArtistListFragment :
|
||||
listModel.openMenu(R.menu.parent, item)
|
||||
}
|
||||
|
||||
private fun updateArtists(artists: List<Artist>, indexingState: IndexingState?) {
|
||||
private fun updateArtists(artists: List<Artist>) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = artists.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || artists.isNotEmpty()
|
||||
homeNoMusic.isInvisible = artists.isNotEmpty()
|
||||
}
|
||||
artistAdapter.update(artists, homeModel.artistInstructions.consume())
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.oxycblt.auxio.list.adapter.SelectionIndicatorAdapter
|
||||
import org.oxycblt.auxio.list.recycler.FastScrollRecyclerView
|
||||
import org.oxycblt.auxio.list.recycler.GenreViewHolder
|
||||
import org.oxycblt.auxio.list.sort.Sort
|
||||
import org.oxycblt.auxio.music.IndexingState
|
||||
import org.oxycblt.auxio.music.MusicViewModel
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.formatDurationMs
|
||||
@@ -75,11 +74,11 @@ class GenreListFragment :
|
||||
listener = this@GenreListFragment
|
||||
}
|
||||
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_no_genres)
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_empty_genres)
|
||||
|
||||
binding.homeChooseMusicSources.setOnClickListener { homeModel.startChooseMusicLocations() }
|
||||
|
||||
collectImmediately(homeModel.genreList, musicModel.indexingState, ::updateGenres)
|
||||
collectImmediately(homeModel.genreList, ::updateGenres)
|
||||
collectImmediately(listModel.selected, ::updateSelection)
|
||||
collectImmediately(
|
||||
playbackModel.song, playbackModel.parent, playbackModel.isPlaying, ::updatePlayback)
|
||||
@@ -124,11 +123,10 @@ class GenreListFragment :
|
||||
listModel.openMenu(R.menu.parent, item)
|
||||
}
|
||||
|
||||
private fun updateGenres(genres: List<Genre>, indexingState: IndexingState?) {
|
||||
private fun updateGenres(genres: List<Genre>) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = genres.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || genres.isNotEmpty()
|
||||
homeNoMusic.isInvisible = genres.isNotEmpty()
|
||||
}
|
||||
genreAdapter.update(genres, homeModel.genreInstructions.consume())
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.oxycblt.auxio.list.adapter.SelectionIndicatorAdapter
|
||||
import org.oxycblt.auxio.list.recycler.FastScrollRecyclerView
|
||||
import org.oxycblt.auxio.list.recycler.PlaylistViewHolder
|
||||
import org.oxycblt.auxio.list.sort.Sort
|
||||
import org.oxycblt.auxio.music.IndexingState
|
||||
import org.oxycblt.auxio.music.MusicViewModel
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.playback.formatDurationMs
|
||||
@@ -73,11 +72,11 @@ class PlaylistListFragment :
|
||||
listener = this@PlaylistListFragment
|
||||
}
|
||||
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_no_playlists)
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_empty_playlists)
|
||||
|
||||
binding.homeChooseMusicSources.setOnClickListener { homeModel.startChooseMusicLocations() }
|
||||
|
||||
collectImmediately(homeModel.playlistList, musicModel.indexingState, ::updatePlaylists)
|
||||
collectImmediately(homeModel.playlistList, ::updatePlaylists)
|
||||
collectImmediately(listModel.selected, ::updateSelection)
|
||||
collectImmediately(
|
||||
playbackModel.song, playbackModel.parent, playbackModel.isPlaying, ::updatePlayback)
|
||||
@@ -122,11 +121,10 @@ class PlaylistListFragment :
|
||||
listModel.openMenu(R.menu.playlist, item)
|
||||
}
|
||||
|
||||
private fun updatePlaylists(playlists: List<Playlist>, indexingState: IndexingState?) {
|
||||
private fun updatePlaylists(playlists: List<Playlist>) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = playlists.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || playlists.isNotEmpty()
|
||||
homeNoMusic.isInvisible = playlists.isNotEmpty()
|
||||
}
|
||||
playlistAdapter.update(playlists, homeModel.playlistInstructions.consume())
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.oxycblt.auxio.list.adapter.SelectionIndicatorAdapter
|
||||
import org.oxycblt.auxio.list.recycler.FastScrollRecyclerView
|
||||
import org.oxycblt.auxio.list.recycler.SongViewHolder
|
||||
import org.oxycblt.auxio.list.sort.Sort
|
||||
import org.oxycblt.auxio.music.IndexingState
|
||||
import org.oxycblt.auxio.music.MusicViewModel
|
||||
import org.oxycblt.auxio.music.resolve
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
@@ -80,11 +79,11 @@ class SongListFragment :
|
||||
listener = this@SongListFragment
|
||||
}
|
||||
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_no_songs)
|
||||
binding.homeNoMusicMsg.text = getString(R.string.lng_empty_songs)
|
||||
|
||||
binding.homeChooseMusicSources.setOnClickListener { homeModel.startChooseMusicLocations() }
|
||||
|
||||
collectImmediately(homeModel.songList, musicModel.indexingState, ::updateSongs)
|
||||
collectImmediately(homeModel.songList, ::updateSongs)
|
||||
collectImmediately(listModel.selected, ::updateSelection)
|
||||
collectImmediately(
|
||||
playbackModel.song, playbackModel.parent, playbackModel.isPlaying, ::updatePlayback)
|
||||
@@ -150,11 +149,10 @@ class SongListFragment :
|
||||
listModel.openMenu(R.menu.song, item, homeModel.playWith)
|
||||
}
|
||||
|
||||
private fun updateSongs(songs: List<Song>, indexingState: IndexingState?) {
|
||||
private fun updateSongs(songs: List<Song>) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = songs.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || songs.isNotEmpty()
|
||||
homeNoMusic.isInvisible = songs.isNotEmpty()
|
||||
}
|
||||
songAdapter.update(songs, homeModel.songInstructions.consume())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user