AndroidSliderPreference alternatives and similar packages
Based on the "Dialog Widget" category.
Alternatively, view AndroidSliderPreference alternatives based on common mentions on social networks and blogs.
-
android-styled-dialogs
Backport of Material dialogs with easy-to-use API based on DialogFragment -
BlurDialogFragment
Library project to display DialogFragment with a blur effect. -
spots-dialog
Android AlertDialog with moving dots progress indicator -
LicensesDialog
LicensesDialog is an open source library to display licenses of third-party libraries in an Android app. -
Android-RateThisApp
Android library to show "Rate this app" dialog -
L-Dialogs
A small library replicating the new dialogs in android L. -
FancyGifDialog-Android
Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code. -
Aesthetic Dialogs for Android 📱
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs. -
FileListerDialog
A simple file/ directory picker dialog for android -
QustomDialog
a quick custom android dialog project -
LongPressPopup
Make a Popup appear long pressing on a view and handle drag-release events on its elements -
PostOffice
This is a library for easily constructing Holo and Material Design Dialogs. -
AwesomeDialog
No description, website, or topics provided. -
SimpleDialogFragment
An Android library that provides a simple implementation of a DialogFragment -
WhatIsNewDialog
An Android library for displaying a dialog where it presents new features in the app. -
GenericDialog
A new AlertDialog for Android is here...!! -
Bottom Flux Dialog
🌠 Simple way make your beautiful dialog (Bottom Sheet Dialog) -
MonthYearPickerDialog
Dialog for Android that allows pick month and year without exact day which is impossible with standard DatePickerDialog. It has customizable UI and different modes of selecting.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of AndroidSliderPreference or a related project?
README
Android Slider Preference Library
Overview
- Slider represents a
float
between0.0
and1.0
- Access with
SliderPreference.getValue()
orSharedPreferences.getFloat()
- Access with
- Supports multiple summaries (e.g. "Low", "Medium", "High") and selects one based on the slider's position
- Java:
SliderPreference.setSummary(CharSequence[] summaries)
- XML:
android:summary="@array/string_array_of_summaries"
- A single
String
still works too
- Java:
- Subclass of
DialogPreference
- Supports all dialog-specific attributes such as
android:dialogMessage
- Visually-consistent with Android's built-in preferences
- Less error-prone than displaying the slider directly on the settings screen
- Supports all dialog-specific attributes such as
- MIT License
How To Use
Android Studio
Using Gradle
- Step: Add JitPack to your root
build.gradle
:allprojects { repositories { // [...] maven { url 'https://jitpack.io' } } }
- Step: Add the library as a dependency to your project
build.gradle
:dependencies { // [...] compile 'com.github.jayschwa:AndroidSliderPreference:v1.0.1' }
Using a Module
Paste or clone this library into the
/libs
folder, in the root directory of your project. Create a new folder:/libs
if not already present. (This step is not required - only for keeping cleaner project structure)Edit
settings.gradle
by adding the library. You also have to define a project directory for the library. Yoursettings.gradle
should look like below:include ':app', ':SliderPreference' project(':SliderPreference').projectDir = new File('libs/AndroidSliderPreference')
In
app/build.gradle
add the SliderPreference library as a dependency:dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile project(":SliderPreference") }
Sync project, clean and build. You can use the SliderPreference as part of your project now.
Eclipse
Before you can add a SliderPreference
to your application, you must first add a library reference:
- Clone or download a copy of the library
- Import the library into Eclipse: File menu -> Import -> Existing Project into Workspace
- Open your application's project properties and add a library reference to "SliderPreference"
Add a slider to your application
<!-- preferences.xml -->
<net.jayschwa.android.preference.SliderPreference
android:key="my_slider"
android:title="@string/slider_title"
android:summary="@array/slider_summaries"
android:defaultValue="@string/slider_default"
android:dialogMessage="@string/slider_message" />
<!-- strings.xml -->
<string name="slider_title">Temperature</string>
<string-array name="slider_summaries">
<!-- You can define as many summaries as you'd like -->
<!-- The active summary will reflect the preference's current value -->
<item>Freezing</item> <!-- 0.00 to 0.25 -->
<item>Chilly</item> <!-- 0.25 to 0.50 -->
<item>Warm</item> <!-- 0.50 to 0.75 -->
<item>Boiling</item> <!-- 0.75 to 1.00 -->
</string-array>
<item name="slider_default" format="float" type="string">0.5</item>
<string name="slider_message">Optional message displayed in the dialog above the slider</string>
It is possible to define the default value directly in the attribute. The summary can also be a regular string, instead of a string array:
<net.jayschwa.android.preference.SliderPreference
android:summary="This summary is static and boring"
android:defaultValue="0.5" />
Background
Sliders are recommended by Android's official design documentation for specific types of settings:
Use this pattern for a setting where the range of values are not discrete and fall along a continuum.
Despite this recommendation, the Android SDK does not actually provide a Preference
with slider functionality. Various custom implementations can be found around the web, but many have issues such as:
- The slider is displayed directly on the settings screen
- Higher chance of accidental clicks
- No way to confirm or cancel potential changes
- Discrete values are displayed to the user
- Not ideal for this design pattern
This library aims to be as consistent as possible with the design pattern and Android's built-in Preference
implementations.
License
This library is licensed under the MIT License. A copy of the license is provided in LICENSE.txt:
Copyright 2012 Jay Weisskopf
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Note that all licence references and agreements mentioned in the AndroidSliderPreference README section above
are relevant to that project's source code only.