androidx.navigation3.runtime.deeplink

Interfaces

DeepLinkMatcher.Filter

A filter for a deep link, such as a mimeType.

Cmn
RequestExtrasKey

The base Key associated with a value of type T.

Cmn

Classes

DeepLinkMatcher

Encompasses the logic to match a navigation key of type T against a DeepLinkRequest.

Cmn
DeepLinkMatcher.MatchResult

The class that is returned when a DeepLinkMatcher matches with a DeepLinkRequest

Cmn
DeepLinkRequest

Represents a requested deep link.

Cmn
DeepLinkUri

see android.net.Uri

Cmn
android
RequestExtrasScope

Scope provided to the requestExtras dsl builder.

Cmn
StaticKeyDeepLinkMatcher

A DeepLinkMatcher that matches based on a list of Filter and if all filters match, returns the input key in the MatchResult.

Cmn
UriDeepLinkMatcher

Represents a deep link that can be deep linked into when matched with a DeepLinkRequest

Cmn
UriMatchResult

The class that is returned when a UriDeepLinkMatcher matches with a DeepLinkRequest

Cmn

Objects

DeepLinkMatcher.Companion
Cmn
DeepLinkRequest.Companion
Cmn
DeepLinkRequest.Companion.MimeTypeExtrasKey

The key of the mimeType stored inside the map returned by mimeTypeExtra.

Cmn

Annotations

Type aliases

Top-level functions summary

DeepLinkUri
DeepLinkUri(uriString: String)

Creates a DeepLinkUri which parses the given encoded URI string.

Cmn
inline Map<StringAny>

Provides a RequestExtrasScope to build a Map of extra information for a DeepLinkRequest.

Cmn

Extension functions summary

Map<StringAny>

Returns a Map that stores the provided actionExtra with the key ActionExtrasKey.

android
DeepLinkMatcher.Filter

Creates a DeepLinkMatcher.Filter that filters a DeepLinkRequest with the action.

android
operator Boolean
<T : Any> Map<StringAny>.contains(key: RequestExtrasKey<T>)

Checks if this map contains a value for the given key.

Cmn
operator T?
<T : Any> Map<StringAny>.get(key: RequestExtrasKey<T>)

Returns the value for the given key.

Cmn
operator DeepLinkRequest
DeepLinkRequest.Companion.invoke(
    intent: Intent,
    extras: Map<StringAny>
)

Creates a DeepLinkRequest with an Intent.

android

Extension properties summary

RequestExtrasKey<String>

The key of the Action stored inside the map returned by actionExtra.

android

Top-level functions

fun DeepLinkUri(uriString: String): DeepLinkUri

Creates a DeepLinkUri which parses the given encoded URI string.

Parameters
uriString: String

an RFC 2396-compliant, encoded URI

Returns
DeepLinkUri

NavUri for this given uri string

inline fun requestExtras(builder: RequestExtrasScope.() -> Unit): Map<StringAny>

Provides a RequestExtrasScope to build a Map of extra information for a DeepLinkRequest.

Parameters
builder: RequestExtrasScope.() -> Unit

the DSL extension that provides a RequestExtrasScope to build a Map of DeepLinkRequest extras.

Extension functions

DeepLinkRequest.Companion.actionExtra

fun DeepLinkRequest.Companion.actionExtra(action: String): Map<StringAny>

Returns a Map that stores the provided actionExtra with the key ActionExtrasKey.

The value can be retrieved via map.get(ActionExtrasKey).

DeepLinkMatcher.Companion.actionFilter

fun DeepLinkMatcher.Companion.actionFilter(action: String): DeepLinkMatcher.Filter

Creates a DeepLinkMatcher.Filter that filters a DeepLinkRequest with the action. Matching is case-insensitive.

Parameters
action: String

the action the filter by

Returns
DeepLinkMatcher.Filter

true if the DeepLinkRequest's Action exactly matches the action, false if the request's Action does not match or if the request does not provide any Action.

operator fun <T : Any> Map<StringAny>.contains(key: RequestExtrasKey<T>): Boolean

Checks if this map contains a value for the given key.

Returns true if the map contains an entry with the given key, false otherwise.

Should be used to check entries from DeepLinkRequest.extras.

T the value type.

Parameters
key: RequestExtrasKey<T>

the key associated with the value

operator fun <T : Any> Map<StringAny>.get(key: RequestExtrasKey<T>): T?

Returns the value for the given key.

Should be used to retrieve values from DeepLinkRequest.extras.

T the value type.

Parameters
key: RequestExtrasKey<T>

the key associated with the value

DeepLinkRequest.Companion.invoke

operator fun DeepLinkRequest.Companion.invoke(
    intent: Intent,
    extras: Map<StringAny> = emptyMap()
): DeepLinkRequest

Creates a DeepLinkRequest with an Intent.

The returned DeepLinkRequest will be populated with the following data:

  1. DeepLinkRequest.uri will be Intent.getData if not null

  2. DeepLinkRequest.extras will contain any non-null information from Intent.getType, Intent.getAction, and Intent.getExtras.

Parameters
intent: Intent

The Intent with the metadata to construct a DeepLinkRequest

extras: Map<StringAny> = emptyMap()

The map holding pairs of String to Any to provide extra information to the DeepLinkRequest, such a mimeType. If stored under the same key, all information inside the extras map will take precedence over the information in the intent.

Returns
DeepLinkRequest

a DeepLinkRequest instance

Extension properties

DeepLinkRequest.Companion.ActionExtrasKey

val DeepLinkRequest.Companion.ActionExtrasKeyRequestExtrasKey<String>

The key of the Action stored inside the map returned by actionExtra.