Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
15
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
a6bb8875
Commit
a6bb8875
authored
6 months ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Fine tune the chapter navigation
parent
28f60942
No related branches found
No related tags found
1 merge request
!1957
Navigate between chapters in the audio player
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+12
-3
12 additions, 3 deletions
...vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
with
12 additions
and
3 deletions
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+
12
−
3
View file @
a6bb8875
...
...
@@ -31,6 +31,7 @@ import android.support.v4.media.session.PlaybackStateCompat
import
android.text.Editable
import
android.text.TextWatcher
import
android.text.format.DateFormat
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.MotionEvent
import
android.view.View
...
...
@@ -930,9 +931,17 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
}
currentChapters
?.
second
?.
let
{
chapters
->
playlistModel
.
service
!!
.
chapterIdx
=
playlistModel
.
service
!!
.
chapterIdx
.
plus
(
if
(
next
)
1
else
-
1
)
.
coerceIn
(
0
,
chapters
.
size
-
1
)
playlistModel
.
service
?.
let
{
service
->
val
chapterIdx
=
playlistModel
.
service
!!
.
chapterIdx
if
(!
next
)
{
val
chapter
=
chapters
[
service
.
chapterIdx
]
if
(
chapter
.
timeOffset
+
5000
>
service
.
getTime
())
playlistModel
.
service
!!
.
chapterIdx
=
chapterIdx
.
plus
(-
1
).
coerceAtLeast
(
0
)
else
playlistModel
.
service
!!
.
chapterIdx
=
chapterIdx
}
else
if
(
chapterIdx
!=
chapters
.
size
-
1
)
playlistModel
.
service
!!
.
chapterIdx
=
chapterIdx
.
plus
(
1
).
coerceAtMost
(
chapters
.
size
-
1
)
}
}
}
}
...
...
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