SelectableRoundedImageView
SelectableRoundedImageView copied to clipboard
java.lang.ClassCastException: android.graphics.drawable.TransitionDrawable cannot be cast to com.gongpingjia.view.SelectableRoundedImageView$SelectableRoundedCornerDrawable at com.gongpingjia.view.SelectableRoundedImageView.updateDrawable(SelectableRoundedImageView.java:201) at com.gongpingjia.view.SelectableRoundedImageView.setImageDrawable(SelectableRoundedImageView.java:149)
java.lang.ClassCastException: android.graphics.drawable.TransitionDrawable cannot be cast to com.gongpingjia.view.SelectableRoundedImageView$SelectableRoundedCornerDrawable at com.gongpingjia.view.SelectableRoundedImageView.updateDrawable(SelectableRoundedImageView.java:201) at com.gongpingjia.view.SelectableRoundedImageView.setImageDrawable(SelectableRoundedImageView.java:149)
Which image loading library do you use? Can you share some code that throws this exception?
@huangchenggang this thread will be closed unless you share me more details in next 2 weeks. :)
This is an issue when using Glide as the Async image loader, I think this has something to do with the animation.
@zanderisrael if you have experienced the same issue, could you share some code that reproduce the issue?
sure:
JAVA
public static void setImage(Context context, int defaultResource, String url,ImageView imageView,Transformation<Bitmap>... bitmapTransformations) {
if(url == null || url == "")
url = "about:blank";
GlideUrl glideUrl = PZM_SESSIONManager.sharedInstance().getGlideUrl(url);
RequestManager manager = Glide.with(context);
DrawableTypeRequest request = manager.load(glideUrl);
request.asBitmap();
/* this fixes the issue - request.dontAnimate(); */
request.placeholder(defaultResource);
if (bitmapTransformations != null)
request.bitmapTransform(bitmapTransformations);
request.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(imageView);
}
XML
<pazam.zanderisrael.pazam.Libraries.SelectableRoundedImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pzm_favorites_friend_extend_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop"
app:sriv_border_width="2dip"
app:sriv_border_color="#ffffff"
app:sriv_oval="true"
android:layout_gravity="bottom|center_horizontal"
android:adjustViewBounds="true" />
Thanks for sharing! I will look into it. :)
-
-
- 오후 7:17에 "zanderisrael" [email protected]님이 작성:
-
sure:
JAVA
public static void setImage(Context context, int defaultResource, String url,ImageView imageView,Transformation<Bitmap>... bitmapTransformations) { if(url == null || url == "") url = "about:blank";
GlideUrl glideUrl = PZM_SESSIONManager.sharedInstance().getGlideUrl(url); RequestManager manager = Glide.with(context); DrawableTypeRequest request = manager.load(glideUrl); request.asBitmap(); /* this fixes the issue - request.dontAnimate(); */ request.placeholder(defaultResource); if (bitmapTransformations != null) request.bitmapTransform(bitmapTransformations); request.diskCacheStrategy(DiskCacheStrategy.SOURCE) .into(imageView); }XML
<pazam.zanderisrael.pazam.Libraries.SelectableRoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/pzm_favorites_friend_extend_avatar" android:layout_width="40dp" android:layout_height="40dp" android:scaleType="centerCrop" app:sriv_border_width="2dip" app:sriv_border_color="#ffffff" app:sriv_oval="true" android:layout_gravity="bottom|center_horizontal" android:adjustViewBounds="true" />
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pungrue26/SelectableRoundedImageView/issues/14#issuecomment-261769698, or mute the thread https://github.com/notifications/unsubscribe-auth/AENeBTA2jE2hZMls_fV3MN75K5XibZhsks5rAB48gaJpZM4KVbaS .
I met the same problem!using Glide as the image loader
I met the same problem!using Glide as the image loader
anyone here? why the author has no responds but closed instead?
@hpuhsp I am HERE! I just have no time for digging into this. Contributes are welcome!
This has nothing to do with this library. Its a known issue of using either Picasso or Glide as your image loading library. Please, check Glide's README file where it clearly specifies that you either have to use dontAnimate() option or implement your own animation. @pungrue26, you wanna close this.