diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index bd2cc2d75..ab5baab7f 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -9,6 +9,7 @@ import android.graphics.BitmapFactory import android.media.AudioFocusRequest import android.media.AudioManager import android.media.MediaPlayer +import android.os.Build import android.os.Handler import android.support.v4.media.session.MediaSessionCompat import android.support.v4.media.session.PlaybackStateCompat @@ -159,6 +160,17 @@ class AudioPlayService : BaseService(), } } + private fun changeplayerSpeed(speed: Float) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (mediaPlayer.isPlaying) { + mediaPlayer.playbackParams = mediaPlayer.playbackParams.setSpeed(speed) + } else { + mediaPlayer.playbackParams = mediaPlayer.playbackParams.setSpeed(speed) + mediaPlayer.pause() + } + } + } + /** * 加载完成 */ diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index fc3744222..0c34c05bb 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -30,6 +30,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick import org.jetbrains.anko.startActivityForResult + class AudioPlayActivity : VMBaseActivity(R.layout.activity_audio_play) { override val viewModel: AudioPlayViewModel @@ -82,6 +83,12 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a ) } } + iv_fast_forward.onClick { + + } + iv_fast_rewind.onClick { + + } } private fun upCover(path: String) { diff --git a/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt b/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt index 86e7e0629..66c371294 100644 --- a/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt @@ -23,7 +23,7 @@ import io.legado.app.utils.visible /** * Created by milad heydari on 5/6/2016. */ -class BadgeView @JvmOverloads constructor( +class BadgeView( context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.textViewStyle diff --git a/app/src/main/res/layout/activity_audio_play.xml b/app/src/main/res/layout/activity_audio_play.xml index 5d4c4788a..76897d195 100644 --- a/app/src/main/res/layout/activity_audio_play.xml +++ b/app/src/main/res/layout/activity_audio_play.xml @@ -29,6 +29,13 @@ app:layout_constraintTop_toBottomOf="@+id/title_bar" app:layout_constraintBottom_toBottomOf="parent" /> + +