@@ -31,21 +31,20 @@ Provides you easily create various pop-up dialogs that you can use.
3131
3232> Create ` FastDialog ` use to ` FastDialogBuilder `
3333``` java
34- FastDialog dialog = new FastDialogBuilder (this )
34+ FastDialog dialog = new FastDialogBuilder (this , Type type )
3535```
36- > Functions
36+ > FastDialogBuilder Functions
3737``` java
38- progressDialog(String progressString) // sets the fast-dialog as a progress dialog
39- setTitle(String title) // set fast-dialog title
40- withIcon() // set visible to ImageView gif on fast-dialog
38+ progressText(String progressString) // sets progress dialog text
39+ setTitleText(String title) // set fast-dialog title
40+ hideTitle() // hide title
41+ hideIcon() // hide to ImageView gif on fast-dialog
4142 setText(String text) // set fast-dialog TextView
4243 setHint(String hint) // set fast-dialog EditText's hint
4344 negativeText(String negative) // set negative button on fast-dialog and set button text
4445 possitiveText(String possitive) // set possitive button on fast-dialog and set button text
4546 cancelable(boolean bool) // set cancelable to fast-dialog
46- decimalEditText(boolean bool) // set EditText to decimalEditText
47- possitiveClickListener(PossitiveClick click) // set listener to possitive button
48- negativeClickListener(NegativeClick click) // set listener to negative button
47+ decimalEditText() // set EditText to decimalEditText
4948 changeColor(int colorButtonsAndTitle,int colorButtonsAndTitleText,int colorPrimaryText) // change fast-dialog colors
5049 // Animations
5150 setAnimation(Animations animation)
@@ -66,63 +65,123 @@ Provides you easily create various pop-up dialogs that you can use.
6665 create() // create fast-dialog
6766```
6867
68+ > FastDialog Functions
69+
70+ ``` java
71+ i(this ) // create information dialog
72+ e(this ) // create error dialog
73+ w(this ) // create warning dialog
74+ d(this ) // create normal dialog
75+ p(this ) // create progress dialog
76+ possitiveClickListener(PossitiveClick click) // set listener to possitive button
77+ negativeClickListener(NegativeClick click) // set listener to negative button
78+ show() // show dialog
79+ dismiss() // dismiss dialog
80+ getInputText() // get dialog EditText's text
81+
82+ ```
6983## Examples
7084> Simple Progress Dialog
7185``` java
72- FastDialog dialog = new FastDialogBuilder (this )
73- .progressDialog(" Please Wait!" ). create();
74- dialog. show();
86+ FastDialog . p(this ). progressText(" Please Wait!" ). create(). show();
7587```
7688<img width =" 300px " src =" images/progress.gif " align =" center " />
7789
78- > Warning Dialog
90+ > Simple Error Dialog
91+ ``` java
92+ FastDialog . e(this )
93+ .setText(" Error Dialog" )
94+ .hideTitle()
95+ .create()
96+ .show();
97+ ```
98+ <img width =" 300px " src =" images/error1.png " align =" center " />
99+
100+ > Error Dialog 2
79101``` java
80- FastDialog dialog = new FastDialogBuilder (this )
81- .setText(" Warning" )
82- .withIcon()
83- .create();
84- dialog. show();
102+ FastDialog . e(this )
103+ .setText(" Error Message" )
104+ .hideIcon()
105+ .positiveText(" OK" )
106+ .create()
107+ .show();
85108```
86- <img width =" 300px " src =" images/warning .png " align =" center " />
109+ <img width =" 300px " src =" images/error2 .png " align =" center " />
87110
88- > Warning Dialog position center, grown in animation and changed colors
111+ > Warning Dialog position center, grown in animation with EditText
89112``` java
90- FastDialog dialog = new FastDialogBuilder (this )
91- .setTitle (" Warning" )
113+ FastDialog . w (this )
114+ .setTitleText (" Warning" )
92115 .setText(" Warning Text" )
93- .changeColor(ContextCompat . getColor(getApplicationContext(),R . color. colorAccent),
94- ContextCompat . getColor(getApplicationContext(),R . color. colorSecondaryText),
95- ContextCompat . getColor(getApplicationContext(),R . color. colorPrimaryText))
96116 .setHint(" please enter text" )
97117 .setAnimation(Animations . GROW_IN )
118+ .positiveText(" Accept" )
119+ .create()
120+ .show();
121+ ```
122+ <img width =" 300px " src =" images/warning.gif " align =" center " />
123+
124+ > Normal Dialog position center, fade in animation with DecimalEditText
125+ ``` java
126+ FastDialog . d(this )
127+ .setTitleText(" Dialog" )
128+ .setText(" Dialog Text" )
129+ .setHint(" please enter number" )
130+ .decimalEditText()
131+ .setAnimation(Animations . FADE_IN )
132+ .positiveText(" Ok" )
98133 .negativeText(" Cancel" )
99- .create();
100- dialog . show();
134+ .create()
135+ .show();
101136```
102- <img width =" 300px " src =" images/color_dialog .gif " align =" center " />
137+ <img width =" 300px " src =" images/input_number .gif " align =" center " />
103138
104- > Warning Dialog position bottom, slide bottom animation and listener possitive button
139+ > Information Dialog position bottom, slide bottom animation and listener possitive button
105140``` java
106- FastDialog dialog = new FastDialogBuilder (this )
107- .setTitle( " Warning " )
108- .setText(" Warning Text" )
109- .possitiveText (" Ok" )
141+ FastDialog dialog = new FastDialogBuilder (this , Type . INFO )
142+ .setTitleText( " Information " )
143+ .setText(" Information Text" )
144+ .positiveText (" Ok" )
110145 .negativeText(" Cancel" )
111- .withIcon()
112146 .setAnimation(Animations . SLIDE_BOTTOM )
113147 .setPosition(Positions . BOTTOM )
114- .possitiveClickListener(new PossitiveClick () {
115- @Override
116- public void onClick (View view ) {
117- Toast . makeText(MainActivity . this ," Ok Pressed" ,Toast . LENGTH_SHORT ). show();
118- dialog. dismiss();
119- }
120- })
121148 .create();
149+ dialog. positiveClickListener(new PositiveClick () {
150+ @Override
151+ public void onClick (View view ) {
152+ Toast . makeText(MainActivity . this ," Ok Pressed" ,Toast . LENGTH_SHORT ). show();
153+ dialog. dismiss();
154+ }
155+ });
122156 dialog. show();
123157```
124158<img width =" 300px " src =" images/bottom_dialog.gif " align =" center " />
125159
160+ > Warning Colored Dialog position top, slide top animation and listener possitive button
161+ ``` java
162+ FastDialog dialog= new FastDialogBuilder (this ,Type . DIALOG )
163+ .setTitleText(" Warning" )
164+ .setText(" Warning Text" )
165+ .positiveText(" Ok" )
166+ .negativeText(" Cancel" )
167+ .changeColor(ContextCompat . getColor(getApplicationContext(),R . color. different),
168+ ContextCompat . getColor(getApplicationContext(),R . color. text2),
169+ ContextCompat . getColor(getApplicationContext(),R . color. text))
170+ .setHint(" please enter your name" )
171+ .setAnimation(Animations . SLIDE_TOP )
172+ .setPosition(Positions . TOP )
173+ .create();
174+ dialog. positiveClickListener(new PositiveClick () {
175+ @Override
176+ public void onClick (View view ) {
177+ dialog. dismiss();
178+ Toast . makeText(MainActivity . this ,dialog. getInputText(). equals(" " )? " EditText is Empty" : dialog. getInputText(),Toast . LENGTH_SHORT ). show();
179+ }
180+ });
181+ dialog. show();
182+ ```
183+ <img width =" 300px " src =" images/top_dialog.gif " align =" center " />
184+
126185## License
127186
128187- Copyright 2018 © Enes Karpuzoğlu.
0 commit comments