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()
|
player.destroy()
|
||||||
}
|
}
|
||||||
abandonAudioFocus()
|
abandonAudioFocus()
|
||||||
if (packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
finishAndRemoveTask()
|
|
||||||
}
|
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1129,11 +1126,13 @@ class PlayerActivity :
|
||||||
private fun eventPropertyUi(property: String, value: Boolean) {
|
private fun eventPropertyUi(property: String, value: Boolean) {
|
||||||
when (property) {
|
when (property) {
|
||||||
"pause" -> {
|
"pause" -> {
|
||||||
|
if (!isFinishing) {
|
||||||
setAudioFocus(value)
|
setAudioFocus(value)
|
||||||
updatePlaybackStatus(value)
|
updatePlaybackStatus(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun eventProperty(property: String) {}
|
override fun eventProperty(property: String) {}
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,8 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
|
||||||
PackageManager.FEATURE_PICTURE_IN_PICTURE,
|
PackageManager.FEATURE_PICTURE_IN_PICTURE,
|
||||||
) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||||
}
|
}
|
||||||
binding.backArrowBtnLandscape.setOnClickListener { activity.finishAndRemoveTask() }
|
binding.backArrowBtnLandscape.setOnClickListener { activity.onBackPressed() }
|
||||||
binding.backArrowBtnPortrait.setOnClickListener { activity.finishAndRemoveTask() }
|
binding.backArrowBtnPortrait.setOnClickListener { activity.onBackPressed() }
|
||||||
|
|
||||||
// Lock and Unlock controls
|
// Lock and Unlock controls
|
||||||
binding.lockBtn.setOnClickListener { lockControls(true) }
|
binding.lockBtn.setOnClickListener { lockControls(true) }
|
||||||
|
|
Loading…
Reference in a new issue