Add album page

This commit is contained in:
Antonio Cappiello 2020-11-23 09:28:20 +01:00
parent c2be2711b9
commit b2c269a051
18 changed files with 334 additions and 68 deletions

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:backgroundTint="@color/cardColor"
app:layout_constraintDimensionRatio="W, 4:5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/album_title_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:textColor="@color/titleTextColor"
android:textSize="40sp"
android:textStyle="bold"
android:textAlignment="center"
android:textFontWeight="900"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Label and button -->
<TextView
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="Song"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/song_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="54dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -29,14 +29,17 @@
android:layout_height="match_parent">
<TextView
android:id="@+id/artist_name_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:text="Green Day"
android:textColor="@color/titleTextColor"
android:textSize="40sp"
android:textStyle="bold"
android:textAlignment="center"
android:textFontWeight="900"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -115,6 +118,6 @@
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
android:paddingBottom="54dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -1,19 +1,18 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingEnd="4dp">
android:paddingEnd="4dp"
android:paddingBottom="2dp">
<androidx.cardview.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/imageView"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="2dp"
android:layout_gravity="center"
android:layout_margin="2dp"
android:backgroundTint="@color/cardColor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -22,36 +21,41 @@
card_view:cardCornerRadius="4dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="false"/>
card_view:cardUseCompatPadding="false" />
<TextView
android:id="@+id/search_result_song_title_text_view"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="12dp"
android:paddingTop="4dp"
android:text="@string/label_placeholder"
android:textColor="@color/titleTextColor"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/search_result_song_artist_text_view"/>
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<TextView
android:id="@+id/search_result_song_artist_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="12dp"
android:paddingBottom="4dp"
android:text="@string/label_placeholder"
android:textColor="@color/subtitleTextColor"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toBottomOf="@+id/search_result_song_title_text_view" />
<TextView
android:id="@+id/search_result_song_title_text_view"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:ellipsize="end"
android:fontFamily="@font/open_sans_font_family"
android:maxLines="1"
android:paddingStart="12dp"
android:paddingTop="8dp"
android:paddingEnd="12dp"
android:text="@string/label_placeholder"
android:textColor="@color/titleTextColor"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/search_result_song_artist_text_view"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="12dp"
android:text="@string/label_placeholder"
android:textColor="@color/subtitleTextColor"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/search_result_song_duration_text_view"
@ -60,10 +64,11 @@
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:gravity="center_vertical"
android:text="@string/label_placeholder"
android:textColor="@color/subtitleTextColor"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View file

@ -83,11 +83,10 @@
app:destination="@id/genreCatalogueFragment" />
<action
android:id="@+id/action_libraryFragment_to_artistPageFragment"
app:destination="@id/artistPageFragment">
<argument
android:name="artistID"
app:argType="string"/>
</action>
app:destination="@id/artistPageFragment"/>
<action
android:id="@+id/action_libraryFragment_to_albumPageFragment"
app:destination="@id/albumPageFragment" />
</fragment>
<fragment
android:id="@+id/settingsFragment"
@ -104,11 +103,10 @@
app:destination="@id/filterFragment" />
<action
android:id="@+id/action_searchFragment_to_artistPageFragment"
app:destination="@id/artistPageFragment">
<argument
android:name="artistID"
app:argType="string"/>
</action>
app:destination="@id/artistPageFragment"/>
<action
android:id="@+id/action_searchFragment_to_albumPageFragment"
app:destination="@id/albumPageFragment" />
</fragment>
<fragment
android:id="@+id/filterFragment"
@ -122,17 +120,17 @@
tools:layout="@layout/fragment_artist_catalogue">
<action
android:id="@+id/action_artistCatalogueFragment_to_artistPageFragment"
app:destination="@id/artistPageFragment">
<argument
android:name="artistID"
app:argType="string"/>
</action>
app:destination="@id/artistPageFragment"/>
</fragment>
<fragment
android:id="@+id/albumCatalogueFragment"
android:name="com.cappielloantonio.play.ui.fragment.AlbumCatalogueFragment"
android:label="AlbumCatalogueFragment"
tools:layout="@layout/fragment_album_catalogue"/>
tools:layout="@layout/fragment_album_catalogue">
<action
android:id="@+id/action_albumCatalogueFragment_to_albumPageFragment"
app:destination="@id/albumPageFragment" />
</fragment>
<fragment
android:id="@+id/genreCatalogueFragment"
android:name="com.cappielloantonio.play.ui.fragment.GenreCatalogueFragment"
@ -143,5 +141,14 @@
android:id="@+id/artistPageFragment"
android:name="com.cappielloantonio.play.ui.fragment.ArtistPageFragment"
android:label="ArtistPageFragment"
tools:layout="@layout/fragment_artist_page"/>
tools:layout="@layout/fragment_artist_page">
<action
android:id="@+id/action_artistPageFragment_to_albumPageFragment"
app:destination="@id/albumPageFragment" />
</fragment>
<fragment
android:id="@+id/albumPageFragment"
android:name="com.cappielloantonio.play.ui.fragment.AlbumPageFragment"
android:label="AlbumPageFragment"
tools:layout="@layout/fragment_album_page"/>
</navigation>