NavType.ParcelableType



ParcelableType is used for passing Parcelables in NavArguments.

Null values are supported. Default values in Navigation XML files are not supported.

Summary

Public constructors

<D : Any?> ParcelableType(type: Class<D>)
android

Public functions

open operator Boolean
equals(other: Any?)
android
open operator D?
get(bundle: Bundle, key: String)

Get a value of this type from the savedState

android
open Int
android
open D
android
open Unit
put(bundle: Bundle, key: String, value: D)

Put a value of this type in the savedState

android

Public properties

open String

The name of this type.

android

Inherited functions

From androidx.navigation.NavType
open D
parseValue(value: String, previousValue: D)

Parse a value of this type from a String and then combine that parsed value with the given previousValue of the same type to provide a new value that contains both the new and previous value.

android
open String
serializeAsValue(value: D)

Serialize a value of this NavType into a String.

android
open String
android
open Boolean
valueEquals(value: D, other: D)

Compares two values of type T and returns true if values are equal.

android

Inherited properties

From androidx.navigation.NavType
open Boolean

Check if an argument with this type can hold a null value.

android

Public constructors

ParcelableType

<D : Any?> ParcelableType(type: Class<D>)
Parameters
type: Class<D>

the Parcelable class that is supported by this NavType

Public functions

equals

open operator fun equals(other: Any?): Boolean

get

open operator fun get(bundle: Bundle, key: String): D?

Get a value of this type from the savedState

Parameters
bundle: Bundle

savedState to get value from

key: String

savedState key

Returns
D?

value of this type

hashCode

open fun hashCode(): Int

parseValue

open fun parseValue(value: String): D
Throws
UnsupportedOperationException

since Parcelables do not support default values

put

open fun put(bundle: Bundle, key: String, value: D): Unit

Put a value of this type in the savedState

Parameters
bundle: Bundle

savedState to put value in

key: String

savedState key

value: D

value of this type

Public properties

name

open val name: String

The name of this type.

This is the same value that is used in Navigation XML argType attribute.

Returns
String

name of this type