Dynamically added views of pinned playlists to the homepage

This commit is contained in:
CappielloAntonio 2021-11-26 15:57:36 +01:00
parent e2f1212e58
commit 72712d6feb
7 changed files with 195 additions and 14 deletions

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView
android:id="@+id/generic_playlist_title_text_view"
style="@style/HeadlineTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="@string/label_placeholder" />
<TextView
android:id="@+id/generic_playlist_text_view_clickable"
style="@style/SubheadTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="@string/generic_playlist_see_all_button" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/generic_playlist_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingTop="8dp"
android:paddingBottom="8dp" />
</LinearLayout>

View file

@ -14,16 +14,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/for_you_image_view"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:background="@drawable/ic_shuffle"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/track_cover_image_view"
app:layout_constraintStart_toStartOf="parent"/>
<TextView
android:id="@+id/title_track_label"
style="@style/ItemTitleTextView"
@ -32,9 +22,8 @@
android:ellipsize="end"
android:maxLines="2"
android:paddingTop="8dp"
android:paddingLeft="4dp"
android:singleLine="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/for_you_image_view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/track_cover_image_view" />
</androidx.constraintlayout.widget.ConstraintLayout>