优化
This commit is contained in:
@@ -148,6 +148,12 @@ object AudioPlay {
|
|||||||
appCtx.startService(intent)
|
appCtx.startService(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addTimer(context: Context) {
|
||||||
|
val intent = Intent(appCtx, AudioPlayService::class.java)
|
||||||
|
intent.action = IntentAction.addTimer
|
||||||
|
appCtx.startService(intent)
|
||||||
|
}
|
||||||
|
|
||||||
fun saveRead() {
|
fun saveRead() {
|
||||||
book?.let { book ->
|
book?.let { book ->
|
||||||
book.lastCheckCount = 0
|
book.lastCheckCount = 0
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class AudioPlayActivity :
|
|||||||
}
|
}
|
||||||
binding.ivTimer.setOnClickListener {
|
binding.ivTimer.setOnClickListener {
|
||||||
if (AudioPlayService.isRun) {
|
if (AudioPlayService.isRun) {
|
||||||
|
AudioPlay.addTimer(this)
|
||||||
} else {
|
} else {
|
||||||
toastOnUi(R.string.cannot_timed_non_playback)
|
toastOnUi(R.string.cannot_timed_non_playback)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.legado.app.ui.book.audio
|
||||||
|
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.PopupWindow
|
||||||
|
|
||||||
|
class TimerSliderPopup :
|
||||||
|
PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user