Added in API level 31

PictureInPictureUiState

class PictureInPictureUiState : Parcelable
kotlin.Any
   ↳ android.app.PictureInPictureUiState

Used by Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState).

Summary

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

Int

Boolean

Returns whether Picture-in-Picture is stashed or not.

Unit
writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<PictureInPictureUiState!>

Public methods

describeContents

Added in API level 31
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 31
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

hashCode

Added in API level 31
fun hashCode(): Int
Return
Int a hash code value for this object.

isStashed

Added in API level 31
fun isStashed(): Boolean

Returns whether Picture-in-Picture is stashed or not. A stashed PiP means it is only partially visible to the user, with some parts of it being off-screen. This is usually an UI state that is triggered by the user, such as flinging the PiP to the edge or letting go of PiP while dragging partially off-screen. Developers can use this in conjunction with Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState) to get a signal when the PiP stash state has changed. For example, if the state changed from false to true, developers can choose to temporarily pause video playback if PiP is of video content. Vice versa, if changing from true to false and video content is paused, developers can resumevideo playback.

See Also

    writeToParcel

    Added in API level 31
    fun writeToParcel(
        out: Parcel,
        flags: Int
    ): Unit

    Flatten this object in to a Parcel.

    Parameters
    dest The Parcel in which the object should be written. This value cannot be null.
    flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES
    out Parcel: This value cannot be null.

    Properties

    CREATOR

    Added in API level 31
    static val CREATOR: Parcelable.Creator<PictureInPictureUiState!>