mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Added For You top bar
This commit is contained in:
parent
81581c623d
commit
fdc104f70b
6 changed files with 89 additions and 5 deletions
|
|
@ -23,6 +23,7 @@ import com.cappielloantonio.play.adapter.YearAdapter;
|
|||
import com.cappielloantonio.play.databinding.FragmentHomeBinding;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.Util;
|
||||
import com.cappielloantonio.play.viewmodel.HomeViewModel;
|
||||
|
||||
public class HomeFragment extends Fragment {
|
||||
|
|
@ -50,6 +51,7 @@ public class HomeFragment extends Fragment {
|
|||
homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class);
|
||||
|
||||
init();
|
||||
initForYouBar();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
@ -112,6 +114,12 @@ public class HomeFragment extends Fragment {
|
|||
});
|
||||
}
|
||||
|
||||
private void initForYouBar() {
|
||||
bind.homeDateLabel.setText(Util.getDate());
|
||||
|
||||
bind.homeSettingsImageView.setOnClickListener(v -> activity.navController.navigate(R.id.action_homeFragment_to_settingsFragment));
|
||||
}
|
||||
|
||||
private void initDiscoverSongSlideView() {
|
||||
bind.discoverSongViewPager.setOrientation(ViewPager2.ORIENTATION_HORIZONTAL);
|
||||
|
||||
|
|
@ -221,6 +229,7 @@ public class HomeFragment extends Fragment {
|
|||
public void reorder() {
|
||||
if(bind != null) {
|
||||
bind.homeLinearLayoutContainer.removeAllViews();
|
||||
bind.homeLinearLayoutContainer.addView(bind.forYouSector);
|
||||
bind.homeLinearLayoutContainer.addView(bind.homeDiscoverSector);
|
||||
bind.homeLinearLayoutContainer.addView(bind.homeRecentlyAddedTracksSector);
|
||||
bind.homeLinearLayoutContainer.addView(bind.homeFlashbackSector);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue