Two Step Picker Dialog


Source link: https://github.com/aliab/Two-Step-Picker-Dialog

Two Step Picker Dialog For Android

Description

Two step picker dialog for Android that helps you easily pick nested data on android.

Usage

To use two step picker dialog you must add it as a dependency in your Gradle build:

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {

repositories {

 ...
 maven {
 url "https://jitpack.io" 
}

}
  
}

Step 2. Add the dependency

dependencies {

  compile 'com.github.aliab:Two-Step-Picker-Dialog:V1.1.0' 
}

Then add the this to your java code:

 new TwoStepPickerDialog

.Builder(this)

.withBaseData(baseData)

.withStepData(stepData) // if you want to pass step data dynamically, don't pass it in builder

.withOkButton("Get Me")

.withCancelButton("Cancel It")

.withBaseOnLeft(true) // if you want it RTL like, set it to false

.withInitialBaseSelected(0)

.withInitialStepSelected(0)

.withOnStepDataRequested(new OnStepDataRequestedListener() {

 @Override

 public List<String> onStepDataRequest(int baseDataPos) {

  ... // return list of string base on your database/webservice ...

 
}

}
)

.withDialogListener(new OnStepPickListener() {

 @Override

 public void onStepPicked(int step, int pos) {

  // get position of picked data

 
}

  @Override

 public void onDismissed() {

  // know that user dismissed dialog

 
}

}
)

.build();

Public Builder Methods

Name Description
withDialogListener(OnStepPickListener listener) Get dialog actions
withOkButton(String okButton) Set dialog positive button string
withCancelButton(String cancelButton) Set dialog negative button string
withBaseData(List baseData) Set Base data of picker
withStepData(List<List> stepData) Set static data for steps - don't pass it if you implement OnStepDataRequestedListener
withBaseOnLeft(boolean b) If you want to show view RTL like, pass true
withOnStepDataRequested(OnStepDataRequestedListener onStepDataRequestedListener) Set in step picker listener for return dynamic data
withInitialBaseSelected(int i); Set selected base data item when dialog appears
withInitialStepSelected(int i) Set selected step data item when dialog appears

Changelog

v1.1.0

  • Ability to choose initial value

v1.0.1

  • clean up manifest

v1.0.0

  • Initial release

License


 The MIT License (MIT)  Copyright (c) 2017 Ali Abdolahi  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.  

Resources

Material Design EditText with a delightful linear ripple in background.

Vertically ViewPager and vertically transformer for Android.

An easy way to test performance, security and functionality on real devices.

Upload your .apk today and Monkop will test it for you. Get detailed report in your inbox in less than 24 hrs!

Convert OkHttp requests into curl logs.

IntelliJ/AndroidStudio plugin which provides a button to connect your Android device over WiFi to install, run and debug your applications without a USB connected.

Smash is Volley-inspired networking library that's using OkHttp in its core.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes