Convert PlayerFragment to Kotlin
This commit is contained in:
parent
5cfb49ac69
commit
28336c8bf7
File diff suppressed because it is too large
Load Diff
|
@ -388,7 +388,7 @@ class LocalMediaPlayer(
|
||||||
setPlayerState(PlayerState.PREPARING)
|
setPlayerState(PlayerState.PREPARING)
|
||||||
|
|
||||||
mediaPlayer.setOnBufferingUpdateListener { mp, percent ->
|
mediaPlayer.setOnBufferingUpdateListener { mp, percent ->
|
||||||
val progressBar = PlayerFragment.getProgressBar()
|
val progressBar = PlayerFragment.progressBar
|
||||||
val song = downloadFile.song
|
val song = downloadFile.song
|
||||||
|
|
||||||
if (percent == 100) {
|
if (percent == 100) {
|
||||||
|
@ -405,10 +405,10 @@ class LocalMediaPlayer(
|
||||||
mediaPlayer.setOnPreparedListener {
|
mediaPlayer.setOnPreparedListener {
|
||||||
Timber.i("Media player prepared")
|
Timber.i("Media player prepared")
|
||||||
setPlayerState(PlayerState.PREPARED)
|
setPlayerState(PlayerState.PREPARED)
|
||||||
val progressBar = PlayerFragment.getProgressBar()
|
val progressBar = PlayerFragment.progressBar
|
||||||
if (progressBar != null && downloadFile.isWorkDone) {
|
if (progressBar != null && downloadFile.isWorkDone) {
|
||||||
// Populate seek bar secondary progress if we have a complete file for consistency
|
// Populate seek bar secondary progress if we have a complete file for consistency
|
||||||
PlayerFragment.getProgressBar().secondaryProgress = 100 * progressBar.max
|
PlayerFragment.progressBar.secondaryProgress = 100 * progressBar.max
|
||||||
}
|
}
|
||||||
synchronized(this@LocalMediaPlayer) {
|
synchronized(this@LocalMediaPlayer) {
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
Loading…
Reference in New Issue