Setting fresco:pressedStateOverlayImage to a color in layout XML causes crash
Using the following XML
<com.facebook.drawee.view.SimpleDraweeView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/image_view"
fresco:placeholderImage="@drawable/download_photo"
fresco:failureImage="@drawable/photo_error"
fresco:actualImageScaleType="centerCrop"
fresco:placeholderImageScaleType="centerInside"
fresco:failureImageScaleType="centerInside"
fresco:pressedStateOverlayImage="@color/black_overlay"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:contentDescription="@string/accessibility_photo"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"/>
causes a crash in Jellybean, API level 18, and Lollipop, API 22, when inflating the view
FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #10: Error inflating class com.facebook.drawee.view.SimpleDraweeView
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
When I remove the fresco:pressedStateOverlayImage="@color/black_overlay" then the Inflater works and the app behaves as expected without a crash. Using any color also results in a crash so that is not the problem. Perhaps the documentation is incorrect and a color cannot be used?
please add "fresco:overlayImage="@color/transparent"" ,so it just work!
Thanks, that worked. Maybe adding something to the documentation about both of them needing to be set would be useful.
This looks like a bug. I'll look into it.
Yeah, NPE slipped, i'm sending a fix.
Fixed in source.
It's not crashing for me if I use color in pressedStateOverlayImage . But it isn't working either. I'm using the 0.1.0 jar.
fresco:overlayImage="@color/transparent"
fresco:pressedStateOverlayImage="@color/blue"
Nothing happens when I touch the image.