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
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
bdeafbd9
Commit
bdeafbd9
authored
4 years ago
by
Isira Seneviratne
Browse files
Options
Downloads
Patches
Plain Diff
Replace calls to Java's libraries with calls to the Kotlin standard library functions.
parent
0d342d72
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!573
Replace calls to Java's libraries with calls to the Kotlin standard library functions.
Pipeline
#16531
passed with stage
in 5 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt
+10
-10
10 additions, 10 deletions
...videolan/television/ui/audioplayer/AudioPlayerActivity.kt
with
10 additions
and
10 deletions
application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt
+
10
−
10
View file @
bdeafbd9
...
...
@@ -41,20 +41,20 @@ import androidx.recyclerview.widget.LinearLayoutManager
import
androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat
import
kotlinx.coroutines.*
import
org.videolan.medialibrary.interfaces.media.MediaWrapper
import
org.videolan.resources.AndroidDevices
import
org.videolan.television.R
import
org.videolan.television.databinding.TvAudioPlayerBinding
import
org.videolan.television.ui.browser.BaseTvActivity
import
org.videolan.tools.Settings
import
org.videolan.vlc.gui.helpers.AudioUtil
import
org.videolan.vlc.gui.helpers.MediaComparators
import
org.videolan.vlc.gui.helpers.UiTools
import
org.videolan.television.ui.browser.BaseTvActivity
import
org.videolan.vlc.media.MediaUtils
import
org.videolan.resources.AndroidDevices
import
org.videolan.television.databinding.TvAudioPlayerBinding
import
org.videolan.tools.Settings
import
org.videolan.vlc.util.getScreenWidth
import
org.videolan.vlc.viewmodels.PlayerState
import
org.videolan.vlc.viewmodels.PlaylistModel
import
java.lang.Runnable
import
java.util.*
import
kotlin.math.abs
@ObsoleteCoroutinesApi
@ExperimentalCoroutinesApi
...
...
@@ -202,12 +202,12 @@ class AudioPlayerActivity : BaseTvActivity() {
val
dpadx
=
event
.
getAxisValue
(
MotionEvent
.
AXIS_HAT_X
)
val
dpady
=
event
.
getAxisValue
(
MotionEvent
.
AXIS_HAT_Y
)
if
(
inputDevice
==
null
||
Math
.
abs
(
dpadx
)
==
1.0f
||
Math
.
abs
(
dpady
)
==
1.0f
)
return
false
if
(
inputDevice
==
null
||
abs
(
dpadx
)
==
1.0f
||
abs
(
dpady
)
==
1.0f
)
return
false
val
x
=
AndroidDevices
.
getCenteredAxis
(
event
,
inputDevice
,
MotionEvent
.
AXIS_X
)
if
(
Math
.
abs
(
x
)
>
0.3
&&
System
.
currentTimeMillis
()
-
lastMove
>
JOYSTICK_INPUT_DELAY
)
{
if
(
abs
(
x
)
>
0.3
&&
System
.
currentTimeMillis
()
-
lastMove
>
JOYSTICK_INPUT_DELAY
)
{
seek
(
if
(
x
>
0.0f
)
10000
else
-
10000
)
lastMove
=
System
.
currentTimeMillis
()
return
true
...
...
@@ -233,11 +233,11 @@ class AudioPlayerActivity : BaseTvActivity() {
private
fun
setShuffleMode
(
shuffle
:
Boolean
)
{
shuffling
=
shuffle
val
medias
=
model
.
medias
?:
return
val
medias
=
model
.
medias
?.
toMutableList
()
?:
return
if
(
shuffle
)
Collection
s
.
shuffle
(
medias
)
media
s
.
shuffle
()
else
Collections
.
sort
(
medias
,
MediaComparators
.
BY_TRACK_NUMBER
)
medias
.
sortWith
(
MediaComparators
.
BY_TRACK_NUMBER
)
model
.
load
(
medias
,
0
)
}
...
...
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