Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:01:03+00:00 2026-06-07T20:01:03+00:00

I have made animation through xml like rotation animation which is to be used

  • 0

I have made animation through xml like rotation animation which is to be used for activity transition. the first part is the rotate and scale animation which work togather to show half rotation the work fine but when i add reverse of them with start offset they are showing blank view instead of animation… not showing even the first part of animation which was working correctly..

Here is xml code when only first part was there and it is working correctly..

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<rotate
    android:duration="2000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="-15"
    android:toYScale="0.0" />

<scale
    android:duration="2000"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="1" />


</set>

but when i add reverse code it just goes blank all the time…

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<rotate
    android:duration="2000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="-15"
    android:toYScale="0.0" />

<scale
    android:duration="2000"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="1" />


 <rotate
    android:startOffset="2000"
    android:duration="2000"
    android:fromDegrees="-15"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="0"
    android:toYScale="0.0" />

  <scale
    android:startOffset="2000"
    android:duration="2000"
    android:fromXScale="0"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1" />


  </set>

so guys please tell me where i’m going wrong…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:01:04+00:00Added an answer on June 7, 2026 at 8:01 pm

    You don’t need to dublicate your animations to achieve reverse effect. You can use android:repeateMode = “reverse” and android:repeatCount = “1”

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android" >
    
    <rotate
        android:duration="2000"
        android:fromDegrees="0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:repeatCount="1"
        android:repeatMode="reverse"
        android:toDegrees="-15" />
    
    
    <scale
        android:duration="2000"
        android:fromXScale="1"
        android:fromYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:repeatCount="1"
        android:repeatMode="reverse"
        android:toXScale="0"
        android:toYScale="1" />
    
    </set>
    

    You need to set repeatCount and repeatMode both for scale and rotate animations. Unfortunately you can’t just use it directly in set attribute due bug in AnimationSet implementation.

    But this animation will be applied only on one activity. If you actually want the first activity to disappear and then the second activity to appear you need to split your animation into two pieces. The first part will have your rotate and scale direct animations and the second part will have reversed rotate and scale animation. So basically just you need to split your set with four animation into two files. Then you need to use this two animations for starting new activity:

    overridePendingTransition(R.anim.direct, R.anim.reversed);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made the following animation in my android project <?xml version=1.0 encoding=utf-8?> <set
i have made the following animation xml file in my android project: <?xml version=1.0
I have made a game which is nearly identical to Popcap's Atomica. ( http://www.popcap.com/gamepopup.php?theGame=atomica
I have made a basic ascx control which is just a panel with a
I have made a simple animation in Flash and the i exported into a
Why do animation classes (like DoubleAnimation) require dependency properties? Dependency properties have a lot
I've made an activity that looks a lot like the level select screen from
I have add a ViewFlipper in which has 2 linearlayout,and I have made an
I have made a little animation that resembles the coverflow itunes uses as a
I have an application which used top bar navigation and a MapView. On the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.