NavType.Companion

object NavType.Companion


Summary

Public fields

final @NonNull NavType<boolean[]>

NavType for storing boolean arrays, corresponding with the "boolean[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Boolean>

NavType for storing boolean values, corresponding with the "boolean" type in a Navigation XML file.

final @NonNull NavType<float[]>

NavType for storing float arrays, corresponding with the "float[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Float>

NavType for storing float values, corresponding with the "float" type in a Navigation XML file.

final @NonNull NavType<int[]>

NavType for storing integer arrays, corresponding with the "integer[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Integer>

NavType for storing integer values, corresponding with the "integer" type in a Navigation XML file.

final @NonNull NavType<long[]>

NavType for storing long arrays, corresponding with the "long[]" type in a Navigation XML file.

final @NonNull NavType<@NonNull Long>

NavType for storing long values, corresponding with the "long" type in a Navigation XML file.

final @NonNull NavType<@NonNull Integer>

NavType for storing integer values representing resource ids, corresponding with the "reference" type in a Navigation XML file.

final @NonNull NavType<String[]>

NavType for storing String arrays, corresponding with the "string[]" type in a Navigation XML file.

final @NonNull NavType<String>

NavType for storing String values, corresponding with the "string" type in a Navigation XML file.

Public methods

@NonNull NavType<@NonNull ?>
fromArgType(String type, String packageName)

Parse an argType string into a NavType.

Public fields

BoolArrayType

public final @NonNull NavType<boolean[]> BoolArrayType

NavType for storing boolean arrays, corresponding with the "boolean[]" type in a Navigation XML file.

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

BoolType

public final @NonNull NavType<@NonNull BooleanBoolType

NavType for storing boolean values, corresponding with the "boolean" type in a Navigation XML file.

Null values are not supported.

FloatArrayType

public final @NonNull NavType<float[]> FloatArrayType

NavType for storing float arrays, corresponding with the "float[]" type in a Navigation XML file.

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

FloatType

public final @NonNull NavType<@NonNull FloatFloatType

NavType for storing float values, corresponding with the "float" type in a Navigation XML file.

Null values are not supported.

IntArrayType

public final @NonNull NavType<int[]> IntArrayType

NavType for storing integer arrays, corresponding with the "integer[]" type in a Navigation XML file.

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

IntType

public final @NonNull NavType<@NonNull IntegerIntType

NavType for storing integer values, corresponding with the "integer" type in a Navigation XML file.

Null values are not supported.

LongArrayType

public final @NonNull NavType<long[]> LongArrayType

NavType for storing long arrays, corresponding with the "long[]" type in a Navigation XML file.

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

LongType

public final @NonNull NavType<@NonNull LongLongType

NavType for storing long values, corresponding with the "long" type in a Navigation XML file.

Null values are not supported. Default values for this type in Navigation XML files must always end with an 'L' suffix, e.g. app:defaultValue="123L".

ReferenceType

public final @NonNull NavType<@NonNull IntegerReferenceType

NavType for storing integer values representing resource ids, corresponding with the "reference" type in a Navigation XML file.

Null values are not supported.

StringArrayType

public final @NonNull NavType<String[]> StringArrayType

NavType for storing String arrays, corresponding with the "string[]" type in a Navigation XML file.

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

StringType

public final @NonNull NavType<StringStringType

NavType for storing String values, corresponding with the "string" type in a Navigation XML file.

Null values are supported.

Public methods

fromArgType

public @NonNull NavType<@NonNull ?> fromArgType(String type, String packageName)

Parse an argType string into a NavType.

Parameters
String type

argType string, usually parsed from the Navigation XML file

String packageName

package name of the R file, used for parsing relative class names starting with a dot.

Returns
@NonNull NavType<@NonNull ?>

a NavType representing the type indicated by the argType string. Defaults to StringType for null.

Throws
kotlin.IllegalArgumentException

if there is no valid argType

kotlin.RuntimeException

if the type class name cannot be found