I am publishing a small, but sometimes necessary extension to be able to switch to picture-in-picture mode. to use it, you must give permission in the manifest :
android:supportsPictureInPicture=“true”
(for example, if you want to check this, say directly in Kodular, then you need to make a small change in the manifest to the companion:
… android:name=“io.makeroid.companion.Screen1”
android:supportsPictureInPicture=“true”
android:theme=“@style/AppTheme.NoActionBar”
… )
let’s move on to a small number of blocks:
Puts your app in picture-in-picture mode with a ratio of 16:9, 4:3…
The events taking place are reflected in these messages. There are a few messages in total:
“Entered PIP mode.ratio:w/h”
“STOP:Aspect ratio is too extreme (must be between 0.418410 and 2.390000)”
“PIP mode not supported on this Android version”
“Exited PIP mode”
It might come in handy. although so you can return from PIP mode in a regular way
PIPMode.aix (6.2 KB)