|
16 | 16 |
|
17 | 17 | package com.hippo.widget; |
18 | 18 |
|
19 | | -import static com.hippo.ehviewer.client.EhUrl.DOMAIN_E; |
20 | | -import static com.hippo.ehviewer.client.EhUrl.DOMAIN_EX; |
21 | | - |
22 | 19 | import android.content.Context; |
23 | 20 | import android.content.res.TypedArray; |
24 | | -import android.graphics.Bitmap; |
25 | 21 | import android.graphics.Color; |
26 | 22 | import android.graphics.drawable.Animatable; |
27 | 23 | import android.graphics.drawable.AnimatedImageDrawable; |
28 | | -import android.graphics.drawable.BitmapDrawable; |
29 | 24 | import android.graphics.drawable.ColorDrawable; |
30 | 25 | import android.graphics.drawable.Drawable; |
31 | 26 | import android.graphics.drawable.TransitionDrawable; |
|
62 | 57 | public class LoadImageView extends FixedAspectImageView implements Unikery<Image>, |
63 | 58 | View.OnClickListener, View.OnLongClickListener, Animatable { |
64 | 59 |
|
65 | | - public enum LoadSource { |
66 | | - DOWNLOAD_LIST, DEFAULT |
67 | | - } |
68 | | - |
69 | | - |
70 | 60 | public static final int RETRY_TYPE_NONE = 0; |
71 | 61 | public static final int RETRY_TYPE_CLICK = 1; |
72 | 62 | public static final int RETRY_TYPE_LONG_CLICK = 2; |
@@ -156,8 +146,7 @@ protected void onDetachedFromWindow() { |
156 | 146 |
|
157 | 147 | private Drawable getImageDrawable() { |
158 | 148 | Drawable drawable = getDrawable(); |
159 | | - if (drawable instanceof TransitionDrawable) { |
160 | | - TransitionDrawable transitionDrawable = (TransitionDrawable) drawable; |
| 149 | + if (drawable instanceof TransitionDrawable transitionDrawable) { |
161 | 150 | if (transitionDrawable.getNumberOfLayers() == 2) { |
162 | 151 | drawable = transitionDrawable.getDrawable(1); |
163 | 152 | } |
|
0 commit comments