Fresco: Rounded corners / circular rounding not working for GIF / Animated WebPs

Created on 3 Apr 2018  路  6Comments  路  Source: facebook/fresco

Description

Hi.
there is gif image at first item in recycler view.
but RoundAsCircle is not working only gif image url.
Is there any solution or can I get sample code about this issue ?
thanks.

kakaotalk_photo_2018-04-03-16-00-49_44

Additional Information

  • Fresco version: 1.8.1
  • Platform version: NEXUS 6P 8.1.0
enhancement help wanted

Most helpful comment

Hi I will like to work on this feature :)

All 6 comments

For GIFs, we currently only support the overlay color rounding mode, see http://frescolib.org/docs/rounded-corners-and-circles.html

@oprisnik Is there any solution about making transparent overlay color?

One workaround for this would be to create a custom DrawableFactory that creates a variant of AnimatedDrawable2 that rounds the image.
Alternatively, you could create a custom decoder that does that for you (probably harder).

If somebody wants to spend some time on adding proper GIF rounding support, pull requests are always welcome. An alternative would be to add postprocessor support for GIF frames and then use a native rounding postprocessor.

Hi I will like to work on this feature :)

One thing that worked for me was to put the ImageView inside a FrameLayout, with a rounded background drawable.

<FrameLayout
    android:id="@+id/avatar_container"
    android:background="@drawable/bg_solid_white_circle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/avatar_image"
        android:layout_width="@dimen/avatar_size"
        android:layout_height="@dimen/avatar_size"
        fresco:roundAsCircle="true"
        fresco:roundWithOverlayColor="@color/blue"/>
</FrameLayout>

Hope that this helps.

or you can put it in a cardview of some cardCornerRadius and cardElevation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevenmtang picture stevenmtang  路  3Comments

qiiyue picture qiiyue  路  4Comments

goodev picture goodev  路  4Comments

satyarths picture satyarths  路  3Comments

liubaoyua picture liubaoyua  路  3Comments