-
public interface DestinationsNavTypeSerializer<T extends Object>Interface with behaviour for classes that can prepare a nonnull T type into a string usable in the navigation route and can parse that same string representation back into the T type.
You can define an implementation for a specific type T and annotate it with
@NavTypeSerializerto make the generated code use it.If T is android.os.Parcelable then it will be saved in the Android android.os.Bundle as a Parcelable. java.io.Serializable types are saved as Serializable. Compose Destinations uses a default DestinationsNavTypeSerializer for both android.os.Parcelable and java.io.Serializable, so you don't need to create an explicit serializer, unless you want to be able to deep link into screens that receive those types of arguments.
For all other types that you turn as navigation argument types with this, they will be saved in the android.os.Bundle as Strings.
-
-
Method Summary
Modifier and Type Method Description abstract StringtoRouteString(T value)abstract TfromRouteString(String routeStr)-
-
Method Detail
-
toRouteString
abstract String toRouteString(T value)
-
fromRouteString
abstract T fromRouteString(String routeStr)
-
-
-
-