Prefs+ Demo

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

com.mapzen.android
ArtifactId

ArtifactId

prefs-plus-demo
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

apk
Description

Description

Prefs+ Demo
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project Organization

Project Organization

Mapzen

Download prefs-plus-demo

Dependencies

compile (1)

Group / Artifact Type Version
com.mapzen.android : prefs-plus jar 1.0.0

provided (1)

Group / Artifact Type Version
com.google.android : android jar 4.1.1.4

Project Modules

There are no modules declared in this project.

Prefs+

An extension for Android preferences that creates additional preference types including EditIntPreference, EditFloatPreference, and IntListPreference.

Values entered by the user are validated, parsed, and stored as the correct primitive type in SharedPreferences.

The current value is displayed in the summary (subtitle) of each preference view.

This project also provides an extended version of EditTextPreference called EditTextPlusPreference that displays the current value in the summary for string preferences too.

Usage

preferences.xml

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <com.mapzen.prefsplus.EditIntPreference
        android:key="@string/integer_key"
        android:title="Integer"
        android:dialogTitle="Enter an integer value"
        android:defaultValue="42" />

    <com.mapzen.prefsplus.EditFloatPreference
        android:key="@string/float_key"
        android:title="Float"
        android:dialogTitle="Enter a float value"
        android:defaultValue="3.14159" />

    <com.mapzen.prefsplus.IntListPreference
        android:key="@string/integer_list_key"
        android:title="Integer List"
        android:dialogTitle="Select from the following list"
        android:entries="@array/int_list_entries"
        android:entryValues="@array/int_list_values"
        android:defaultValue="1" />

    <com.mapzen.prefsplus.EditTextPlusPreference
        android:key="@string/text_key"
        android:title="Text"
        android:dialogTitle="Enter a string"
        android:defaultValue="default" />

</PreferenceScreen>

PreferenceFragment

PreferenceFragment

EditIntPreference

EditIntPreference

EditFloatPreference

EditFloatPreference

IntListPreference

IntListPreference

EditTextPlusPreference

EditTextPlusPreference

Install

Download Jar

Download the latest JAR.

Maven

Include dependency using Maven.

<dependency>
  <groupId>com.mapzen.android</groupId>
  <artifactId>prefs-plus</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle

Include dependency using Gradle.

compile 'com.mapzen.android:prefs-plus:1.0.0'
com.mapzen.android

Mapzen

Versions

Version
1.0.0