mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
commit
fbc9faab32
@ -70,7 +70,13 @@ class SearchViewHolder(
|
||||
val thumbnailImage = v.findViewById<ImageView>(R.id.search_thumbnail)
|
||||
Picasso.get().load(item.thumbnail).fit().centerCrop().into(thumbnailImage)
|
||||
val thumbnailDuration = v.findViewById<TextView>(R.id.search_thumbnail_duration)
|
||||
thumbnailDuration.text = DateUtils.formatElapsedTime(item.duration!!)
|
||||
val itemDuration = DateUtils.formatElapsedTime(item.duration!!)
|
||||
if (itemDuration != "00:-1") {
|
||||
thumbnailDuration.text = itemDuration
|
||||
} else {
|
||||
thumbnailDuration.text = v.context.getString(R.string.live)
|
||||
thumbnailDuration.setBackgroundColor(R.attr.colorPrimaryDark)
|
||||
}
|
||||
val channelImage = v.findViewById<ImageView>(R.id.search_channel_image)
|
||||
Picasso.get().load(item.uploaderAvatar).fit().centerCrop().into(channelImage)
|
||||
val title = v.findViewById<TextView>(R.id.search_description)
|
||||
|
@ -53,8 +53,14 @@ class SubscriptionAdapter(
|
||||
trending.views.formatShort() + " • " +
|
||||
DateUtils.getRelativeTimeSpanString(trending.uploaded!!)
|
||||
val thumbnailImage = holder.v.findViewById<ImageView>(R.id.thumbnail)
|
||||
holder.v.findViewById<TextView>(R.id.thumbnail_duration).text =
|
||||
DateUtils.formatElapsedTime(trending.duration!!)
|
||||
val thumbnailDuration = holder.v.findViewById<TextView>(R.id.thumbnail_duration)
|
||||
val itemDuration = DateUtils.formatElapsedTime(trending.duration!!)
|
||||
if (itemDuration != "00:-1") {
|
||||
thumbnailDuration.text = itemDuration
|
||||
} else {
|
||||
thumbnailDuration.text = holder.v.context.getString(R.string.live)
|
||||
thumbnailDuration.setBackgroundColor(R.attr.colorPrimaryDark)
|
||||
}
|
||||
val channelImage = holder.v.findViewById<ImageView>(R.id.channel_image)
|
||||
channelImage.setOnClickListener {
|
||||
val activity = holder.v.context as MainActivity
|
||||
|
@ -42,8 +42,14 @@ class TrendingAdapter(
|
||||
trending.views.formatShort() + " • " +
|
||||
DateUtils.getRelativeTimeSpanString(trending.uploaded!!)
|
||||
val thumbnailImage = holder.v.findViewById<ImageView>(R.id.thumbnail)
|
||||
holder.v.findViewById<TextView>(R.id.thumbnail_duration).text =
|
||||
DateUtils.formatElapsedTime(trending.duration!!)
|
||||
val thumbnailDuration = holder.v.findViewById<TextView>(R.id.thumbnail_duration)
|
||||
val itemDuration = DateUtils.formatElapsedTime(trending.duration!!)
|
||||
if (itemDuration != "00:-1") {
|
||||
thumbnailDuration.text = itemDuration
|
||||
} else {
|
||||
thumbnailDuration.text = holder.v.context.getString(R.string.live)
|
||||
thumbnailDuration.setBackgroundColor(R.attr.colorPrimaryDark)
|
||||
}
|
||||
val channelImage = holder.v.findViewById<ImageView>(R.id.channel_image)
|
||||
channelImage.setOnClickListener {
|
||||
val activity = holder.v.context as MainActivity
|
||||
|
@ -140,4 +140,5 @@
|
||||
<string name="player">Player</string>
|
||||
<string name="appearance_summary">Make the app look how you want to.</string>
|
||||
<string name="advanced_summary">Player, Downloads, History</string>
|
||||
<string name="live">Live</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user