22
33import android .annotation .TargetApi ;
44import android .content .Context ;
5- import android .graphics .drawable .GradientDrawable ;
6- import android .graphics .drawable .ShapeDrawable ;
75import android .os .Build ;
86import android .view .LayoutInflater ;
97import android .view .View ;
108import android .widget .Button ;
119import android .widget .IconTextView ;
12- import android .widget .ImageView ;
1310import android .widget .LinearLayout ;
1411import android .widget .Toast ;
15- import com .joanzapata .android .iconify .IconDrawable ;
16- import com .joanzapata .android .iconify .Iconify ;
1712
1813/*
1914* Copyright (C) 2015 Pierry Borges
@@ -52,16 +47,17 @@ public static void ok(Context context, String msg) {
5247 mytoast .show ();
5348 }
5449
55- @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void ok (Context context , String msg , Iconify .IconValue iconValue ) {
50+ @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void ok (Context context , String msg ,
51+ String icon ) {
5652 LayoutInflater myInflater = LayoutInflater .from (context );
5753 View view = myInflater .inflate (R .layout .toast_ok_icon , null );
5854
5955 Button button = (Button ) view .findViewById (R .id .button );
6056 button .setText (msg );
6157
6258 IconTextView img = (IconTextView ) view .findViewById (R .id .img );
63- img .setBackground ( new IconDrawable ( context , iconValue )
64- . colorRes ( R . color . white ). actionBarSize () );
59+ img .setText ( icon );
60+ img . setTextSize ( 20 );
6561
6662 Toast mytoast = new Toast (context );
6763
@@ -84,16 +80,17 @@ public static void error(Context context, String msg) {
8480 mytoast .show ();
8581 }
8682
87- @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void error (Context context , String msg , Iconify .IconValue iconValue ) {
83+ @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void error (Context context , String msg ,
84+ String icon ) {
8885 LayoutInflater myInflater = LayoutInflater .from (context );
8986 View view = myInflater .inflate (R .layout .toast_error_icon , null );
9087
9188 Button button = (Button ) view .findViewById (R .id .button );
9289 button .setText (msg );
9390
9491 IconTextView img = (IconTextView ) view .findViewById (R .id .img );
95- img .setBackground ( new IconDrawable ( context , iconValue )
96- . colorRes ( R . color . white ). actionBarSize () );
92+ img .setText ( icon );
93+ img . setTextSize ( 20 );
9794
9895 Toast mytoast = new Toast (context );
9996
@@ -116,16 +113,50 @@ public static void info(Context context, String msg) {
116113 mytoast .show ();
117114 }
118115
119- @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void info (Context context , String msg , Iconify .IconValue iconValue ) {
116+ @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void info (Context context , String msg ,
117+ String icon ) {
120118 LayoutInflater myInflater = LayoutInflater .from (context );
121119 View view = myInflater .inflate (R .layout .toast_info_icon , null );
122120
123121 Button button = (Button ) view .findViewById (R .id .button );
124122 button .setText (msg );
125123
126124 IconTextView img = (IconTextView ) view .findViewById (R .id .img );
127- img .setBackground (new IconDrawable (context , iconValue )
128- .colorRes (R .color .white ).actionBarSize ());
125+ img .setText (icon );
126+ img .setTextSize (20 );
127+
128+ Toast mytoast = new Toast (context );
129+
130+ mytoast .setView (view );
131+ mytoast .setDuration (Toast .LENGTH_SHORT );
132+ mytoast .show ();
133+ }
134+
135+ public static void muted (Context context , String msg ) {
136+ LayoutInflater myInflater = LayoutInflater .from (context );
137+ View view = myInflater .inflate (R .layout .toast_muted , null );
138+
139+ Button button = (Button ) view .findViewById (R .id .button );
140+ button .setText (msg );
141+
142+ Toast mytoast = new Toast (context );
143+
144+ mytoast .setView (view );
145+ mytoast .setDuration (Toast .LENGTH_SHORT );
146+ mytoast .show ();
147+ }
148+
149+ @ TargetApi (Build .VERSION_CODES .JELLY_BEAN ) public static void muted (Context context , String msg ,
150+ String icon ) {
151+ LayoutInflater myInflater = LayoutInflater .from (context );
152+ View view = myInflater .inflate (R .layout .toast_muted_icon , null );
153+
154+ Button button = (Button ) view .findViewById (R .id .button );
155+ button .setText (msg );
156+
157+ IconTextView img = (IconTextView ) view .findViewById (R .id .img );
158+ img .setText (icon );
159+ img .setTextSize (20 );
129160
130161 Toast mytoast = new Toast (context );
131162
0 commit comments