Ivan Šimović
Ivan Šimović

Reputation: 589

How can I put one part of my App in PiP mode while still being inside the App?

How can I have PiP mode while I am still in the App? I am creating a video calling App, and while the call is still going on, you are able to go to a separate full screen view that currently is the same Fragment with the views being hidden/shown. When I go to separate full screen view, the cameras are no longer visible. We would like to solve that issue by putting the cameras in PiP mode. I see that the google meet app does that. But I could not find any reference to how to do this on the web.

Example of what I am trying to do: enter image description here

Upvotes: 0

Views: 1154

Answers (2)

Ivan Shafran
Ivan Shafran

Reputation: 641

You can open your app in another task. That way, you can have native Pip for call screen and surf your application.

For example, for setting another task for your screen inside your app:

<activity
...
android:taskAffinity="com.example.myapp.calls"
/>

Upvotes: 0

Ivan Šimović
Ivan Šimović

Reputation: 589

Android does not provide native solution to this problem. Instead I used a touch listener to listen for drag and drop events my self. There are multiple tutorials on this topic.

Upvotes: 0

Related Questions