mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 05:25:31 +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)
|
||||
fun enterPipMode() {
|
||||
enableKeyguard()
|
||||
enterPictureInPictureMode(getPipParams())
|
||||
override fun onBackPressed() {
|
||||
enterPipMode()
|
||||
}
|
||||
|
||||
override fun onUserLeaveHint() {
|
||||
enterPipMode()
|
||||
}
|
||||
|
||||
fun enterPipMode() {
|
||||
enableKeyguard()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
enterPictureInPictureMode(getPipParams())
|
||||
|
|
|
@ -865,12 +865,7 @@ public class CallController extends BaseController {
|
|||
|
||||
@OnClick(R.id.callControlEnterPip)
|
||||
void enterPipMode() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O){
|
||||
((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!");
|
||||
}
|
||||
((MagicCallActivity) getActivity()).enterPipMode();
|
||||
}
|
||||
|
||||
@OnClick(R.id.callControlHangupView)
|
||||
|
|
Loading…
Reference in a new issue