floating
floating copied to clipboard
Implementing automatic pip mode
Implementation of two new functions Floating.toggleAutoPip
and Floating.isAutoPipAvailable
, the first of which explicitly calls setAutoEnterEnabled
on the Android side. This way, the user can toggle automatic PiP mode on with Floating.toggleAutoPip(autoEnter: true)
or off with Floating.toggleAutoPip(autoEnter: false)
, depending on the current state of the app. Just like Floating.enable
, Floating.toggleAutoPip
takes aspectRatio
and sourceRectHint
as additional parameters.
However, this additional functionality somewhat breaks the implementation of PiPStatus
, since PiP can be entered automatically, without calling Floating.enable
. Maybe, one should also implement PipStatus.automatic
?