home: fix no music indicator
This commit is contained in:
parent
7a7774a4db
commit
ddfe10b869
5 changed files with 17 additions and 10 deletions
|
@ -151,8 +151,9 @@ class AlbumListFragment :
|
||||||
|
|
||||||
private fun updateAlbums(albums: List<Album>, indexingState: IndexingState?) {
|
private fun updateAlbums(albums: List<Album>, indexingState: IndexingState?) {
|
||||||
requireBinding().apply {
|
requireBinding().apply {
|
||||||
homeRecycler.isInvisible = indexingState == null || albums.isEmpty()
|
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || albums.isEmpty()
|
||||||
homeNoMusic.isInvisible = indexingState != null || albums.isNotEmpty()
|
homeNoMusic.isInvisible =
|
||||||
|
indexingState !is IndexingState.Completed || albums.isNotEmpty()
|
||||||
}
|
}
|
||||||
albumAdapter.update(albums, homeModel.albumInstructions.consume())
|
albumAdapter.update(albums, homeModel.albumInstructions.consume())
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,8 +127,10 @@ class ArtistListFragment :
|
||||||
|
|
||||||
private fun updateArtists(artists: List<Artist>, indexingState: IndexingState?) {
|
private fun updateArtists(artists: List<Artist>, indexingState: IndexingState?) {
|
||||||
requireBinding().apply {
|
requireBinding().apply {
|
||||||
homeRecycler.isInvisible = indexingState == null || artists.isEmpty()
|
homeRecycler.isInvisible =
|
||||||
homeNoMusic.isInvisible = indexingState != null || artists.isNotEmpty()
|
indexingState !is IndexingState.Completed || artists.isEmpty()
|
||||||
|
homeNoMusic.isInvisible =
|
||||||
|
indexingState !is IndexingState.Completed || artists.isNotEmpty()
|
||||||
}
|
}
|
||||||
artistAdapter.update(artists, homeModel.artistInstructions.consume())
|
artistAdapter.update(artists, homeModel.artistInstructions.consume())
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,8 +126,9 @@ class GenreListFragment :
|
||||||
|
|
||||||
private fun updateGenres(genres: List<Genre>, indexingState: IndexingState?) {
|
private fun updateGenres(genres: List<Genre>, indexingState: IndexingState?) {
|
||||||
requireBinding().apply {
|
requireBinding().apply {
|
||||||
homeRecycler.isInvisible = indexingState == null || genres.isEmpty()
|
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || genres.isEmpty()
|
||||||
homeNoMusic.isInvisible = indexingState != null || genres.isNotEmpty()
|
homeNoMusic.isInvisible =
|
||||||
|
indexingState !is IndexingState.Completed || genres.isNotEmpty()
|
||||||
}
|
}
|
||||||
genreAdapter.update(genres, homeModel.genreInstructions.consume())
|
genreAdapter.update(genres, homeModel.genreInstructions.consume())
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,8 +124,10 @@ class PlaylistListFragment :
|
||||||
|
|
||||||
private fun updatePlaylists(playlists: List<Playlist>, indexingState: IndexingState?) {
|
private fun updatePlaylists(playlists: List<Playlist>, indexingState: IndexingState?) {
|
||||||
requireBinding().apply {
|
requireBinding().apply {
|
||||||
homeRecycler.isInvisible = indexingState == null || playlists.isEmpty()
|
homeRecycler.isInvisible =
|
||||||
homeNoMusic.isInvisible = indexingState != null || playlists.isNotEmpty()
|
indexingState !is IndexingState.Completed || playlists.isEmpty()
|
||||||
|
homeNoMusic.isInvisible =
|
||||||
|
indexingState !is IndexingState.Completed || playlists.isNotEmpty()
|
||||||
}
|
}
|
||||||
playlistAdapter.update(playlists, homeModel.playlistInstructions.consume())
|
playlistAdapter.update(playlists, homeModel.playlistInstructions.consume())
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,8 +151,9 @@ class SongListFragment :
|
||||||
|
|
||||||
private fun updateSongs(songs: List<Song>, indexingState: IndexingState?) {
|
private fun updateSongs(songs: List<Song>, indexingState: IndexingState?) {
|
||||||
requireBinding().apply {
|
requireBinding().apply {
|
||||||
homeRecycler.isInvisible = indexingState == null || songs.isEmpty()
|
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || songs.isEmpty()
|
||||||
homeNoMusic.isInvisible = indexingState != null || songs.isNotEmpty()
|
homeNoMusic.isInvisible =
|
||||||
|
indexingState !is IndexingState.Completed || songs.isNotEmpty()
|
||||||
}
|
}
|
||||||
songAdapter.update(songs, homeModel.songInstructions.consume())
|
songAdapter.update(songs, homeModel.songInstructions.consume())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue