WindowAreaPresentationSessionCallback


@ExperimentalWindowApi
public interface WindowAreaPresentationSessionCallback


A callback to notify about the lifecycle of a window area presentation session.

Summary

Public methods

abstract void
onContainerVisibilityChanged(boolean isVisible)

Notifies about changes in visibility of a container that can hold the app content to show in the window area.

abstract void

Notifies about an end of a presentation session.

abstract void

Notifies about a start of a presentation session.

Public methods

onContainerVisibilityChanged

Added in 1.2.0
abstract void onContainerVisibilityChanged(boolean isVisible)

Notifies about changes in visibility of a container that can hold the app content to show in the window area. Notification of the container being visible is guaranteed to occur after onSessionStarted has been called. The container being no longer visible is guaranteed to occur before onSessionEnded.

If content was never presented, then this method will never be called.

onSessionEnded

Added in 1.2.0
abstract void onSessionEnded(Throwable t)

Notifies about an end of a presentation session. The presentation and any app-provided content in the window area is removed.

Parameters
Throwable t

Throwable to provide information on if the session was ended due to an error. This will only occur if a session is attempted to be enabled when it is not available, but can be expanded to alert for more errors in the future.

onSessionStarted

Added in 1.2.0
abstract void onSessionStarted(@NonNull WindowAreaSessionPresenter session)

Notifies about a start of a presentation session. Provides a reference to WindowAreaSessionPresenter to allow an application to customize a presentation when the session starts. The Context provided from the WindowAreaSessionPresenter should be used to inflate or make any UI decisions around the presentation View that should be shown in that area.