The viewmodels have been modified to not repeat calls to the backend during the lifecycle of the fragment

This commit is contained in:
antonio committed 2022-09-05 08:21:01 +02:00
1 parent 6817fa739e
commit 8b883c88fc
6 files changed
+87 -46

No files matched your search

@@ -82,7 +82,7 @@ public class PlaylistChooserDialog extends DialogFragment {
playlistDialogHorizontalAdapter = new PlaylistDialogHorizontalAdapter(requireContext(), playlistChooserViewModel, this);
bind.playlistDialogRecyclerView.setAdapter(playlistDialogHorizontalAdapter);
playlistChooserViewModel.getPlaylistList().observe(getViewLifecycleOwner(), playlists -> {
playlistChooserViewModel.getPlaylistList(getViewLifecycleOwner()).observe(getViewLifecycleOwner(), playlists -> {
if (playlists != null) {
if (playlists.size() > 0) {
if (bind != null) bind.noPlaylistsCreatedTextView.setVisibility(View.GONE);