isTransitioningToPip

Returns true if the app is going to enter Picture-in-Picture (PiP) mode.

This state is associated with the entering PiP animation. When that animation starts, whether via auto enter PiP or calling ComponentActivity.enterPictureInPictureMode explicitly, app can expect ComponentActivity.onPictureInPictureUiStateChanged callback with isTransitioningToPip to be true first, followed by ComponentActivity.onPictureInPictureModeChanged when it fully settles in PiP mode.

When app receives the ComponentActivity.onPictureInPictureUiStateChanged callback with isTransitioningToPip being true, it's recommended to hide certain UI elements, such as video controls, to archive a clean entering PiP animation.

In case an application wants to restore the previously hidden UI elements when exiting PiP, it is recommended to do that in ComponentActivity.onPictureInPictureUiStateChanged callback when isTransitioningToPip is false, rather than the beginning of exit PiP animation.

Compatibility notes: this value is meaningful on API 35+