Add playlist catalogue page and item

This commit is contained in:
CappielloAntonio 2021-04-20 15:59:21 +02:00
parent 717986ea2c
commit ee8509032a
15 changed files with 411 additions and 60 deletions

View file

@ -238,6 +238,7 @@
<TextView
android:id="@+id/playlist_catalogue_text_view_clickable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
@ -250,16 +251,13 @@
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playlist_recycler_view"
<!-- slideview -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/playlist_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_height="212dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="10dp"
android:paddingBottom="8dp" />
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Label and button -->
<TextView
android:id="@+id/playlist_catalogue_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="16dp"
android:paddingTop="20dp"
android:paddingEnd="16dp"
android:text="Playlist Catalogue"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playlist_catalogue_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="@dimen/global_padding_bottom"
android:layout_below="@+id/playlist_catalogue_label"/>
</RelativeLayout>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/playlist_card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:backgroundTint="@color/cardColor"
app:cardCornerRadius="4dp">
<ImageView
android:id="@+id/playlist_cover_image_view"
android:layout_width="match_parent"
android:layout_height="196dp" />
<View
android:layout_width="match_parent"
android:layout_height="196dp"
android:background="@drawable/gradient_discover_background_image" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="196dp">
<TextView
android:id="@+id/playlist_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="18dp"
android:layout_marginRight="16dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/gradientTitleColor"
android:textSize="20sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>

View file

@ -1,37 +1,42 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/playlist_card_view"
android:layout_width="match_parent"
android:layout_height="96dp"
android:paddingTop="4dp"
android:paddingEnd="4dp">
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:backgroundTint="@color/cardColor"
app:cardCornerRadius="4dp">
<androidx.cardview.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
<ImageView
android:id="@+id/playlist_cover_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:backgroundTint="@color/cardColor"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="true">
android:layout_height="196dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="match_parent"
android:layout_height="196dp"
android:background="@drawable/gradient_discover_background_image" />
<TextView
android:id="@+id/playlist_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="18dp"
android:fontFamily="@font/open_sans_font_family"
android:text="@string/label_placeholder"
android:textColor="@color/titleTextColor"
android:textSize="16sp"
android:textStyle="bold"
android:textAlignment="center"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="196dp">
<TextView
android:id="@+id/playlist_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="18dp"
android:layout_marginRight="16dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/gradientTitleColor"
android:textSize="20sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>

View file

@ -89,6 +89,9 @@
<action
android:id="@+id/action_libraryFragment_to_genreCatalogueFragment"
app:destination="@id/genreCatalogueFragment" />
<action
android:id="@+id/action_libraryFragment_to_playlistCatalogueFragment"
app:destination="@id/playlistCatalogueFragment" />
<action
android:id="@+id/action_libraryFragment_to_artistPageFragment"
app:destination="@id/artistPageFragment"/>
@ -172,6 +175,15 @@
android:id="@+id/action_genreCatalogueFragment_to_filterFragment"
app:destination="@id/filterFragment" />
</fragment>
<fragment
android:id="@+id/playlistCatalogueFragment"
android:name="com.cappielloantonio.play.ui.fragment.PlaylistCatalogueFragment"
android:label="PlaylistCatalogueFragment"
tools:layout="@layout/fragment_playlist_catalogue">
<action
android:id="@+id/action_playlistCatalogueFragment_to_playlistPageFragment"
app:destination="@id/playlistPageFragment" />
</fragment>
<fragment
android:id="@+id/artistPageFragment"