VNTNumberPickerPreference

Custom preference, which opens a dialog with a number picker

License

License

GroupId

GroupId

com.vanniktech
ArtifactId

ArtifactId

vntnumberpickerpreference
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

VNTNumberPickerPreference
Custom preference, which opens a dialog with a number picker
Project URL

Project URL

https://github.com/vanniktech/VNTNumberPickerPreference
Source Code Management

Source Code Management

https://github.com/vanniktech/VNTNumberPickerPreference

Download vntnumberpickerpreference

How to add to project

<!-- https://jarcasting.com/artifacts/com.vanniktech/vntnumberpickerpreference/ -->
<dependency>
    <groupId>com.vanniktech</groupId>
    <artifactId>vntnumberpickerpreference</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.vanniktech/vntnumberpickerpreference/
implementation 'com.vanniktech:vntnumberpickerpreference:1.0.0'
// https://jarcasting.com/artifacts/com.vanniktech/vntnumberpickerpreference/
implementation ("com.vanniktech:vntnumberpickerpreference:1.0.0")
'com.vanniktech:vntnumberpickerpreference:aar:1.0.0'
<dependency org="com.vanniktech" name="vntnumberpickerpreference" rev="1.0.0">
  <artifact name="vntnumberpickerpreference" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.vanniktech', module='vntnumberpickerpreference', version='1.0.0')
)
libraryDependencies += "com.vanniktech" % "vntnumberpickerpreference" % "1.0.0"
[com.vanniktech/vntnumberpickerpreference "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

There are no modules declared in this project.

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

Versions

Version
1.0.0