I could not understand why my custom animations do not override system animations when I switch between actions in my application.
styles.xml
<style name="AppBaseTheme" parent="android:Theme.Holo.Light"></style> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:buttonStyle">@style/buttonStyle</item> <item name="android:actionBarStyle">@style/ActionBarStyle</item> <item name="android:editTextStyle">@style/editTextStyle</item> <item name="android:windowAnimationStyle">@style/ActivityAnimationStyle</item> </style> <style name="ActivityAnimationStyle" parent="@android:style/Animation.Activity"> <item name="android:activityOpenEnterAnimation">@anim/fadein</item> <item name="android:activityOpenExitAnimation">@anim/fadeout</item> <item name="android:activityCloseEnterAnimation">@anim/fadein</item> <item name="android:activityCloseExitAnimation">@anim/fadeout</item> </style>
fadein.xml:
<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:duration="@android:integer/config_longAnimTime" android:fromAlpha="0.0" android:interpolator="@android:anim/anticipate_interpolator" android:toAlpha="1.0" />
fadeout.xml
<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:duration="@android:integer/config_longAnimTime" android:fromAlpha="1.0" android:interpolator="@android:anim/anticipate_interpolator" android:toAlpha="0.0" />
manifest:
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" >
With these settings, I was hoping to see fading animations, but this does not happen at all.
FYI, I noticed that instead of android:windowEnterAnimation and android:windowExitAnimation I use android:windowExitAnimation and increase the value of android:duration by something like 2000 in the animation files, then I see very slow fading animations, but I want the animations in all four cases and faster fading.
I am using Kitkat 4.4.2. Thanks for your help.
source share