Skip to content

Repository files navigation

constretto-android

Useful Constretto project extensions for Android. Build Status

Quickstart

1. Add annotations to your POJO

publicclassScreenPreferences {
@Configuration// implies that the preference name in the SharedPreferences store is "brightness"privateStringbrightness;
@Configuration("length") // implies that the preference name in the SharedPreferences store is "length"privateIntegerscale;
publicStringgetBrightness() {
returnbrightness; }
publicIntegergetScale() {
returnscale;
}
}

2. Create Constretto Configuration

SharedPreferencesprefs = this.getSharedPreferences("org.constretto.app", Context.MODE_PRIVATE);
ConstrettoConfigurationconf = ConstrettoAndroidBuilder.createConfigurationForSharedPreferences(prefs);

3. Inject configuration

finalScreenPreferencesscreenPreferences = configuration.as(ScreenPreferences.class);

Planned features

  • a ConfigurationStore implementation that wraps a SharedPreferences store
  • an easy way of creating a ConstrettoConfiguration object for a SharedPreferences

Follow development at the github issue tracker

About

Useful Constretto extensions for Android

Resources

Stars

1 star

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages