Skip to content

Instantly share code, notes, and snippets.

@sharifulislam52
Last active March 2, 2018 12:59
Show Gist options
  • Save sharifulislam52/c60edc0bdf60fbebca63c43507a8260e to your computer and use it in GitHub Desktop.
Save sharifulislam52/c60edc0bdf60fbebca63c43507a8260e to your computer and use it in GitHub Desktop.
<!-- View size 100% to 0% with time duration and alpha (transparency) -->
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<scale
android:duration="150"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0.0"
android:toYScale="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
/>
<alpha
android:duration="150"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
/>
</set>
Animation animation = AnimationUtils.loadAnimation(your_Activity.getApplicationContext(),R.anim.animation_xml_file);
AnyView target_view = (AnyView)findViewById(R.id.target_view_id);
target_view.startAnimation(animation);
// animation, your_Activity, animation_xml_file, AnyView, target_view, target_view_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment