Solution 1 :
When the activity enters or exits picture-in-picture mode the system calls Activity.onPictureInPictureModeChanged()
or Fragment.onPictureInPictureModeChanged().
You can implement your code inside this:
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean,
newConfig: Configuration) {
if (isInPictureInPictureMode) {
// Hide the full-screen UI (controls, etc.) while in picture-in-picture mode.
} else {
// Restore the full-screen UI.
}
}
Problem :
We are using the calls page with a picture in picture(pip) feature.
Problem :
In case user dismiss the pip popup window (by drag down to dismiss) we not able to detect that.
How to detect picture in picture window drag down to dismiss?
Update:
Set picture in picture
// RemoteRenderLayout -> call preview layout. You can set anyone view
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Rational aspectRatio = new Rational(
remoteRenderLayout.getWidth(), remoteRenderLayout.getHeight());
PictureInPictureParams params = new PictureInPictureParams.Builder()
.setAspectRatio(aspectRatio)
.build();
enterPictureInPictureMode(params);
}
else{
enterPictureInPictureMode();
}
Comments
Comment posted by Marian Paździoch
“pip popup window” what do you mean by that? What exactly parts on Android api you use to create it. Give code you have to create it, then we may be able to help.
Comment posted by developer.android.com/guide/topics/ui/picture-in-picture
“pip popup window” -> picture in picture window (small square box) officical documentation –
Comment posted by Mario Boss
@Ranjith – can you provide some code to review with some tried approaches to achieve desire results..?
Comment posted by Ranjithkumar
@MarioBoss question updated with sample code