How can I start a new activity as a spent circle from the center

I want to start a new activity from the center of the screen as an expended circle, so the activity will be shown as such a circle.

example

Here is my current anim.xml code

<set xmlns:android="http://schemas.android.com/apk/res/android" > <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200" android:fromXScale="0" android:fromYScale="0" android:pivotX="50%" android:pivotY="50%" android:toXScale="1" android:toYScale="1" > </scale> 

animback.xml

  <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1000" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:toXScale="1.0" android:toYScale="1.0" > </scale> </set> 

Call animation

 overridePendingTransition(R.anim.anim,R.anim.animback); 

The current code simply zooms in on the new activity, but I want the activity to appear from the center in a circle.

+8
android android-activity android-animation
source share
1 answer

I'm not sure if this is possible with transition animations.

Perhaps you can achieve the desired result as follows:

  • Take a screenshot of Activity A before proceeding
  • Transit to activity B without animation
  • Action Overlay Screenshot in Activity B
  • Animate the overlay (apply a custom drawing)

or

  • Make Activity B Transparent
  • Transition to activity B without animation
  • Activity B animation layout (apply a custom drawing)

See also: DevBytes: Custom action animations

+1
source share

All Articles