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
d1923072
Commit
d1923072
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Audioplayer: code cleaning
parent
2c2553a4
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
+12
-13
12 additions, 13 deletions
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
with
12 additions
and
13 deletions
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+
12
−
13
View file @
d1923072
...
...
@@ -54,6 +54,7 @@ import kotlinx.coroutines.experimental.async
import
kotlinx.coroutines.experimental.channels.Channel
import
kotlinx.coroutines.experimental.channels.actor
import
kotlinx.coroutines.experimental.launch
import
kotlinx.coroutines.experimental.withContext
import
org.videolan.libvlc.util.AndroidUtil
import
org.videolan.medialibrary.Tools
import
org.videolan.medialibrary.media.MediaWrapper
...
...
@@ -72,6 +73,7 @@ import org.videolan.vlc.gui.video.VideoPlayerActivity
import
org.videolan.vlc.gui.view.AudioMediaSwitcher.AudioMediaSwitcherListener
import
org.videolan.vlc.util.AndroidDevices
import
org.videolan.vlc.util.Constants
import
org.videolan.vlc.util.VLCIO
import
org.videolan.vlc.viewmodels.PlaybackProgress
import
org.videolan.vlc.viewmodels.PlaylistModel
...
...
@@ -277,7 +279,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, PlaybackSe
if
(
TextUtils
.
isEmpty
(
mw
.
artworkMrl
))
{
setDefaultBackground
()
}
else
{
val
blurredCover
=
async
{
UiTools
.
blurBitmap
(
AudioUtil
.
readCoverBitmap
(
Uri
.
decode
(
mw
.
artworkMrl
),
binding
.
contentLayout
.
width
))
}
.
await
()
val
blurredCover
=
withContext
(
VLCIO
)
{
UiTools
.
blurBitmap
(
AudioUtil
.
readCoverBitmap
(
Uri
.
decode
(
mw
.
artworkMrl
),
binding
.
contentLayout
.
width
))
}
if
(
blurredCover
!==
null
)
{
val
activity
=
activity
as
?
AudioPlayerContainerActivity
if
(
activity
===
null
)
return
@launch
...
...
@@ -326,19 +328,17 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, PlaybackSe
}
fun
onNextClick
(
view
:
View
)
{
if
(
service
===
null
)
return
if
(
service
?.
hasNext
()
==
true
)
service
?.
next
()
else
Snackbar
.
make
(
binding
.
root
,
R
.
string
.
lastsong
,
Snackbar
.
LENGTH_SHORT
).
show
()
service
?.
run
{
if
(
hasNext
())
next
()
else
Snackbar
.
make
(
binding
.
root
,
R
.
string
.
lastsong
,
Snackbar
.
LENGTH_SHORT
).
show
()
}
}
fun
onPreviousClick
(
view
:
View
)
{
if
(
service
===
null
)
return
if
(
service
?.
hasPrevious
()
==
true
||
service
?.
isSeekable
==
true
)
service
?.
previous
(
false
)
else
Snackbar
.
make
(
binding
.
root
,
R
.
string
.
firstsong
,
Snackbar
.
LENGTH_SHORT
).
show
()
service
?.
run
{
if
(
hasPrevious
()
||
isSeekable
)
previous
(
false
)
else
Snackbar
.
make
(
binding
.
root
,
R
.
string
.
firstsong
,
Snackbar
.
LENGTH_SHORT
).
show
()
}
}
fun
onRepeatClick
(
view
:
View
)
{
...
...
@@ -420,8 +420,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, PlaybackSe
fun
onSearchClick
(
v
:
View
)
{
binding
.
playlistSearch
.
visibility
=
View
.
GONE
binding
.
playlistSearchText
.
visibility
=
View
.
VISIBLE
if
(
binding
.
playlistSearchText
.
editText
!=
null
)
binding
.
playlistSearchText
.
editText
!!
.
requestFocus
()
binding
.
playlistSearchText
.
editText
?.
requestFocus
()
val
imm
=
VLCApplication
.
getAppContext
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
showSoftInput
(
binding
.
playlistSearchText
.
editText
,
InputMethodManager
.
SHOW_IMPLICIT
)
handler
.
postDelayed
(
hideSearchRunnable
,
SEARCH_TIMEOUT_MILLIS
.
toLong
())
...
...
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