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

[Bandcamp] Add Radio stream segments #6051

Merged
merged 1 commit into from
Apr 19, 2021
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
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ dependencies {
/** NewPipe libraries **/
// You can use a local version by uncommenting a few lines in settings.gradle
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:55e0f8e725e45f06513d43875fee6644ea9a8066'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:82d11386df42567959d6afc35a856fb9ee1e1327'

/** Checkstyle **/
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.schabi.newpipe.info_list

import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.nostra13.universalimageloader.core.ImageLoader
Expand Down Expand Up @@ -29,6 +30,17 @@ class StreamSegmentItem(
)
}
viewHolder.root.findViewById<TextView>(R.id.textViewTitle).text = item.title
if (item.channelName == null) {
viewHolder.root.findViewById<TextView>(R.id.textViewChannel).visibility = View.GONE
TobiGr marked this conversation as resolved.
Show resolved Hide resolved
// When the channel name is displayed there is less space
// and thus the segment title needs to be only one line height.
// But when there is no channel name displayed, the title can be two lines long.
// The default maxLines value is set to 1 to display all elements in the AS preview,
viewHolder.root.findViewById<TextView>(R.id.textViewTitle).maxLines = 2
} else {
viewHolder.root.findViewById<TextView>(R.id.textViewChannel).text = item.channelName
viewHolder.root.findViewById<TextView>(R.id.textViewChannel).visibility = View.VISIBLE
}
viewHolder.root.findViewById<TextView>(R.id.textViewStartSeconds).text =
Localization.getDurationString(item.startTimeSeconds.toLong())
viewHolder.root.setOnClickListener { onClick.onItemClick(this, item.startTimeSeconds) }
Expand Down
17 changes: 12 additions & 5 deletions app/src/main/res/layout/item_stream_segment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,29 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:maxLines="1"
android:textAppearance="@style/PlayQueueItemTitle"
android:textSize="@dimen/video_item_search_title_text_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Lorem ipusum is widely used to create long sample text which is used here too" />
TobiGr marked this conversation as resolved.
Show resolved Hide resolved

<TextView
android:id="@+id/textViewChannel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/PlayQueueItemSubtitle"
android:textSize="@dimen/video_item_search_title_text_size"

tools:text="Lorem ipsum creator" />

<TextView
android:id="@+id/textViewStartSeconds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="@style/PlayQueueItemSubtitle"
android:textSize="@dimen/video_item_search_upload_date_text_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
tools:text="04:26" />

</LinearLayout>
Expand Down