user1403073
user1403073

Reputation: 91

Android transition rotate animation

I'm searching that how to make a view in activity A transform to view in activity B and rotate it. Like the link below:

Link

Hope someone can show me the way to do it. Thanks in advance

Upvotes: 0

Views: 1945

Answers (2)

CodeGeek
CodeGeek

Reputation: 721

You can use Shared Element Transition's + Rotate as Enter transition

Here example is for fade, you can replace it with rotate

Upvotes: 1

salmanseifian
salmanseifian

Reputation: 1082

You should create anim folder in your res folder, then create rotate.xml file in anim folder and add below code:

<?xml version="1.0" encoding="UTF-8"?>    
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1200"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="90" />

and in your activity on your desired widget, add below code:

  yourView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotate));

Upvotes: 0

Related Questions