Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
80bfee2a
Commit
80bfee2a
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Fix audio global progress flickering and Locale format
Fixes
#2050
parent
331c979f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1006
Various UI fixes
Pipeline
#106811
passed with stage
in 2 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+16
-11
16 additions, 11 deletions
...vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
with
16 additions
and
11 deletions
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+
16
−
11
View file @
80bfee2a
...
...
@@ -77,7 +77,10 @@ import org.videolan.vlc.util.share
import
org.videolan.vlc.viewmodels.BookmarkModel
import
org.videolan.vlc.viewmodels.PlaybackProgress
import
org.videolan.vlc.viewmodels.PlaylistModel
import
java.text.DateFormat.SHORT
import
java.text.DateFormat.getTimeInstance
import
java.util.*
import
kotlin.math.absoluteValue
private
const
val
TAG
=
"VLC/AudioPlayer"
private
const
val
SEARCH_TIMEOUT_MILLIS
=
10000L
...
...
@@ -106,6 +109,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
private
lateinit
var
abRepeatAddMarker
:
Button
private
var
audioPlayProgressMode
:
Boolean
=
false
private
var
lastEndsAt
=
-
1L
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -377,21 +381,22 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
val
currentProgressText
=
if
(
progressTimeText
.
isNullOrEmpty
())
"0:00"
else
progressTimeText
val
textTrack
=
getString
(
R
.
string
.
track_index
,
"${playlistModel.currentMediaPosition + 1} / ${medias.size}"
)
val
textProgress
=
if
(
audioPlayProgressMode
)
val
textProgress
=
if
(
audioPlayProgressMode
)
{
val
endsAt
=
System
.
currentTimeMillis
()
+
totalTime
-
progressTime
if
((
lastEndsAt
-
endsAt
).
absoluteValue
>
1
)
lastEndsAt
=
endsAt
getString
(
R
.
string
.
audio_queue_progress_finished
,
DateFormat
.
format
(
"hh:mm:ss a"
,
Date
(
System
.
currentTimeMillis
()
+
totalTime
-
progressTime
)
)
getTimeInstance
(
java
.
text
.
DateFormat
.
MEDIUM
).
format
(
lastEndsAt
)
)
else
if
(
showRemainingTime
&&
totalTime
>
0
)
getString
(
R
.
string
.
audio_queue_progress_remaining
,
"$currentProgressText"
}
else
if
(
showRemainingTime
&&
totalTime
>
0
)
getString
(
R
.
string
.
audio_queue_progress_remaining
,
"$currentProgressText"
)
else
getString
(
R
.
string
.
audio_queue_progress
,
if
(
totalTimeText
.
isNullOrEmpty
())
"$currentProgressText"
else
"$currentProgressText / $totalTimeText"
)
else
getString
(
R
.
string
.
audio_queue_progress
,
if
(
totalTimeText
.
isNullOrEmpty
())
"$currentProgressText"
else
"$currentProgressText / $totalTimeText"
)
"$textTrack • $textProgress"
}
binding
.
audioPlayProgress
.
text
=
text
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment