I wanted to create a reveal effect like WhatsApp's attachment feature. I while looking around to create something custom, I came across Android's android.support.design.circularreveal.cardview.CircularRevealCardView
view available already without adding any external library.
I implemented this view like so :-
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.circularreveal.cardview.CircularRevealCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ccv_attachment_reveal"
style="@style/style_mw"
android:elevation="@dimen/dimen_2dp"
android:orientation="vertical"
android:padding="@dimen/dimen_margin_16dp"
app:cardCornerRadius="@dimen/dimen_8dp"
>
<android.support.v7.widget.LinearLayoutCompat
style="@style/style_mw"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_attachment_first_row"
style="@style/style_ww"
android:layout_marginStart="@dimen/dimen_30dp"
android:layout_marginTop="@dimen/dimen_margin_16dp"
android:layout_marginEnd="@dimen/dimen_30dp">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_gallery_image"
style="@style/style_ww"
android:layout_alignParentStart="true"
android:src="@drawable/ic_gallery_image"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_camera_image"
style="@style/style_ww"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_camera"/>
</RelativeLayout>
<RelativeLayout
style="@style/style_ww"
android:layout_marginStart="@dimen/dimen_30dp"
android:layout_marginTop="@dimen/dimen_margin_16dp"
android:layout_marginEnd="@dimen/dimen_30dp"
android:layout_marginBottom="@dimen/dimen_margin_16dp">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_gallery_image1"
style="@style/style_ww"
android:layout_alignParentStart="true"
android:src="@drawable/ic_gallery_image"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_camera_image1"
style="@style/style_ww"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_camera"/>
</RelativeLayout>
</android.support.v7.widget.LinearLayoutCompat>
</android.support.design.circularreveal.cardview.CircularRevealCardView>
This displays fine on my app like a regular CardView and I can set it visibile/invisible on a button click. But however I cannot find any implementations online showing how to apply the reveal animation while making this view visible. Is there an in built feature to apply the animation or do I have to create one myself?