mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Show/Hide exact view count with description toggle
This commit is contained in:
parent
11d4b86129
commit
0480da9aa0
@ -463,10 +463,20 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
// hide the description and chapters
|
// hide the description and chapters
|
||||||
binding.playerDescriptionArrow.animate().rotation(0F).setDuration(250).start()
|
binding.playerDescriptionArrow.animate().rotation(0F).setDuration(250).start()
|
||||||
binding.descLinLayout.visibility = View.GONE
|
binding.descLinLayout.visibility = View.GONE
|
||||||
|
|
||||||
|
// show formated short view count
|
||||||
|
val viewInfo = context?.getString(R.string.views, streams.views.formatShort()) +
|
||||||
|
if (!isLive) TextUtils.SEPARATOR + streams.uploadDate else ""
|
||||||
|
binding.playerViewsInfo.text = viewInfo
|
||||||
} else {
|
} else {
|
||||||
// show the description and chapters
|
// show the description and chapters
|
||||||
binding.playerDescriptionArrow.animate().rotation(180F).setDuration(250).start()
|
binding.playerDescriptionArrow.animate().rotation(180F).setDuration(250).start()
|
||||||
binding.descLinLayout.visibility = View.VISIBLE
|
binding.descLinLayout.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
// show exact view count
|
||||||
|
val viewInfo = context?.getString(R.string.views, String.format("%,d", streams.views)) +
|
||||||
|
if (!isLive) TextUtils.SEPARATOR + streams.uploadDate else ""
|
||||||
|
binding.playerViewsInfo.text = viewInfo
|
||||||
}
|
}
|
||||||
if (this::chapters.isInitialized && chapters.isNotEmpty()) {
|
if (this::chapters.isInitialized && chapters.isNotEmpty()) {
|
||||||
val chapterIndex = getCurrentChapterIndex()
|
val chapterIndex = getCurrentChapterIndex()
|
||||||
|
Loading…
Reference in New Issue
Block a user