What is the default transition between actions in Android 4.0 (API 14+)

I created an application with quite a few actions, and I would like to have a “slide on the right in the input / slide on the left in the output” between them.

I read more than once that slide transitions should be the default Android, but on the device that I develop on transitions, they disappear / disappear by default (Galaxy Tab 2 7 ", on ICS 4.0).

Is there anything I need to declare at the application level, for example in the manifest file?

I ask because otherwise I will need to add overridePendingTransition (R.anim.right_slide_in, R.anim.left_slide_out); to all my crossings, which are many ... it’s just interesting if I’ve lost something before going along this road.

Many thanks

+8
android android-animation
source share
3 answers

There are no answers ... on 4+ devices that I tried, animation is a gradual disappearance with increasing or decreasing scale ...

I added the code manually, where I wanted to create a slide animation:

 //open activity startActivity(new Intent(this, MyActivity.class)); overridePendingTransition(R.anim.right_slide_in, R.anim.left_slide_out); 

xml animation from right to left:

 <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator" > <translate android:duration="300" android:fromXDelta="100%p" android:toXDelta="0" /> </set> 

xml animation from left to right:

 <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator" > <translate android:duration="300" android:fromXDelta="0" android:toXDelta="-100%p" /> </set> 
+7
source share

In the style.xml file put

  <style name="WindowAnimationTransition"> <item name="android:windowEnterAnimation">@android:anim/slide_in_left</item> <item name="android:windowExitAnimation">@android:anim/slide_out_right</item> </style> 

and add

  <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> ... <item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item> </style> 
+2
source share

There is a method that includes creating a style and adding it to the manifest here: How to change all activity transitions at once in an Android application? but I managed to do this over startActivity() . Whenever the back is pressed, this method does not work or I can just skip something.

0
source share

All Articles