mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 09:39:03 +03:00
fix app closing on pressing back (#565)
This commit is contained in:
parent
856847f06e
commit
b10a4c7fcf
2 changed files with 6 additions and 7 deletions
|
@ -809,9 +809,6 @@ class PlayerActivity :
|
|||
player.destroy()
|
||||
}
|
||||
abandonAudioFocus()
|
||||
if (packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
finishAndRemoveTask()
|
||||
}
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
|
@ -1129,11 +1126,13 @@ class PlayerActivity :
|
|||
private fun eventPropertyUi(property: String, value: Boolean) {
|
||||
when (property) {
|
||||
"pause" -> {
|
||||
if (!isFinishing) {
|
||||
setAudioFocus(value)
|
||||
updatePlaybackStatus(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun eventProperty(property: String) {}
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
|
|||
PackageManager.FEATURE_PICTURE_IN_PICTURE,
|
||||
) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||
}
|
||||
binding.backArrowBtnLandscape.setOnClickListener { activity.finishAndRemoveTask() }
|
||||
binding.backArrowBtnPortrait.setOnClickListener { activity.finishAndRemoveTask() }
|
||||
binding.backArrowBtnLandscape.setOnClickListener { activity.onBackPressed() }
|
||||
binding.backArrowBtnPortrait.setOnClickListener { activity.onBackPressed() }
|
||||
|
||||
// Lock and Unlock controls
|
||||
binding.lockBtn.setOnClickListener { lockControls(true) }
|
||||
|
|
Loading…
Reference in a new issue