ViewTreeNavigationEventDispatcherOwnerKt


public final class ViewTreeNavigationEventDispatcherOwnerKt


Summary

Public methods

static final NavigationEventDispatcherOwner
get(@NonNull View receiver)

Retrieve the NavigationEventDispatcherOwner associated with the given View.

static final void
set(
    @NonNull View receiver,
    @NonNull NavigationEventDispatcherOwner navigationEventDispatcherOwner
)

Set the NavigationEventDispatcherOwner associated with the given View.

Public methods

public static final NavigationEventDispatcherOwner get(@NonNull View receiver)

Retrieve the NavigationEventDispatcherOwner associated with the given View. This may be used to add a callback for navigation events.

Returns
NavigationEventDispatcherOwner

The NavigationEventDispatcherOwner associated with this view and/or some subset of its ancestors

public static final void set(
    @NonNull View receiver,
    @NonNull NavigationEventDispatcherOwner navigationEventDispatcherOwner
)

Set the NavigationEventDispatcherOwner associated with the given View. Calls to findViewTreeNavigationEventDispatcherOwner from this view or descendants will return NavigationEventDispatcherOwner.

This should only be called by constructs such as activities or dialogs that manage a view tree and handle the dispatch of navigation events. Callers should only set a NavigationEventDispatcherOwner that will be stable.

Parameters
@NonNull NavigationEventDispatcherOwner navigationEventDispatcherOwner

NavigationEventDispatcherOwner associated with the View