File tree Expand file tree Collapse file tree
java/org/schabi/newpipe/info_list Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ dependencies {
180180/* * NewPipe libraries **/
181181 // You can use a local version by uncommenting a few lines in settings.gradle
182182 implementation ' com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
183- implementation ' com.github.TeamNewPipe:NewPipeExtractor:55e0f8e725e45f06513d43875fee6644ea9a8066 '
183+ implementation ' com.github.TeamNewPipe:NewPipeExtractor:82d11386df42567959d6afc35a856fb9ee1e1327 '
184184
185185/* * Checkstyle **/
186186 checkstyle " com.puppycrawl.tools:checkstyle:${ checkstyleVersion} "
Original file line number Diff line number Diff line change 11package org.schabi.newpipe.info_list
22
3+ import android.view.View
34import android.widget.ImageView
45import android.widget.TextView
56import com.nostra13.universalimageloader.core.ImageLoader
@@ -29,6 +30,17 @@ class StreamSegmentItem(
2930 )
3031 }
3132 viewHolder.root.findViewById<TextView >(R .id.textViewTitle).text = item.title
33+ if (item.channelName == null ) {
34+ viewHolder.root.findViewById<TextView >(R .id.textViewChannel).visibility = View .GONE
35+ // When the channel name is displayed there is less space
36+ // and thus the segment title needs to be only one line height.
37+ // But when there is no channel name displayed, the title can be two lines long.
38+ // The default maxLines value is set to 1 to display all elements in the AS preview,
39+ viewHolder.root.findViewById<TextView >(R .id.textViewTitle).maxLines = 2
40+ } else {
41+ viewHolder.root.findViewById<TextView >(R .id.textViewChannel).text = item.channelName
42+ viewHolder.root.findViewById<TextView >(R .id.textViewChannel).visibility = View .VISIBLE
43+ }
3244 viewHolder.root.findViewById<TextView >(R .id.textViewStartSeconds).text =
3345 Localization .getDurationString(item.startTimeSeconds.toLong())
3446 viewHolder.root.setOnClickListener { onClick.onItemClick(this , item.startTimeSeconds) }
Original file line number Diff line number Diff line change 4141 android : layout_width =" match_parent"
4242 android : layout_height =" wrap_content"
4343 android : ellipsize =" end"
44- android : maxLines =" 2 "
44+ android : maxLines =" 1 "
4545 android : textAppearance =" @style/PlayQueueItemTitle"
4646 android : textSize =" @dimen/video_item_search_title_text_size"
47- app : layout_constraintStart_toStartOf =" parent"
48- app : layout_constraintTop_toTopOf =" parent"
4947 tools : text =" Lorem ipusum is widely used to create long sample text which is used here too" />
5048
49+ <TextView
50+ android : id =" @+id/textViewChannel"
51+ android : layout_width =" match_parent"
52+ android : layout_height =" wrap_content"
53+ android : ellipsize =" end"
54+ android : maxLines =" 1"
55+ android : textAppearance =" @style/PlayQueueItemSubtitle"
56+ android : textSize =" @dimen/video_item_search_title_text_size"
57+
58+ tools : text =" Lorem ipsum creator" />
59+
5160 <TextView
5261 android : id =" @+id/textViewStartSeconds"
5362 android : layout_width =" match_parent"
5463 android : layout_height =" wrap_content"
5564 android : layout_marginTop =" 2dp"
5665 android : textAppearance =" @style/PlayQueueItemSubtitle"
5766 android : textSize =" @dimen/video_item_search_upload_date_text_size"
58- app : layout_constraintStart_toStartOf =" parent"
59- app : layout_constraintTop_toBottomOf =" @id/textViewTitle"
6067 tools : text =" 04:26" />
6168
6269 </LinearLayout >
You can’t perform that action at this time.
0 commit comments