mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Added references to new releases, favorites and a shortcut to genres in the library
This commit is contained in:
parent
ac64ed2fb6
commit
fc71341c73
2 changed files with 127 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
|||
import com.cappielloantonio.play.databinding.FragmentLibraryBinding;
|
||||
import com.cappielloantonio.play.helper.recyclerview.CustomLinearSnapHelper;
|
||||
import com.cappielloantonio.play.helper.recyclerview.DotsIndicatorDecoration;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
|
|
@ -85,6 +86,9 @@ public class LibraryFragment extends Fragment {
|
|||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
initAppBar();
|
||||
initNewReleasesShortcut();
|
||||
initStarredShortcut();
|
||||
initGenresShortcut();
|
||||
initAlbumView();
|
||||
initArtistView();
|
||||
initGenreView();
|
||||
|
|
@ -149,6 +153,26 @@ public class LibraryFragment extends Fragment {
|
|||
Objects.requireNonNull(bind.toolbar.getOverflowIcon()).setTint(requireContext().getResources().getColor(R.color.titleTextColor, null));
|
||||
}
|
||||
|
||||
private void initNewReleasesShortcut() {
|
||||
bind.libraryNewReleasesSector.setOnClickListener(view -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Album.NEW_RELEASES, Album.NEW_RELEASES);
|
||||
activity.navController.navigate(R.id.action_libraryFragment_to_albumListPageFragment, bundle);
|
||||
});
|
||||
}
|
||||
|
||||
private void initStarredShortcut() {
|
||||
bind.libraryStarredSector.setOnClickListener(view -> {
|
||||
activity.navController.navigate(R.id.action_libraryFragment_to_starredFragment);
|
||||
});
|
||||
}
|
||||
|
||||
private void initGenresShortcut() {
|
||||
bind.libraryGenresShortcutSector.setOnClickListener(view -> {
|
||||
activity.navController.navigate(R.id.action_libraryFragment_to_genreCatalogueFragment);
|
||||
});
|
||||
}
|
||||
|
||||
private void initAlbumView() {
|
||||
bind.albumRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
bind.albumRecyclerView.setHasFixedSize(true);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,109 @@
|
|||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/global_padding_bottom">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/library_new_releases_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_insights"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_new_releases"
|
||||
style="@style/TitleLarge"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/library_title_new_releases" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/library_new_releases_navigate_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_navigate_next"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/library_starred_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_star"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_starred"
|
||||
style="@style/TitleLarge"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/library_title_starred" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/library_starred_navigate_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_navigate_next"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/library_genres_shortcut_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_genre"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_genres"
|
||||
style="@style/TitleLarge"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/library_title_genre" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/library_genres_navigate_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_navigate_next"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
style="@style/Divider"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<!-- Album -->
|
||||
<LinearLayout
|
||||
android:id="@+id/library_album_sector"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue