Skip to content
NumberPicker Preference for Android
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildscript Change task execution in deploy_snaphot Dec 6, 2015
app Update Code Quality plugin to 0.2.0 Feb 17, 2016
code_quality_tools Improve checkstyle regexp and no to mHungarian notation Feb 6, 2016
gradle/wrapper Use Gradle Maven Publish Plugin for publishing. (#49) May 25, 2018
library
.gitignore Updated Sample app May 28, 2015
.travis.yml Remove sudo: false from travis config. (#51) Nov 25, 2018
1_overview.png
2_number_picker.png Updated Sample app May 28, 2015
3_start.png Updated Sample app May 28, 2015
LICENSE Initial commit Jul 16, 2014
README.md Prune Play Store references. (#50) Jul 18, 2018
build.gradle Use Gradle Maven Publish Plugin for publishing. (#49) May 25, 2018
gradle.properties
gradlew Update to Gradle 2.13 (#39) May 15, 2016
gradlew.bat
settings.gradle Cleaned repository, added badges to README.md and fixed build Jan 23, 2015

README.md

VNTNumberPickerPreference

This is an easy to use custom preference, which opens a dialog with a number picker. The value gets automatically saved and you can set the default-, min- and maxValue conveniently in the XML.

<com.vanniktech.vntnumberpickerpreference.VNTNumberPickerPreference
    android:defaultValue="@integer/font_size_default_value"
    android:key="preference_font_size"
    android:title="@string/font_size"
    app:vnt_maxValue="@integer/font_size_max_value"
    app:vnt_minValue="@integer/font_size_min_value"
    app:vnt_setWrapSelectorWheel="true"/>

Setup

build.gradle

compile 'com.vanniktech:vntnumberpickerpreference:1.0.0'
compile 'com.vanniktech:vntnumberpickerpreference:1.0.1-SNAPSHOT'

Modules are located on Maven Central.

Go to your preference XML file and insert the above mentioned XML tag. Afterwards you are good to go and can run your project!

Get font size

SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
int fonftSize = sharedPreferences.getInt("preference_font_size", getResources().getInteger(R.integer.font_size_default_value));

Proguard

No configuration needed.

Preview

Image of VNTNumberPickerPreference

License

Copyright (C) 2014-2016 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

You can’t perform that action at this time.