1111import android .widget .Toast ;
1212
1313import com .xiasuhuei321 .loadingdialog .view .LoadingDialog ;
14+ import com .xiasuhuei321 .loadingdialog .view .SizeUtils ;
1415
1516
1617public class MainActivity extends AppCompatActivity implements View .OnClickListener {
@@ -138,6 +139,7 @@ public void onClick(View v) {
138139 .setLoadSpeed (speed )
139140 .closeFailedAnim ()
140141 .setDrawColor (color )
142+ .setSize (SizeUtils .dip2px (this , 100 ))
141143 .setRepeatCount (repeatTime )
142144 .show ();
143145 h .sendEmptyMessageDelayed (LOAD_WITHOUT_ANIM_FAILED , delayedTime );
@@ -170,7 +172,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
170172 switch (item .getItemId ()) {
171173 case R .id .delay :
172174 delayedTime = delayedTime == 1000L ? 4000L : 1000L ;
173- Toast .makeText (this , "the delayed time now is:" + delayedTime + " ms" , Toast .LENGTH_SHORT ).show ();
175+ Toast .makeText (this , "the delayed time now is:" + delayedTime + " ms" , Toast .LENGTH_LONG ).show ();
174176 break ;
175177
176178 case R .id .speed :
@@ -182,24 +184,24 @@ public boolean onOptionsItemSelected(MenuItem item) {
182184 } else {
183185 speedInfo = 2 ;
184186 }
185- Toast .makeText (this , "the speed now is:" + speedInfo , Toast .LENGTH_SHORT ).show ();
187+ Toast .makeText (this , "the speed now is:" + speedInfo , Toast .LENGTH_LONG ).show ();
186188 break ;
187189
188190 case R .id .intercept :
189191 intercept_back_event = !intercept_back_event ;
190192 if (intercept_back_event )
191- Toast .makeText (this , "now the dialog will intercept the back event" , Toast .LENGTH_SHORT ).show ();
192- else {
193- Toast .makeText (this , "now the dialog will accept the back event" , Toast .LENGTH_SHORT ).show ();
193+ Toast .makeText (this , "now the dialog will intercept the back event" , Toast .LENGTH_LONG ).show ();
194+ else {
195+ Toast .makeText (this , "now the dialog will accept the back event" , Toast .LENGTH_LONG ).show ();
194196 }
195197 break ;
196198 case R .id .repeat :
197199 repeatTime = repeatTime == 0 ? 1 : 0 ;
198- Toast .makeText (this , "now the loading callback will be draw:" + (repeatTime + 1 ) + " times" , Toast .LENGTH_SHORT ).show ();
200+ Toast .makeText (this , "now the loading callback will be draw:" + (repeatTime + 1 ) + " times" , Toast .LENGTH_LONG ).show ();
199201 break ;
200202 case R .id .color :
201203 color = color == Color .argb (100 , 255 , 255 , 255 ) ? Color .BLUE : Color .argb (100 , 255 , 255 , 255 );
202- Toast .makeText (this , "now the color is:" + color , Toast .LENGTH_SHORT ).show ();
204+ Toast .makeText (this , "now the color is:" + color , Toast .LENGTH_LONG ).show ();
203205 break ;
204206 }
205207 return true ;
0 commit comments