0

I want to animate an activity while starting another activity. The animation i am trying to do flip animation.

I tried ActivityOptions and overridePendingTransition with objectanimtor. I think i am doing wrong ,objectanimator can not be used with these above methods.

Is there any way to animate activity that work for api level 8 also, please also explain the reason why objecanimator not working with ActivityOptions and overridePendingTransition

Below the sample is attached

     <set xmlns:android="http://schemas.android.com/apk/res/android">
   <!-- Before rotating, immediately set the alpha to 0. -->
        <objectAnimator
    android:valueFrom="1.0"
    android:valueTo="0.0"
    android:propertyName="alpha"
    android:duration="0" />

      <!-- Rotate. -->
       <objectAnimator
    android:valueFrom="180"
    android:valueTo="0"
    android:propertyName="rotationY"
    android:interpolator="@android:interpolator/accelerate_decelerate"
    android:duration="@integer/card_flip_time_full" />

        <!-- Half-way through the rotation (see startOffset), set the alpha to 1. -->
       <`objectAnimator`
    android:valueFrom="0.0"
    android:valueTo="1.0"
    android:propertyName="alpha"
    android:startOffset="@integer/card_flip_time_half"
    android:duration="1" />
      </set>


        `enter code here`and i used this `xml` like this

        `overridePendingTransition`(`R.anim.card`_flip_right_in,`R.anim.card`_flip_right_out);
Bora
  • 1,933
  • 3
  • 28
  • 54
  • 1
    Have you tried rather using the compatibility framework v4 or 13 (then you can support api level 8) and a ViewPager with fragments in stead of activities? This will definitely solve your issue and also make your app more responsive when changing views. – the-ginger-geek Mar 08 '13 at 09:18
  • Thanks Neli but i am keeping fragment as my last option, I have an example regarding that in developer site,but i am looking for doing the same from activites. Can you give me teh compatibility framework link ? – Bora Mar 08 '13 at 09:47
  • The version 4 library should be included by default in your project but you can see how to include it by looking at this question http://stackoverflow.com/questions/12382555/android-support-library-manual-download – the-ginger-geek Mar 08 '13 at 10:05
  • Dude i do not think that it supports objectanimator – Bora Mar 08 '13 at 11:12
  • 1
    Have a look at this question (http://stackoverflow.com/questions/11628623/objectanimator-in-api-level-11) for ObjectAnimator replacements. – the-ginger-geek Mar 08 '13 at 11:21
  • Seen but i am little worried that if i apply the objectanimator from that library then will overridependingtrans or activityoptions will work or not ? as it is not working rt now for android objectanimator – Bora Mar 08 '13 at 11:50
  • Rather use the Property Animator as suggested in the post? – the-ginger-geek Mar 08 '13 at 12:26

0 Answers0