SizeSerializer


public final class SizeSerializer implements KSerializer


A serializer for Size. This serializer uses SavedState's API directly to save/load a Size.

Note that this serializer should be used with SavedStateEncoder or SavedStateDecoder only. Using it with other Encoders/Decoders may throw IllegalArgumentException.

import androidx.savedstate.serialization.serializers.SizeSerializer

@Serializable
data class MyModel(@Serializable(with = SizeSerializer::class) val size: android.util.Size)

Summary

Public constructors

Public constructors

SizeSerializer

Added in 1.3.0-alpha06
public SizeSerializer()

Public methods

deserialize

Added in 1.3.0-alpha06
public @NonNull Size deserialize(@NonNull Decoder decoder)

getDescriptor

Added in 1.3.0-alpha06
public @NonNull SerialDescriptor getDescriptor()

serialize

Added in 1.3.0-alpha06
public void serialize(@NonNull Encoder encoder, @NonNull Size value)