Android dialog with auto generated pickers inside, which depends on count of datasets provided. Made by Stfalcon

Overview

UniversalPickerDialog

Customizable dialog with auto generated pickers inside that depend on the dataset count.

alt tag

Who we are

Need iOS and Android apps, MVP development or prototyping? Contact us via [email protected]. We develop software since 2009, and we're known experts in this field. Check out our portfolio and see more libraries from stfalcon-studio.

Download

Download via Gradle:

compile 'com.github.stfalcon:universalpickerdialog:0.1.0'

or Maven:

<dependency>
  <groupId>com.github.stfalcon</groupId>
  <artifactId>universalpickerdialog</artifactId>
  <version>0.1.0</version>
  <type>pom</type>
</dependency>

Usage

Implement callback interface:

public class MainActivity extends AppCompatActivity
        implements View.OnClickListener, UniversalPickerDialog.OnPickListener {

Then implement OnPickListener.onPick(int[], int) method:

@Override
public void onPick(int[] selectedValues, int key) {
    String str = list.get(selectedValues[0]);
    Object obj = array[selectedValues[0]];

    /*do some logic*/
}

Now you can build the dialog and show it. Just add these few lines:

new UniversalPickerDialog.Builder(this)
                .setTitle(R.string.hello)
                .setListener(this)
                .setInputs(
                        new UniversalPickerDialog.Input(0, list),
                        new UniversalPickerDialog.Input(2, array)
                )
                .show();

Data set is passing to Picker using Input class that supports lists as well as arrays, so no data conversion is required :)). It takes in constructor default item position in carousel as the first argument and data set as the second.

Builder was extended by a many methods for more flexibility and convenience of use. Here's the full list (you can find the javadoc on each of these methods):

new UniversalPickerDialog.Builder(this)
                .setTitle(R.string.hello)
                .setTitle("Hello!")
                .setTitleColorRes(R.color.green)
                .setTitleColor(Color.GREEN)
                .setBackgroundColorRes(R.color.white)
                .setBackgroundColor(Color.WHITE)
                .setContentTextColorRes(R.color.green)
                .setContentTextColor(Color.GREEN)
                .setPositiveButtonText(R.string.yep)
                .setPositiveButtonText("Yep!")
                .setNegativeButtonText(R.string.nope)
                .setNegativeButtonText("Nope!")
                .setButtonsColor(R.color.green)
                .setButtonsColorRes(Color.GREEN)
                .setPositiveButtonColorRes(R.color.green)
                .setPositiveButtonColor(Color.GREEN)
                .setNegativeButtonColorRes(R.color.red)
                .setNegativeButtonColor(Color.RED)
                .setContentTextSize(16)
                .setListener(this)
                .setInputs(
                        new UniversalPickerDialog.Input(2, list),
                        new UniversalPickerDialog.Input(0, array)
                )
                .setKey(123)
                .build()
                .show();

Take a look at the sample project for more information.

License

Copyright (C) 2017 stfalcon.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

You might also like...
Android time range picker

TimeRangePicker TimeRangePicker is a library which can be used to select a time range. WARNING Requires android-support-v4 Description This library pr

Android calendar view inspired by Sunrise calendar and iOS7 stock calendar
Android calendar view inspired by Sunrise calendar and iOS7 stock calendar

SilkCal Android calendar view inspired by Sunrise calendar and iOS7 stock calendar. Usage Add compile 'me.nlmartian.silkcal:library:0.1.1' to your dep

An alternative DatePicker for Android

Copyright (C) 2011 Daniel Berndt - Codeus Ltd - DateSlider 1.1 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this

an android open source timer
an android open source timer

TimerView ENGLISH README 重要的事情 由于使用了MaskFilter,辉光效果必须[关闭硬件加速](http://blog.chenming.info/blog/2012/09/18/android-hardware-accel/)!! 由于使用了MakskFilter,辉光

FlipTimerView library for Android
FlipTimerView library for Android

FlipTimerView Preview FlipTimerView library for Android Getting started Add it in your root build.gradle at the end of repositories: allprojects { re

Easy-to-use animated clock icon for Android
Easy-to-use animated clock icon for Android

Timecon Easy-to-use animated clock icon written in Kotlin Including in your project Add to your root build.gradle: allprojects { repositories {

[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

an android open source timer
an android open source timer

TimerView ENGLISH README 重要的事情 由于使用了MaskFilter,辉光效果必须[关闭硬件加速](http://blog.chenming.info/blog/2012/09/18/android-hardware-accel/)!! 由于使用了MakskFilter,辉光

A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.
A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.

SublimePicker A customizable view that provisions picking of a date, time & recurrence option, all from a single user-interface. You can also view 'Su

Comments
  • Make some properties configurable: cancelListener, cancelable, wrapSe…

    Make some properties configurable: cancelListener, cancelable, wrapSe…

    Make some properties configurable: cancelListener, cancelable, wrapSelectorWheel.

    Also I add some sample in sample project so you can try it.

    wrapSelectorWheel for #1 .

    This library is cool and easy to use. 👍 But I am facing a situation when I want to know users click "Cancel" button or just dismiss the dialog or sometimes I don't want user to cancel it.

    Could you please accept this pr and make a new version so I can upgrade in my project.

    opened by littleylv 0
  • Disable loop on values

    Disable loop on values

    Hi,

    Thank you for your library, it works nice :) I wanted to not allow the list to be scrollable infinitly (do not loop on values). Does your library support it ?

    Thank you !

    opened by tspoke 0
Owner
Stfalcon LLC
We are Stfalcon, mobile and web development company.
Stfalcon LLC
Appleader707 1 Aug 9, 2022
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.

Android Week View Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling. Fea

Raquib-ul Alam (Kanak) 3.4k Jan 3, 2023
A Material design back port of Android's CalendarView

Material Calendar View A Material design back port of Android's CalendarView. The goal is to have a Material look and feel, rather than 100% parity wi

Prolific Interactive 5.8k Jan 5, 2023
Standalone Android widget for picking a single date from a calendar view.

TimesSquare for Android Standalone Android widget for picking a single date from a calendar view. Usage Include CalendarPickerView in your layout XML.

Square 4.4k Dec 20, 2022
Pick a date or time on Android in style

Material DateTime Picker - Select a time/date in style Material DateTime Picker tries to offer you the date and time pickers as shown in the Material

null 4.7k Jan 4, 2023
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

Code-Troopers 2.7k Dec 29, 2022
A better calendar for Android

Caldroid Caldroid is a fragment that display calendar with dates in a month. Caldroid can be used as embedded fragment, or as dialog fragment. User ca

Roomorama 1.4k Jan 5, 2023
Wheel-like spinner widget for Android

Update Dec 2016 Library is discontinued There's still a lot of wheel libraries out there. Update Oct 2014 I am thinking of rewriting this control. Upd

Dimitri Fedorov 641 Jan 2, 2023
Android calendar view (like card)

android-calendar-card (Google Play Demo) Android calendar view (like card) Simple and easy to modify Author: Michał Szwarc #CalendarCardPager License

Michał Szwarc 473 Nov 10, 2022
An calender widget for your Android home screen.

Todo Agenda - Calendar and Task widgets for Android Todo Agenda is home screen widgets for your Android device. Each widget has its own settings and d

null 368 Dec 21, 2022