mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
commit
e2d2c392fb
@ -21,6 +21,7 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookChapter
|
import io.legado.app.data.entities.BookChapter
|
||||||
import io.legado.app.data.entities.BookSource
|
import io.legado.app.data.entities.BookSource
|
||||||
import io.legado.app.databinding.ActivityAudioPlayBinding
|
import io.legado.app.databinding.ActivityAudioPlayBinding
|
||||||
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.lib.dialogs.alert
|
import io.legado.app.lib.dialogs.alert
|
||||||
import io.legado.app.model.AudioPlay
|
import io.legado.app.model.AudioPlay
|
||||||
import io.legado.app.model.BookCover
|
import io.legado.app.model.BookCover
|
||||||
@ -226,13 +227,17 @@ class AudioPlayActivity :
|
|||||||
override fun finish() {
|
override fun finish() {
|
||||||
AudioPlay.book?.let {
|
AudioPlay.book?.let {
|
||||||
if (!AudioPlay.inBookshelf) {
|
if (!AudioPlay.inBookshelf) {
|
||||||
alert(title = getString(R.string.add_to_shelf)) {
|
if (!AppConfig.showAddToShelfAlert) {
|
||||||
setMessage(getString(R.string.check_add_bookshelf, it.name))
|
viewModel.removeFromBookshelf { super.finish() }
|
||||||
okButton {
|
} else {
|
||||||
AudioPlay.inBookshelf = true
|
alert(title = getString(R.string.add_to_shelf)) {
|
||||||
setResult(Activity.RESULT_OK)
|
setMessage(getString(R.string.check_add_bookshelf, it.name))
|
||||||
|
okButton {
|
||||||
|
AudioPlay.inBookshelf = true
|
||||||
|
setResult(Activity.RESULT_OK)
|
||||||
|
}
|
||||||
|
noButton { viewModel.removeFromBookshelf { super.finish() } }
|
||||||
}
|
}
|
||||||
noButton { viewModel.removeFromBookshelf { super.finish() } }
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.finish()
|
super.finish()
|
||||||
|
Loading…
Reference in New Issue
Block a user