fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Rounding doesn't work for placeholder-only

Open nimengbo opened this issue 11 years ago • 13 comments

<com.facebook.drawee.view.SimpleDraweeView
     android:id="@+id/head_img"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="17dp"
    fresco:actualImageScaleType="focusCrop"
    fresco:failureImage="@mipmap/icon_default_head"
    fresco:placeholderImage="@mipmap/icon_default_head"
    fresco:roundAsCircle="true" />

in java : imgView.setImageURI(null); .

result isn't circle show as original drawing by "@mipmap/icon_default_head" String url = "xxxxxx" if set imgView.setImageURI(Uri.parse(url)); result is circle

if url is null fresco:roundWithOverlayColor is must be set?

Chinese: 当我设置 setImageURI(null) 在xml里设置的 fresco:roundAsCircle="true" 没起作用,用的还是原来是图是方的而不是圆的。 如果我设置url不是null 那么 得到的效果是圆的。 如何让我的占位图和失败时的图 也能是圆的? 前提是我的原图是方的

fresco:roundWithOverlayColor 这个属性是必须的吗?

nimengbo avatar Apr 17 '15 08:04 nimengbo

Actually, the rounding is only works for no-9 path in placeholder. I hope I can help you.

jkyeo avatar Apr 17 '15 10:04 jkyeo

Hi, yes, this is a known limitation. Only images that resolve to BitmapDrawable or ColorDrawable can be rounded. Rounding NinePatchDrawable, ShapeDrawable and other such drawables is not supported (regardless whether they are specified in XML or programmatically). Please see Caveats section in http://frescolib.org/docs/rounded-corners-and-circles.html#_

plamenko avatar Apr 17 '15 11:04 plamenko

uh .. @mipmap/icon_default_head just a PNG not .9.png AsCircle not support ??

nimengbo avatar Apr 17 '15 12:04 nimengbo

Can you please attach a screenshot? Is it possible that your placeholder image is too small?

plamenko avatar Apr 18 '15 00:04 plamenko

16ca2d01-c191-41a9-bf7c-297598018ac1 060f4244-01aa-4240-b7ad-d3991ca428d5 9315b83a-956c-42bb-9bdb-6a6a70341af0 gls 6 x0hz7 a01y6h3 im

icon_default_head is a square .. But when i set setImageURI(null) show as result the AsCircle don't work

nimengbo avatar Apr 20 '15 02:04 nimengbo

I change the icon_default_head size as 436x436 44.2KB but fall flat

nimengbo avatar Apr 20 '15 02:04 nimengbo

Is it possible that the image is actually a GIF (even though the extension says PNG)? Can you upload this image please?

plamenko avatar Apr 21 '15 00:04 plamenko

icon_default_head

Uh.. actually the image is a PNG

nimengbo avatar Apr 21 '15 02:04 nimengbo

Can you remove fresco:failureImage from XML?

plamenko avatar Apr 21 '15 19:04 plamenko

When I removed fresco:failureImage from XML , AsCircle was worked . But why ?

nimengbo avatar Apr 22 '15 02:04 nimengbo

fresco:failureImage This is unnecessary?

nimengbo avatar Apr 22 '15 02:04 nimengbo

Rounding is not supported for the failure image at the moment. See http://frescolib.org/docs/rounded-corners-and-circles.html#_

If failure image is not specified, the placeholder image is shown in case of a failure, so if those two images are the same, it is redundant to specify failureImage See http://frescolib.org/docs/drawee-components.html#_

plamenko avatar Apr 22 '15 14:04 plamenko

ok thanks for lot

nimengbo avatar Apr 23 '15 06:04 nimengbo