55import android .graphics .Color ;
66import android .graphics .drawable .ColorDrawable ;
77import android .graphics .drawable .GradientDrawable ;
8+ import android .support .annotation .ColorInt ;
9+ import android .support .annotation .DrawableRes ;
810import android .view .View ;
911import android .view .Window ;
1012import android .widget .Button ;
2325@ SuppressWarnings ({"WeakerAcces" , "unused" })
2426public class AlertDialogBox
2527{
26- private String title , message , positiveBtnText , negativeBtnText ;
27- private Activity activity ;
28- private int icon ;
28+ private Anim Anim ;
29+ private boolean cancel ;
2930 private Icon visibility ;
30- private com .amit .dialog .Anim Anim ;
31+ private Activity activity ;
32+
3133 private AlertDialogListener pListener , nListener ;
32- private int pBtnColor , nBtnColor , bgColor ;
33- private boolean cancel ;
34+ private String title , message , positiveBtnText , negativeBtnText ;
35+
36+ @ DrawableRes
37+ private int icon ;
38+
39+ @ ColorInt
40+ private int pBtnColor , nBtnColor , bgColor , pBtnTextColor , nBtnTextColor ;
3441
3542 private AlertDialogBox (Builder builder )
3643 {
44+ this .icon = builder .icon ;
45+ this .Anim = builder .Anim ;
3746 this .title = builder .title ;
47+ this .cancel = builder .cancel ;
48+
3849 this .message = builder .message ;
50+ this .bgColor = builder .bgColor ;
3951 this .activity = builder .activity ;
40- this .icon = builder .icon ;
41- this .Anim = builder .Anim ;
42- this .visibility = builder .visibility ;
52+
4353 this .pListener = builder .pListener ;
4454 this .nListener = builder .nListener ;
45- this .positiveBtnText = builder .positiveBtnText ;
46- this .negativeBtnText = builder .negativeBtnText ;
55+
4756 this .pBtnColor = builder .pBtnColor ;
4857 this .nBtnColor = builder .nBtnColor ;
49- this .bgColor = builder .bgColor ;
50- this .cancel = builder .cancel ;
51- }
58+ this .visibility = builder .visibility ;
5259
60+ this .pBtnTextColor = builder .pBtnTextColor ;
61+ this .nBtnTextColor = builder .nBtnTextColor ;
62+
63+ this .positiveBtnText = builder .positiveBtnText ;
64+ this .negativeBtnText = builder .negativeBtnText ;
65+ }
5366
5467 public static class Builder
5568 {
56- private String title , message , positiveBtnText , negativeBtnText ;
57- private Activity activity ;
58- private int icon ;
69+ private Anim Anim ;
5970 private Icon visibility ;
60- private com .amit .dialog .Anim Anim ;
61- private AlertDialogListener pListener , nListener ;
62- private int pBtnColor , nBtnColor , bgColor ;
71+ private Activity activity ;
72+
6373 private boolean cancel ;
74+ private AlertDialogListener pListener , nListener ;
75+ private String title , message , positiveBtnText , negativeBtnText ;
76+
77+ @ DrawableRes private int icon ;
78+ @ ColorInt private int pBtnColor , pBtnTextColor , nBtnColor , nBtnTextColor , bgColor ;
6479
6580 public Builder (Activity activity )
6681 {
@@ -91,6 +106,12 @@ public Builder setPositiveBtnText(String positiveBtnText)
91106 return this ;
92107 }
93108
109+ public Builder setPositiveBtnTextColor (int pBtnTextColor )
110+ {
111+ this .pBtnTextColor = pBtnTextColor ;
112+ return this ;
113+ }
114+
94115 public Builder setPositiveBtnBackground (int pBtnColor )
95116 {
96117 this .pBtnColor = pBtnColor ;
@@ -103,6 +124,12 @@ public Builder setNegativeBtnText(String negativeBtnText)
103124 return this ;
104125 }
105126
127+ public Builder setNegativeBtnTextColor (int nBtnTextColor )
128+ {
129+ this .nBtnTextColor = nBtnTextColor ;
130+ return this ;
131+ }
132+
106133 public Builder setNegativeBtnBackground (int nBtnColor )
107134 {
108135 this .nBtnColor = nBtnColor ;
@@ -195,12 +222,22 @@ else if (Anim == SLIDE)
195222 bgShape .setColor (pBtnColor );
196223 }
197224
225+ if (pBtnTextColor != 0 )
226+ {
227+ pBtn .setTextColor (pBtnTextColor );
228+ }
229+
198230 if (nBtnColor != 0 )
199231 {
200232 GradientDrawable bgShape = (GradientDrawable ) nBtn .getBackground ();
201233 bgShape .setColor (nBtnColor );
202234 }
203235
236+ if (nBtnTextColor != 0 )
237+ {
238+ nBtn .setTextColor (nBtnTextColor );
239+ }
240+
204241 if (negativeBtnText != null )
205242 {
206243 nBtn .setText (negativeBtnText );
0 commit comments