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?) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = indexingState == null || albums.isEmpty()
|
||||
homeNoMusic.isInvisible = indexingState != null || albums.isNotEmpty()
|
||||
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || albums.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || albums.isNotEmpty()
|
||||
}
|
||||
albumAdapter.update(albums, homeModel.albumInstructions.consume())
|
||||
}
|
||||
|
|
|
@ -127,8 +127,10 @@ class ArtistListFragment :
|
|||
|
||||
private fun updateArtists(artists: List<Artist>, indexingState: IndexingState?) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = indexingState == null || artists.isEmpty()
|
||||
homeNoMusic.isInvisible = indexingState != null || artists.isNotEmpty()
|
||||
homeRecycler.isInvisible =
|
||||
indexingState !is IndexingState.Completed || artists.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || artists.isNotEmpty()
|
||||
}
|
||||
artistAdapter.update(artists, homeModel.artistInstructions.consume())
|
||||
}
|
||||
|
|
|
@ -126,8 +126,9 @@ class GenreListFragment :
|
|||
|
||||
private fun updateGenres(genres: List<Genre>, indexingState: IndexingState?) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = indexingState == null || genres.isEmpty()
|
||||
homeNoMusic.isInvisible = indexingState != null || genres.isNotEmpty()
|
||||
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || genres.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || genres.isNotEmpty()
|
||||
}
|
||||
genreAdapter.update(genres, homeModel.genreInstructions.consume())
|
||||
}
|
||||
|
|
|
@ -124,8 +124,10 @@ class PlaylistListFragment :
|
|||
|
||||
private fun updatePlaylists(playlists: List<Playlist>, indexingState: IndexingState?) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = indexingState == null || playlists.isEmpty()
|
||||
homeNoMusic.isInvisible = indexingState != null || playlists.isNotEmpty()
|
||||
homeRecycler.isInvisible =
|
||||
indexingState !is IndexingState.Completed || playlists.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || playlists.isNotEmpty()
|
||||
}
|
||||
playlistAdapter.update(playlists, homeModel.playlistInstructions.consume())
|
||||
}
|
||||
|
|
|
@ -151,8 +151,9 @@ class SongListFragment :
|
|||
|
||||
private fun updateSongs(songs: List<Song>, indexingState: IndexingState?) {
|
||||
requireBinding().apply {
|
||||
homeRecycler.isInvisible = indexingState == null || songs.isEmpty()
|
||||
homeNoMusic.isInvisible = indexingState != null || songs.isNotEmpty()
|
||||
homeRecycler.isInvisible = indexingState !is IndexingState.Completed || songs.isEmpty()
|
||||
homeNoMusic.isInvisible =
|
||||
indexingState !is IndexingState.Completed || songs.isNotEmpty()
|
||||
}
|
||||
songAdapter.update(songs, homeModel.songInstructions.consume())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue