Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for playlist descriptions #3818

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/java/com/github/libretube/api/obj/Playlist.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class Playlist(
val name: String? = null,
var description: String? = null,
val thumbnailUrl: String? = null,
val bannerUrl: String? = null,
val nextpage: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ class PlaylistFragment : Fragment() {
}

binding.playlistInfo.text = getChannelAndVideoString(response, response.videos)
binding.playlistDescription.text = response.description

binding.playlistDescription.let { textView ->
textView.setOnClickListener {
textView.maxLines = if (textView.maxLines == Int.MAX_VALUE) 3 else Int.MAX_VALUE
}
}

showPlaylistVideos(response)

Expand Down
27 changes: 22 additions & 5 deletions app/src/main/res/layout/fragment_playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:paddingHorizontal="15dp">
android:orientation="horizontal">

<TextView
android:id="@+id/playlist_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:background="@drawable/rounded_ripple"
android:ellipsize="end"
android:maxLines="2"
android:paddingHorizontal="5dp"
android:paddingVertical="2dp"
android:textSize="20sp"
android:textStyle="bold" />

Expand All @@ -59,15 +61,17 @@
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_sort"
android:visibility="gone"/>
android:visibility="gone" />

<ImageView
android:id="@+id/optionsMenu"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:layout_marginEnd="20dp"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_three_dots" />

</LinearLayout>
Expand All @@ -77,9 +81,22 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="15dp"
android:paddingVertical="8dp"
android:paddingBottom="5dp"
android:textStyle="bold" />

<TextView
android:id="@+id/playlistDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="5dp"
android:autoLink="web"
android:background="@drawable/rounded_ripple"
android:ellipsize="end"
android:maxLines="3"
android:paddingHorizontal="10dp"
android:paddingTop="5dp"
android:paddingBottom="10dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down