Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image view Mask animation in android

Tags:

android

i wanna do the mask animation to the ImageView the below image shows my requirement enter image description here

like image 354
Basheer Avatar asked Nov 17 '25 20:11

Basheer


1 Answers

Yes you can. I made a framelayout that supports masking. The mask is a drawable but it can also be an animationDrawable. Shameless selfplug

<com.christophesmet.android.views.maskableframelayout.MaskableFrameLayout
android:id="@+id/frm_mask_animated"
android:layout_width="100dp"
app:porterduffxfermode="DST_IN"
app:mask="@drawable/animation_mask"
android:layout_height="100dp">

<ImageView android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:scaleType="centerCrop"
           android:src="@drawable/unicorn"/>

You can find it here

like image 82
Christophe Smet Avatar answered Nov 20 '25 09:11

Christophe Smet