mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-05 03:21:39 +00:00
Implementation of playlist catalog recovery
This commit is contained in:
parent
98ffec9b72
commit
95bcbb0f61
4 changed files with 45 additions and 24 deletions
|
|
@ -24,6 +24,7 @@ import com.cappielloantonio.play.R;
|
|||
import com.cappielloantonio.play.adapter.PlaylistCatalogueAdapter;
|
||||
import com.cappielloantonio.play.databinding.FragmentPlaylistCatalogueBinding;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.viewmodel.ArtistCatalogueViewModel;
|
||||
import com.cappielloantonio.play.viewmodel.PlaylistCatalogueViewModel;
|
||||
|
||||
public class PlaylistCatalogueFragment extends Fragment {
|
||||
|
|
@ -39,6 +40,8 @@ public class PlaylistCatalogueFragment extends Fragment {
|
|||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -47,7 +50,6 @@ public class PlaylistCatalogueFragment extends Fragment {
|
|||
|
||||
bind = FragmentPlaylistCatalogueBinding.inflate(inflater, container, false);
|
||||
View view = bind.getRoot();
|
||||
playlistCatalogueViewModel = new ViewModelProvider(requireActivity()).get(PlaylistCatalogueViewModel.class);
|
||||
|
||||
initAppBar();
|
||||
initArtistCatalogueView();
|
||||
|
|
@ -67,6 +69,11 @@ public class PlaylistCatalogueFragment extends Fragment {
|
|||
bind = null;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
playlistCatalogueViewModel = new ViewModelProvider(requireActivity()).get(PlaylistCatalogueViewModel.class);
|
||||
playlistCatalogueViewModel.loadPlaylists(requireContext());
|
||||
}
|
||||
|
||||
private void initAppBar() {
|
||||
activity.setSupportActionBar(bind.toolbar);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue