Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
/ Preference Public archive

User-friendly DSL to work with Android Shared Preferences

License

Notifications You must be signed in to change notification settings

Fi5t/Preference

Repository files navigation

Preference[Deprecated]

Yeah, well, I'm gonna go build my own Android reality, with preference and poetesses

Preference is a little library that allows you to work with shared preferences via user-friendly DSL. It lets you forget about awful boilerplate code that you used to write for working with shared preferences in Android. It is written in Kotlin.

Including in your project

repositories {
    mavenCentral()
}

dependencies {
    compile 'ru.freedomlogic:preference:0.2@aar'
}

Import ru.freedomlogic.preference.* to use Preference DSL in your classes.

Usage

Editing shared preferences

	preferencesEditor(
		"server"  to "http://github.com"
		"port"    to 80
	)

Reading shared preferences

	val remoteHost = RemoteHost()

	preferences {
		with(remoteHost) {
			server = getString("server")
			port   = getInt("port")
		}
	}

Contribute

I accept every meaningful pull request that you might offer. All issues will be reviewed and taken into account.

About

User-friendly DSL to work with Android Shared Preferences

Resources

License

Stars

Watchers

Forks

Packages

No packages published