|
6 | 6 | import android.content.Context; |
7 | 7 | import android.content.res.TypedArray; |
8 | 8 | import android.graphics.PorterDuff; |
9 | | -import android.graphics.drawable.Drawable; |
10 | 9 | import android.graphics.drawable.GradientDrawable; |
11 | 10 | import android.os.Build; |
12 | 11 | import android.os.Handler; |
13 | 12 | import android.support.annotation.ColorInt; |
14 | 13 | import android.support.annotation.Dimension; |
15 | 14 | import android.support.annotation.Nullable; |
16 | 15 | import android.support.v4.content.ContextCompat; |
| 16 | +import android.support.v7.widget.AppCompatImageView; |
17 | 17 | import android.util.AttributeSet; |
18 | 18 | import android.util.TypedValue; |
19 | 19 | import android.view.LayoutInflater; |
@@ -346,17 +346,17 @@ private void showProgressBar() { |
346 | 346 | public void showResultIcon(boolean isSuccess) { |
347 | 347 | animateFadeHide(context, progressBar); |
348 | 348 |
|
349 | | - final ImageView failureIcon = new ImageView(context); |
| 349 | + final AppCompatImageView failureIcon = new AppCompatImageView(context); |
350 | 350 | RelativeLayout.LayoutParams icLayoutParams = |
351 | 351 | new RelativeLayout.LayoutParams(dpToPx(50), dpToPx(50)); |
352 | 352 | failureIcon.setLayoutParams(icLayoutParams); |
353 | 353 | failureIcon.setVisibility(GONE); |
354 | | - Drawable icon; |
| 354 | + int icon; |
355 | 355 | if (isSuccess) |
356 | | - icon = ContextCompat.getDrawable(context, R.drawable.ic_check_circle_36dp); |
| 356 | + icon = R.drawable.ic_check_circle_36dp; |
357 | 357 | else |
358 | | - icon = ContextCompat.getDrawable(context, R.drawable.ic_cancel_full_24dp); |
359 | | - failureIcon.setImageDrawable(icon); |
| 358 | + icon = R.drawable.ic_cancel_full_24dp; |
| 359 | + failureIcon.setImageResource(icon); |
360 | 360 | contentContainer.addView(failureIcon); |
361 | 361 | animateFadeShow(context, failureIcon); |
362 | 362 |
|
|
0 commit comments