Você está na página 1de 7

SimpleDialogFragments (/details/1/5272)

 56 (https://github.com/eltos/SimpleDialogFragments/stargazers?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=5272) 5

(https://github.com/eltos/SimpleDialogFragments/watchers?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=5272)  15

(https://github.com/eltos/SimpleDialogFragments/network?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=5272)  4

(https://github.com/eltos/SimpleDialogFragments/issues?utm_source=android-

arsenal.com&utm_medium=referral&utm_campaign=5272)

 (https://facebook.com/sharer.php?
General u=https://android-
Category
arsenal.com/details/1/5272)
Free (/free)

Tag
 (https://twitter.com/intent/twe
arsenal.com/details/1/5272&text=The%20An
Dialogs (/tag/30)

License

%20SimpleDialogFragments
Apache License, Version 2.0 (http://opensource.org/licenses/Apache-2.0?utm_source=android-arsenal.co
m&utm_medium=referral&utm_campaign=5272)

 (http://news.ycombinator.com/submitlink
Min SDK
11 (Android 3.0 Honeycomb) (/api?level=11)
arsenal.com/details/1/5272&t=The%20Andro
Registered
Feb 12, 2017 %20Dialogs%20-%20Simp
Favorites
9

Link
https://github.com/eltos/SimpleDialogFragments (https://github.com/eltos/SimpleDialogFragments?utm_s
ource=android-arsenal.com&utm_medium=referral&utm_campaign=5272)

See also
PostOffice (/details/1/1024)
Easy Native Dialog (/details/1/6525)
Calculator Dialog (/details/1/6824)
 (https://plus.google.com/share?
Heins Input Dialogs (/details/1/4802)
SearchableSpinner (/details/1/5718)
url=https://android-
Additional arsenal.com/details/1/5272)
Language
Java
 (https://reddit.com/subm
arsenal.com/details/1/5272&title=The%20An
Version
%20Dialogs%20-%20Sim
v3.0 (Aug 21, 2018) (https://github.com/eltos/SimpleDialogFragments/releases/tag/v3.0?utm_source=and
roid-arsenal.com&utm_medium=referral&utm_campaign=5272)

Created
Jan 1, 2017

Updated
Aug 27, 2018

Owner
Philipp Niedermayer (eltos) (/user/eltos)

Contributors
4 (https://github.com/eltos/SimpleDialogFragments/graphs/contributors?utm_source=android-arsenal.com
&utm_medium=referral&utm_campaign=5272)

Activity

Badge
 Generate

Download
 Source code

Blurb
¡FELICIDADES!
USUARIO 1.000.000
Nuestro sistema aleatorio de
selección de ganadores podría
elegirte como ganador de un
SMARTPHONE
ONLINE: 16/09/2018 15:00

CLICA AQUI
©fabricadepremios

  

A Free stand-alone desktop


application designed to be
CodePilot.ai the best search experience
possible.

(https://github.com/eltos/SimpleDialogFragments/raw/master/media/logo_named_right.png?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272)

SimpleDialogFragments

API 14+ (https://developer.android.com/about/dashboards/index.html#Platform) Download 3.0


(https://bintray.com/eltos/simpledialogfragments/SimpleDialogFragment/_latestVersion?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272) JitPack v3.0
(https://jitpack.io/#eltos/SimpleDialogFragments)
(https://codeclimate.com/github/eltos/SimpleDialogFragments?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272) build passing (https://travis-
ci.org/eltos/SimpleDialogFragments?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272) license Apache-2.0
(https://github.com/eltos/SimpleDialogFragments#license)

(https://github.com/eltos/SimpleDialogFragments/raw/master/media/screenshot.png?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272)

SimpleDialogFragments Library is a collection of easy to use and extendable DialogFragment's for


Android. It is fully compatible with rotation changes and can be implemented with only a few lines
of code.
A new approach of result handling ensures data integrity
over rotation changes, that many other libraries lack.

Version history and JavaDoc API


(https://eltos.github.io/SimpleDialogFragments/?
utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)
Screenshots
(https://github.com/eltos/SimpleDialogFragments/wiki/Sho
wcase?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)
Demo APK
(https://github.com/eltos/SimpleDialogFragments/raw/mast
er/simpledialogfragments%20testApp%20v2.4.apk?
utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)

Features
Common dialogs like
Alert dialogs with optional checkbox
Input dialogs with suggestions and validations
Filterable single- / multi-choice dialogs
Color pickers
Form dialogs
Date and time pickers
Pin code dialog
Customizable and extendable dialogs
Material design
Easy resut handling even after rotation changes
Persistant on rotation

Usage

In your build.gradle file* (https://github.com/eltos/SimpleDialogFragments/wiki/Repository-Info?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272):

dependencies {
compile 'com.github.eltos:simpledialogfragment:3.0'
}

Examples
Alert dialog
SimpleDialog.build()
.title(R.string.hello)
.msg(R.string.hello_world)
.show(this);

Choice dialog

int[] data = new int[]{R.string.choice_A, R.string.choice_B, R.string.choice_C};

SimpleListDialog.build()
.title(R.string.select_one)
.choiceMode(ListView.CHOICE_MODE_SINGLE_DIRECT)
.items(getBaseContext(), data)
.show(this, LIST_DIALOG);

Color picker

SimpleColorDialog.build()
.title(R.string.pick_a_color)
.colorPreset(Color.RED)
.allowCustom(true)
.show(this, COLOR_DIALOG);

Form dialog

SimpleFormDialog.build()
.title(R.string.register)
.msg(R.string.please_fill_in_form)
.fields(
Input.name(USERNAME).required().hint(R.string.username).validatePat
Input.password(PASSWORD).required().max(20).validatePatternStrongPa
Input.email(EMAIL).required(),
Input.plain(COUNTRY).hint(R.string.country)
.inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLA
.suggest(R.array.countries_locale).forceSuggestion(),
Check.box(null).label(R.string.terms_accept).required()
)
.show(this, REGISTRATION_DIALOG);

See Wiki (https://github.com/eltos/SimpleDialogFragments/wiki?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=5272) for more examples.

Receive Results
Let the hosting Activity or Fragment implement the SimpleDialog.OnDialogResultListener
@Override
public boolean onResult(@NonNull String dialogTag, int which, @NonNull Bundle extras) {
if (which == BUTTON_POSITIVE && PASSWORD_DIALOG.equals(dialogTag)){
String pw = extras.getString(SimpleInputDialogFragment.TEXT);
// ...
return true;
}
if (which == BUTTON_POSITIVE && LIST_DIALOG.equals(dialogTag)){
ArrayList<Integer> pos = extras.getIntegerArrayList(SimpleListDialog.SELECTED_POSIT
// ...
return true;
}
if (which == BUTTON_POSITIVE && REGISTRATION_DIALOG.equals(dialogTag)){
String username = extras.getString(USERNAME);
String password = extras.getString(PASSWORD);
// ...
return true;
}
// ...
return false;
}

Make sure to check the demo application.

Extensions

Known extensions and projects using this library:

File/Folder picker (https://github.com/isabsent/FilePicker?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=5272) (see #30
(https://github.com/eltos/SimpleDialogFragments/issues/30?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272))

License

Copyright 2018 Philipp Niedermayer (github.com/eltos (https://github.com/eltos?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272))

Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0?


utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272)

You may only use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software in compliance with the License. For more information visit
http://www.apache.org/licenses/LICENSE-2.0 (http://www.apache.org/licenses/LICENSE-2.0?
utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=5272) The above
copyright notice alongside a copy of the Apache License shall be included in all copies or
substantial portions of the Software not only in source code but also in a license listing accessible
by the user.

I would appreciate being notified when you release an application that uses this library. Thanks!
Follow us on Twitter (https://twitter.com/Android_Arsenal?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)

Read us in Telegram (https://telegram.me/AndroidArsenal?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=5272)

Get Android app on Google Play (https://play.google.com/store/apps/details?


id=com.android_arsenal.androidarsenal&utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)

Stay informed with Pushbullet (https://www.pushbullet.com/channel?tag=android_arsenal&utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=5272)

Created by Vladislav Bauer (https://github.com/vbauer?utm_source=android-


arsenal.com&utm_medium=referral&utm_campaign=5272)
 (https://twitter.com/BauerVlad?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)
 (https://www.linkedin.com/in/vladislavbauer?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)
 (https://www.paypal.me/VladislavBauer?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=5272)
© 2014-2018 - Android Arsenal (/) | Privacy (/privacy)

Você também pode gostar