WindowInfoTrackerCallbackAdapter

public final class WindowInfoTrackerCallbackAdapter implements WindowInfoTracker


An adapted interface for WindowInfoTracker that allows listening for events via a callback shaped API.

Summary

Public constructors

Public methods

final void
addWindowLayoutInfoListener(
    Activity activity,
    Executor executor,
    Consumer<WindowLayoutInfo> consumer
)

Register a listener to consume WindowLayoutInfo values.

final void

Remove a listener to stop consuming WindowLayoutInfo values.

Inherited methods

From class WindowInfoTracker
@NonNull Flow<@NonNull WindowLayoutInfo>

A Flow of WindowLayoutInfo that contains all the available features.

Public constructors

WindowInfoTrackerCallbackAdapter

public final WindowInfoTrackerCallbackAdapter(WindowInfoTracker tracker)

Public methods

addWindowLayoutInfoListener

public final void addWindowLayoutInfoListener(
    Activity activity,
    Executor executor,
    Consumer<WindowLayoutInfo> consumer
)

Register a listener to consume WindowLayoutInfo values. If the same consumer is registered twice then this method is a no-op.

See also
windowLayoutInfo

removeWindowLayoutInfoListener

public final void removeWindowLayoutInfoListener(Consumer<WindowLayoutInfo> consumer)

Remove a listener to stop consuming WindowLayoutInfo values. If the listener has already been removed then this is a no-op.

See also
windowLayoutInfo