【发布时间】:2020-06-11 05:40:16
【问题描述】:
我们正在使用带有画中画(pip)功能的通话页面。
问题:
如果用户关闭 pip 弹出窗口(通过向下拖动关闭)我们无法检测到。
如何检测图片窗口中的图片下拉关闭?
更新:
设置画中画
// 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();
}
【问题讨论】:
-
"pip 弹出窗口" 你是什么意思?您用于创建它的 Android api 的具体部分。提供您必须创建的代码,然后我们可能会提供帮助。
-
"pip popup window" -> 画中画窗口(小方块)官方文档 - developer.android.com/guide/topics/ui/picture-in-picture@MarianPaździoch
-
@Ranjith - 你能提供一些代码来审查一些经过尝试的方法来实现期望的结果..?
-
@MarioBoss 问题已更新为示例代码
标签: android android-picture-in-picture