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.
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.
createCircularReveal() method enables you to animate a clipping circle to reveal or hide a view. To reveal a previously invisible view using this effect: // previously invisible view View myView = findViewById(R. id.
To start an activity, use the method startActivity(intent) . This method is defined on the Context object which Activity extends. The following code demonstrates how you can start another activity via an intent. # Start the activity connect to the # specified class Intent i = new Intent(this, ActivityTwo.
I'm not sure if it is possible with transition animations.
Maybe it is possible to achieve desired result in following way:
or
See also: DevBytes: Custom Activity Animations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With