Prefs+ Parent

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-parent
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

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

Project Organization

Mapzen
Source Code Management

Source Code Management

http://github.com/mapzen/prefs-plus

Download prefs-plus-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.mapzen.android/prefs-plus-parent/ -->
<dependency>
    <groupId>com.mapzen.android</groupId>
    <artifactId>prefs-plus-parent</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.mapzen.android/prefs-plus-parent/
implementation 'com.mapzen.android:prefs-plus-parent:1.0.0'
// https://jarcasting.com/artifacts/com.mapzen.android/prefs-plus-parent/
implementation ("com.mapzen.android:prefs-plus-parent:1.0.0")
'com.mapzen.android:prefs-plus-parent:pom:1.0.0'
<dependency org="com.mapzen.android" name="prefs-plus-parent" rev="1.0.0">
  <artifact name="prefs-plus-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.mapzen.android', module='prefs-plus-parent', version='1.0.0')
)
libraryDependencies += "com.mapzen.android" % "prefs-plus-parent" % "1.0.0"
[com.mapzen.android/prefs-plus-parent "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • prefs-plus
  • prefs-plus-demo

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