public class PipManager extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PipManager.Listener
A listener interface to receive notification on changes in PIP.
|
static interface |
PipManager.MediaListener
A listener interface to receive change in PIP's media controller
|
Modifier and Type | Field and Description |
---|---|
static int |
STATE_NO_PIP
State when there's no PIP.
|
static int |
STATE_PIP_MENU
State when PIP menu dialog is shown.
|
static int |
STATE_PIP_OVERLAY
State when PIP is shown with an overlay message on top of it.
|
static int |
STATE_PIP_RECENTS
State when PIP is shown in Recents.
|
static int |
STATE_PIP_RECENTS_FOCUSED
State when PIP is shown in Recents and it's focused to allow an user to control.
|
static int |
SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH |
static int |
SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_OVERLAY_ACTIVITY_FINISH |
Modifier and Type | Method and Description |
---|---|
void |
addListener(PipManager.Listener listener)
Adds a
PipManager.Listener to PipManager. |
void |
addMediaListener(PipManager.MediaListener listener)
Adds a
PipManager.MediaListener to PipManager. |
void |
closePip()
Closes PIP (PIPed activity and PIP system UI).
|
static PipManager |
getInstance()
Gets an instance of
PipManager . |
Rect |
getPipBounds()
Returns the default PIP bound.
|
PipRecentsOverlayManager |
getPipRecentsOverlayManager()
Gets an instance of
PipRecentsOverlayManager . |
Rect |
getRecentsFocusedPipBounds()
Returns the focused PIP bound while Recents is shown.
|
void |
initialize(Context context)
Initializes
PipManager . |
boolean |
isPipShown()
Returns
true if PIP is shown. |
void |
removeListener(PipManager.Listener listener)
Removes a
PipManager.Listener from PipManager. |
void |
removeMediaListener(PipManager.MediaListener listener)
Removes a
PipManager.MediaListener from PipManager. |
void |
resumePipResizing(int reason)
Resumes resizing operation on the Pip that was previously suspended.
|
void |
showTvPictureInPictureMenu()
Shows the picture-in-picture menu if an activity is in picture-in-picture mode.
|
void |
suspendPipResizing(int reason)
Suspends resizing operation on the Pip until
resumePipResizing(int) is called |
public static final int STATE_NO_PIP
public static final int STATE_PIP_OVERLAY
public static final int STATE_PIP_MENU
public static final int STATE_PIP_RECENTS
public static final int STATE_PIP_RECENTS_FOCUSED
public static final int SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH
public static final int SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_OVERLAY_ACTIVITY_FINISH
public void initialize(Context context)
PipManager
.public void showTvPictureInPictureMenu()
public void closePip()
public void suspendPipResizing(int reason)
resumePipResizing(int)
is calledreason
- The reason for suspending resizing operations on the Pip.public void resumePipResizing(int reason)
reason
- The reason resizing operations on the Pip was suspended.public Rect getPipBounds()
public Rect getRecentsFocusedPipBounds()
public void addListener(PipManager.Listener listener)
PipManager.Listener
to PipManager.public void removeListener(PipManager.Listener listener)
PipManager.Listener
from PipManager.public void addMediaListener(PipManager.MediaListener listener)
PipManager.MediaListener
to PipManager.public void removeMediaListener(PipManager.MediaListener listener)
PipManager.MediaListener
from PipManager.public boolean isPipShown()
true
if PIP is shown.public static PipManager getInstance()
PipManager
.public PipRecentsOverlayManager getPipRecentsOverlayManager()
PipRecentsOverlayManager
.