10

I want to start a new activity from center of screen as an expended circle so the activity will be revealed as a circle like this.

example

Here is my current code anim.xml

<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>

Calling the animation

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

The current code just zooms in the new activity but I want the activity to be revealed from center as a circle.

Rosenpin
  • 862
  • 2
  • 11
  • 40
  • use animation, see this link http://stackoverflow.com/questions/9294446/android-animation-for-new-activity and this http://android-er.blogspot.in/2013/04/custom-animation-while-switching.html – Shruti Aug 21 '14 at 06:10
  • This isn't the kind of animation I am looking for – Rosenpin Aug 21 '14 at 06:15
  • Need more details... – MSA Aug 21 '14 at 06:26
  • I am trying to start an animation from center of the screen and expand to full screen, the animation should reveal the 2nd activity – Rosenpin Aug 21 '14 at 06:30

1 Answers1

1

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

Maybe it is possible to achieve desired result in following way:

  • Make a screenshot of Activity A before transition
  • Transit to activity B without animation
  • Overlay Activity A screenshot on Activity B
  • Animate the overlay (apply custom drawing)

or

  • Make an activity B transparent
  • Transit to Activity B without animation
  • Animate Activity B layout (apply custom drawing)

See also: DevBytes: Custom Activity Animations

vokilam
  • 10,153
  • 3
  • 45
  • 56