mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 07:03:35 +00:00
Added For You top bar
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user