mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
start pip mode when back button is pressed
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
78653e7d8d
commit
2c1b45491d
2 changed files with 7 additions and 10 deletions
|
@ -89,13 +89,15 @@ class MagicCallActivity : BaseActivity() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
override fun onBackPressed() {
|
||||||
fun enterPipMode() {
|
enterPipMode()
|
||||||
enableKeyguard()
|
|
||||||
enterPictureInPictureMode(getPipParams())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUserLeaveHint() {
|
override fun onUserLeaveHint() {
|
||||||
|
enterPipMode()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun enterPipMode() {
|
||||||
enableKeyguard()
|
enableKeyguard()
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
enterPictureInPictureMode(getPipParams())
|
enterPictureInPictureMode(getPipParams())
|
||||||
|
|
|
@ -865,12 +865,7 @@ public class CallController extends BaseController {
|
||||||
|
|
||||||
@OnClick(R.id.callControlEnterPip)
|
@OnClick(R.id.callControlEnterPip)
|
||||||
void enterPipMode() {
|
void enterPipMode() {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O){
|
((MagicCallActivity) getActivity()).enterPipMode();
|
||||||
((MagicCallActivity) getActivity()).enterPipMode();
|
|
||||||
} else{
|
|
||||||
Log.w(TAG, "tried to enterPipMode with an android api level below 26 (Android 8). This scenario should " +
|
|
||||||
"have been avoided by hiding the PIP button!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.callControlHangupView)
|
@OnClick(R.id.callControlHangupView)
|
||||||
|
|
Loading…
Reference in a new issue