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
13
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
5d47b500
Commit
5d47b500
authored
5 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix IllegalStateException in AudioPlayer
parent
70567f48
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+8
-5
8 additions, 5 deletions
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
with
8 additions
and
5 deletions
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+
8
−
5
View file @
5d47b500
...
...
@@ -227,8 +227,9 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, CoroutineS
private
var
wasPlaying
=
true
private
fun
updatePlayPause
()
{
val
ctx
=
context
?:
return
val
playing
=
playlistModel
.
playing
val
text
=
getString
(
if
(
playing
)
R
.
string
.
pause
else
R
.
string
.
play
)
val
text
=
ctx
.
getString
(
if
(
playing
)
R
.
string
.
pause
else
R
.
string
.
play
)
val
drawable
=
if
(
playing
)
playToPause
else
pauseToPlay
val
drawableSmall
=
if
(
playing
)
playToPauseSmall
else
pauseToPlaySmall
...
...
@@ -247,30 +248,32 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, CoroutineS
private
var
wasShuffling
=
false
private
fun
updateShuffleMode
()
{
val
ctx
=
context
?:
return
binding
.
shuffle
.
visibility
=
if
(
playlistModel
.
canShuffle
)
View
.
VISIBLE
else
View
.
INVISIBLE
val
shuffling
=
playlistModel
.
shuffling
if
(
wasShuffling
==
shuffling
)
return
binding
.
shuffle
.
setImageResource
(
if
(
shuffling
)
R
.
drawable
.
ic_shuffle_on
else
R
.
drawable
.
ic_shuffle
)
binding
.
shuffle
.
contentDescription
=
resources
.
getString
(
if
(
shuffling
)
R
.
string
.
shuffle_on
else
R
.
string
.
shuffle
)
binding
.
shuffle
.
contentDescription
=
ctx
.
getString
(
if
(
shuffling
)
R
.
string
.
shuffle_on
else
R
.
string
.
shuffle
)
wasShuffling
=
shuffling
}
private
var
previousRepeatType
=
-
1
private
fun
updateRepeatMode
()
{
val
ctx
=
context
?:
return
val
repeatType
=
playlistModel
.
repeatType
if
(
previousRepeatType
==
repeatType
)
return
when
(
repeatType
)
{
REPEAT_ONE
->
{
binding
.
repeat
.
setImageResource
(
R
.
drawable
.
ic_repeat_one
)
binding
.
repeat
.
contentDescription
=
resources
.
getString
(
R
.
string
.
repeat_single
)
binding
.
repeat
.
contentDescription
=
ctx
.
getString
(
R
.
string
.
repeat_single
)
}
REPEAT_ALL
->
{
binding
.
repeat
.
setImageResource
(
R
.
drawable
.
ic_repeat_all
)
binding
.
repeat
.
contentDescription
=
resources
.
getString
(
R
.
string
.
repeat_all
)
binding
.
repeat
.
contentDescription
=
ctx
.
getString
(
R
.
string
.
repeat_all
)
}
else
->
{
binding
.
repeat
.
setImageResource
(
R
.
drawable
.
ic_repeat
)
binding
.
repeat
.
contentDescription
=
resources
.
getString
(
R
.
string
.
repeat
)
binding
.
repeat
.
contentDescription
=
ctx
.
getString
(
R
.
string
.
repeat
)
}
}
previousRepeatType
=
repeatType
...
...
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