WindowAreaControllerCallbackAdapter


@ExperimentalWindowApi
class WindowAreaControllerCallbackAdapter : WindowAreaController


An adapter for WindowAreaController to provide callback APIs.

Summary

Public constructors

Public functions

Unit
addWindowAreaInfoListListener(
    executor: Executor,
    listener: Consumer<List<WindowAreaInfo>>
)

Registers a listener that is interested in the current list of WindowAreaInfo available to be interacted with.

Unit

Removes a listener of available WindowAreaInfo records.

Inherited functions

From androidx.window.area.WindowAreaController
open Unit
presentContentOnWindowArea(
    token: Binder,
    activity: Activity,
    executor: Executor,
    windowAreaPresentationSessionCallback: WindowAreaPresentationSessionCallback
)

Starts a presentation session on the WindowAreaInfo identified by the token and sends updates through the WindowAreaPresentationSessionCallback.

open Unit
transferActivityToWindowArea(
    token: Binder,
    activity: Activity,
    executor: Executor,
    windowAreaSessionCallback: WindowAreaSessionCallback
)

Starts a transfer session where the calling Activity is moved to the window area identified by the token.

Inherited properties

From androidx.window.area.WindowAreaController
open Flow<List<WindowAreaInfo>>

Flow of the list of current WindowAreaInfos that are currently available to be interacted with.

Public constructors

WindowAreaControllerCallbackAdapter

Added in 1.2.0
WindowAreaControllerCallbackAdapter(controller: WindowAreaController)

Public functions

addWindowAreaInfoListListener

Added in 1.2.0
fun addWindowAreaInfoListListener(
    executor: Executor,
    listener: Consumer<List<WindowAreaInfo>>
): Unit

Registers a listener that is interested in the current list of WindowAreaInfo available to be interacted with.

The listener will receive an initial value on registration, as soon as it becomes available.

Parameters
executor: Executor

to handle sending listener updates.

listener: Consumer<List<WindowAreaInfo>>

to receive updates to the list of WindowAreaInfo.

removeWindowAreaInfoListListener

Added in 1.2.0
fun removeWindowAreaInfoListListener(
    listener: Consumer<List<WindowAreaInfo>>
): Unit

Removes a listener of available WindowAreaInfo records. If the listener is not present then this method is a no-op.

Parameters
listener: Consumer<List<WindowAreaInfo>>

to remove from receiving status updates.