mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-17 07:50:15 +00:00
Hide duration if unknown
This commit is contained in:
parent
5ede474253
commit
11992af81b
2 changed files with 15 additions and 3 deletions
|
@ -95,7 +95,13 @@ class VideoListEditorViewHolder : ViewHolder {
|
||||||
.into(_imageThumbnail);
|
.into(_imageThumbnail);
|
||||||
_textName.text = v.name;
|
_textName.text = v.name;
|
||||||
_textAuthor.text = v.author.name;
|
_textAuthor.text = v.author.name;
|
||||||
|
|
||||||
|
if(v.duration > 0) {
|
||||||
_textVideoDuration.text = v.duration.toHumanTime(false);
|
_textVideoDuration.text = v.duration.toHumanTime(false);
|
||||||
|
_textVideoDuration.visibility = View.VISIBLE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_textVideoDuration.visibility = View.GONE;
|
||||||
|
|
||||||
val historyPosition = StateHistory.instance.getHistoryPosition(v.url)
|
val historyPosition = StateHistory.instance.getHistoryPosition(v.url)
|
||||||
_timeBar.progress = historyPosition.toFloat() / v.duration.toFloat();
|
_timeBar.progress = historyPosition.toFloat() / v.duration.toFloat();
|
||||||
|
|
|
@ -204,8 +204,14 @@ open class PreviewVideoView : LinearLayout {
|
||||||
.into(_imageVideo);
|
.into(_imageVideo);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!isPlanned)
|
if(!isPlanned) {
|
||||||
|
if(video.duration > 0) {
|
||||||
_textVideoDuration.text = video.duration.toHumanTime(false);
|
_textVideoDuration.text = video.duration.toHumanTime(false);
|
||||||
|
_textVideoDuration.visibility = View.VISIBLE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_textVideoDuration.visibility = View.GONE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_textVideoDuration.text = context.getString(R.string.planned);
|
_textVideoDuration.text = context.getString(R.string.planned);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue