home: fix no music indicator display

This commit is contained in:
Alexander Capehart 2024-11-27 09:46:46 -07:00
parent ae449ded45
commit dd3b411beb
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
5 changed files with 10 additions and 11 deletions

View file

@ -151,8 +151,8 @@ class AlbumListFragment :
private fun updateAlbums(albums: List<Album>, indexingState: IndexingState?) {
requireBinding().apply {
homeRecycler.isInvisible = indexingState is IndexingState.Indexing || albums.isEmpty()
homeNoMusic.isInvisible = albums.isEmpty()
homeRecycler.isInvisible = indexingState == null || albums.isEmpty()
homeNoMusic.isInvisible = indexingState != null || albums.isNotEmpty()
}
albumAdapter.update(albums, homeModel.albumInstructions.consume())
}

View file

@ -127,8 +127,8 @@ class ArtistListFragment :
private fun updateArtists(artists: List<Artist>, indexingState: IndexingState?) {
requireBinding().apply {
homeRecycler.isInvisible = indexingState is IndexingState.Indexing || artists.isEmpty()
homeNoMusic.isInvisible = artists.isEmpty()
homeRecycler.isInvisible = indexingState == null || artists.isEmpty()
homeNoMusic.isInvisible = indexingState != null || artists.isNotEmpty()
}
artistAdapter.update(artists, homeModel.artistInstructions.consume())
}

View file

@ -126,8 +126,8 @@ class GenreListFragment :
private fun updateGenres(genres: List<Genre>, indexingState: IndexingState?) {
requireBinding().apply {
homeRecycler.isInvisible = indexingState is IndexingState.Indexing || genres.isEmpty()
homeNoMusic.isInvisible = genres.isEmpty()
homeRecycler.isInvisible = indexingState == null || genres.isEmpty()
homeNoMusic.isInvisible = indexingState != null || genres.isNotEmpty()
}
genreAdapter.update(genres, homeModel.genreInstructions.consume())
}

View file

@ -124,9 +124,8 @@ class PlaylistListFragment :
private fun updatePlaylists(playlists: List<Playlist>, indexingState: IndexingState?) {
requireBinding().apply {
homeRecycler.isInvisible =
indexingState is IndexingState.Indexing || playlists.isEmpty()
homeNoMusic.isInvisible = playlists.isEmpty()
homeRecycler.isInvisible = indexingState == null || playlists.isEmpty()
homeNoMusic.isInvisible = indexingState != null || playlists.isNotEmpty()
}
playlistAdapter.update(playlists, homeModel.playlistInstructions.consume())
}

View file

@ -151,8 +151,8 @@ class SongListFragment :
private fun updateSongs(songs: List<Song>, indexingState: IndexingState?) {
requireBinding().apply {
homeRecycler.isInvisible = indexingState is IndexingState.Indexing || songs.isEmpty()
homeNoMusic.isInvisible = songs.isEmpty()
homeRecycler.isInvisible = indexingState == null || songs.isEmpty()
homeNoMusic.isInvisible = indexingState != null || songs.isNotEmpty()
}
songAdapter.update(songs, homeModel.songInstructions.consume())
}