Merge pull request #1268 from Bnyro/master

fix inconsistent label
This commit is contained in:
Bnyro 2022-09-11 17:17:56 +02:00 committed by GitHub
commit bc98131ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,20 +7,8 @@ import com.github.libretube.util.ThemeHelper
fun TextView.setFormattedDuration(duration: Long) { fun TextView.setFormattedDuration(duration: Long) {
val text = if (duration < 0L) { val text = if (duration < 0L) {
this.setBackgroundColor(
ThemeHelper.getThemeColor(
context,
R.attr.colorPrimaryDark
)
)
this.context.getString(R.string.live) this.context.getString(R.string.live)
} else if (duration in 0L..60L) { } else if (duration in 0L..60L) {
this.setBackgroundColor(
ThemeHelper.getThemeColor(
context,
R.attr.colorPrimaryDark
)
)
this.context.getString(R.string.yt_shorts) this.context.getString(R.string.yt_shorts)
} else { } else {
DateUtils.formatElapsedTime(duration) DateUtils.formatElapsedTime(duration)