Merge pull request #6051 from TeamNewPipe/bandcamp_segments
[Bandcamp] Add Radio stream segments
This commit is contained in:
commit
29bcf94d50
3 changed files with 25 additions and 6 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
// 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) }
|
||||
|
|
|
|||
|
|
@ -41,13 +41,22 @@
|
|||
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" />
|
||||
|
||||
<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"
|
||||
|
|
@ -55,8 +64,6 @@
|
|||
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue