Package 

Class DelegatesKt

    • Method Detail

      • asProperty

         final static <T extends Any> ReadWriteProperty<Object, T> asProperty(Preferences $self, KSerializer<T> serializer, String tag)

        Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.

        var setting by preferences.asProperty(Boolean.serializer())
        Parameters:
        serializer - which encodes and decodes the value
        tag - optional tag which is used as SharedPreferences key - default to property name
      • asProperty

         final static <T extends Any> ReadWriteProperty<Object, T> asProperty(Preferences $self, String tag)

        Encodes changes to the delegated property into the SharedPreferences and decodes the current value from them.

        var setting: Boolean by preferences.asProperty()
        Parameters:
        tag - optional tag which is used as SharedPreferences key - default to property name