mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-03 19:01:39 +00:00
Implemented songs division by decades
This commit is contained in:
parent
bc51b0c9ca
commit
491fa4de3e
11 changed files with 112 additions and 54 deletions
|
|
@ -179,13 +179,10 @@ public class HomeFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void initYearSongView() {
|
||||
if (bind != null)
|
||||
bind.homeFlashbackSector.setVisibility(!homeViewModel.getYearList().isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
bind.yearsRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
bind.yearsRecyclerView.setHasFixedSize(true);
|
||||
|
||||
yearAdapter = new YearAdapter(requireContext(), homeViewModel.getYearList());
|
||||
yearAdapter = new YearAdapter(requireContext());
|
||||
yearAdapter.setClickListener((view, position) -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_YEAR, Song.BY_YEAR);
|
||||
|
|
@ -193,6 +190,10 @@ public class HomeFragment extends Fragment {
|
|||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
bind.yearsRecyclerView.setAdapter(yearAdapter);
|
||||
homeViewModel.getYearList().observe(requireActivity(), years -> {
|
||||
if (bind != null) bind.homeFlashbackSector.setVisibility(!years.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
yearAdapter.setItems(years);
|
||||
});
|
||||
}
|
||||
|
||||
private void initStarredTracksView() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue