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
4936fbe2
Commit
4936fbe2
authored
6 months ago
by
Robert Stone
Committed by
Duncan McNamara
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Display repeat control (if enabled) during podcast mode
parent
89060009
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1980
Aar release 3.6.0-eap13, 4.0.0-eap16, 0.13.13-rc13, and 0.13.13-vlc4-rc13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+21
-26
21 additions, 26 deletions
...ation/vlc-android/src/org/videolan/vlc/PlaybackService.kt
with
21 additions
and
26 deletions
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+
21
−
26
View file @
4936fbe2
...
...
@@ -1256,20 +1256,11 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner, CoroutineSc
when
{
podcastMode
->
{
addCustomSeekActions
(
pscb
)
addCustomSpeedActions
(
pscb
)
manageAutoActions
(
actions
,
pscb
,
repeatType
,
true
)
pscb
.
addCustomAction
(
CUSTOM_ACTION_BOOKMARK
,
getString
(
R
.
string
.
add_bookmark
),
R
.
drawable
.
ic_bookmark_add
)
}
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
TIRAMISU
->
{
if
(!
isCarMode
())
{
addCustomSeekActions
(
pscb
)
}
else
{
manageAutoActions
(
actions
,
pscb
,
repeatType
)
}
}
else
->
{
manageAutoActions
(
actions
,
pscb
,
repeatType
)
}
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
TIRAMISU
&&
!
isCarMode
()
->
addCustomSeekActions
(
pscb
)
else
->
manageAutoActions
(
actions
,
pscb
,
repeatType
)
}
pscb
.
setActions
(
actions
.
getCapabilities
())
mediaSession
.
setRepeatMode
(
repeatType
)
...
...
@@ -1298,25 +1289,29 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner, CoroutineSc
}
}
private
fun
manageAutoActions
(
actions
:
FlagSet
<
PlaybackAction
>,
pscb
:
PlaybackStateCompat
.
Builder
,
repeatType
:
Int
)
{
private
fun
manageAutoActions
(
actions
:
FlagSet
<
PlaybackAction
>,
pscb
:
PlaybackStateCompat
.
Builder
,
repeatType
:
Int
,
podcastMode
:
Boolean
=
false
)
{
if
(
playlistManager
.
canRepeat
())
actions
.
add
(
PlaybackAction
.
ACTION_SET_REPEAT_MODE
)
if
(
playlistManager
.
canShuffle
())
actions
.
add
(
PlaybackAction
.
ACTION_SET_SHUFFLE_MODE
)
/* Always add the icons, regardless of the allowed actions */
val
shuffleResId
=
when
{
isShuffling
->
R
.
drawable
.
ic_auto_shuffle_enabled
else
->
R
.
drawable
.
ic_auto_shuffle_disabled
}
pscb
.
addCustomAction
(
CUSTOM_ACTION_SHUFFLE
,
getString
(
R
.
string
.
shuffle_title
),
shuffleResId
)
val
repeatResId
=
when
(
repeatType
)
{
PlaybackStateCompat
.
REPEAT_MODE_ALL
->
R
.
drawable
.
ic_auto_repeat_pressed
PlaybackStateCompat
.
REPEAT_MODE_ONE
->
R
.
drawable
.
ic_auto_repeat_one_pressed
else
->
R
.
drawable
.
ic_auto_repeat_normal
}
pscb
.
addCustomAction
(
CUSTOM_ACTION_REPEAT
,
getString
(
R
.
string
.
repeat_title
),
repeatResId
)
addCustomSpeedActions
(
pscb
,
settings
.
getBoolean
(
ENABLE_ANDROID_AUTO_SPEED_BUTTONS
,
false
))
addCustomSeekActions
(
pscb
,
settings
.
getBoolean
(
ENABLE_ANDROID_AUTO_SEEK_BUTTONS
,
false
))
if
(!
podcastMode
)
{
val
shuffleResId
=
when
{
isShuffling
->
R
.
drawable
.
ic_auto_shuffle_enabled
else
->
R
.
drawable
.
ic_auto_shuffle_disabled
}
pscb
.
addCustomAction
(
CUSTOM_ACTION_SHUFFLE
,
getString
(
R
.
string
.
shuffle_title
),
shuffleResId
)
}
if
(!
podcastMode
||
repeatType
!=
PlaybackStateCompat
.
REPEAT_MODE_NONE
)
{
val
repeatResId
=
when
(
repeatType
)
{
PlaybackStateCompat
.
REPEAT_MODE_ALL
->
R
.
drawable
.
ic_auto_repeat_pressed
PlaybackStateCompat
.
REPEAT_MODE_ONE
->
R
.
drawable
.
ic_auto_repeat_one_pressed
else
->
R
.
drawable
.
ic_auto_repeat_normal
}
pscb
.
addCustomAction
(
CUSTOM_ACTION_REPEAT
,
getString
(
R
.
string
.
repeat_title
),
repeatResId
)
}
addCustomSeekActions
(
pscb
,
podcastMode
or
settings
.
getBoolean
(
ENABLE_ANDROID_AUTO_SEEK_BUTTONS
,
false
))
addCustomSpeedActions
(
pscb
,
podcastMode
or
settings
.
getBoolean
(
ENABLE_ANDROID_AUTO_SPEED_BUTTONS
,
false
))
}
private
fun
addCustomSeekActions
(
pscb
:
PlaybackStateCompat
.
Builder
,
showSeekActions
:
Boolean
=
true
)
{
...
...
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