Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
536
Issue boards
Milestones
Wiki
Code
Merge requests
19
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
1963d431
Commit
1963d431
authored
2 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Accessibility: video player update shuffle/repeat content descriptions
parent
fb1b6f09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1377
Improve accessibility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+11
-0
11 additions, 0 deletions
...src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
with
11 additions
and
0 deletions
application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+
11
−
0
View file @
1963d431
...
...
@@ -281,29 +281,35 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
PlaybackStateCompat
.
REPEAT_MODE_NONE
->
{
repeatBinding
.
optionIcon
.
setImageResource
(
R
.
drawable
.
ic_repeat_one
)
service
.
repeatType
=
PlaybackStateCompat
.
REPEAT_MODE_ONE
repeatBinding
.
root
.
contentDescription
=
repeatBinding
.
root
.
context
.
getString
(
R
.
string
.
repeat_single
)
}
PlaybackStateCompat
.
REPEAT_MODE_ONE
->
if
(
service
.
hasPlaylist
())
{
repeatBinding
.
optionIcon
.
setImageResource
(
R
.
drawable
.
ic_repeat_all
)
service
.
repeatType
=
PlaybackStateCompat
.
REPEAT_MODE_ALL
repeatBinding
.
root
.
contentDescription
=
repeatBinding
.
root
.
context
.
getString
(
R
.
string
.
repeat_all
)
}
else
{
repeatBinding
.
optionIcon
.
setImageResource
(
R
.
drawable
.
ic_repeat
)
service
.
repeatType
=
PlaybackStateCompat
.
REPEAT_MODE_NONE
repeatBinding
.
root
.
contentDescription
=
repeatBinding
.
root
.
context
.
getString
(
R
.
string
.
repeat
)
}
PlaybackStateCompat
.
REPEAT_MODE_ALL
->
{
repeatBinding
.
optionIcon
.
setImageResource
(
R
.
drawable
.
ic_repeat
)
service
.
repeatType
=
PlaybackStateCompat
.
REPEAT_MODE_NONE
repeatBinding
.
root
.
contentDescription
=
repeatBinding
.
root
.
context
.
getString
(
R
.
string
.
repeat
)
}
}
}
private
fun
setShuffle
()
{
shuffleBinding
.
optionIcon
.
setImageResource
(
if
(
service
.
isShuffling
)
R
.
drawable
.
ic_shuffle_on_48dp
else
R
.
drawable
.
ic_shuffle
)
shuffleBinding
.
root
.
contentDescription
=
shuffleBinding
.
root
.
context
.
getString
(
if
(
service
.
isShuffling
)
R
.
string
.
shuffle_on
else
R
.
string
.
shuffle
)
}
private
fun
initShuffle
(
binding
:
PlayerOptionItemBinding
)
{
shuffleBinding
=
binding
AppScope
.
launch
(
Dispatchers
.
Main
)
{
shuffleBinding
.
optionIcon
.
setImageResource
(
if
(
service
.
isShuffling
)
R
.
drawable
.
ic_shuffle_on_48dp
else
R
.
drawable
.
ic_shuffle
)
shuffleBinding
.
root
.
contentDescription
=
shuffleBinding
.
root
.
context
.
getString
(
if
(
service
.
isShuffling
)
R
.
string
.
shuffle_on
else
R
.
string
.
shuffle
)
}
}
...
...
@@ -315,6 +321,11 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
PlaybackStateCompat
.
REPEAT_MODE_ALL
->
R
.
drawable
.
ic_repeat_all
else
->
R
.
drawable
.
ic_repeat
})
repeatBinding
.
root
.
contentDescription
=
repeatBinding
.
root
.
context
.
getString
(
when
(
service
.
repeatType
)
{
PlaybackStateCompat
.
REPEAT_MODE_ONE
->
R
.
string
.
repeat_single
PlaybackStateCompat
.
REPEAT_MODE_ALL
->
R
.
string
.
repeat_all
else
->
R
.
string
.
repeat
})
}
}
...
...
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