97

I'm playing about with animations with android. The animations android.R.anim.slide_in_left and android.R.anim.slide_out_right are provided. I'm looking for a way to get the opposite animations i.e:

android.R.anim.slide_in_right and android.R.anim.slide_out_left

or how I can specify these myself.

Janusz
  • 187,060
  • 113
  • 301
  • 369

3 Answers3

162

Here are slide_in_right and slide_out_left from the Android open source project.

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 3
    @AdilHussain: The definitions are also available in your SDK installation. – CommonsWare Jan 27 '12 at 11:51
  • 6
    Thanks. Even though I have 4.3, these animations are missing. Any ideas why ? – deepwinter Aug 05 '13 at 19:18
  • @deepwinter: I am uncertain as to what you mean by "missing" (cannot reference in a resource? cannot reference in Java? runtime crash? something else?). I also am uncertain what you mean by "I have 4.3" (your build target is 4.3? you are running on 4.3? something else?). You might consider opening your own StackOverflow question with complete details of your environment, test, and symptoms. – CommonsWare Aug 05 '13 at 19:28
  • 2
    @CommonsWare I have the same issue as deepwinter. I'm building my app using Android 4.2.2 SDK. From android.jar, in android.R, I see only anim.slide_in_left and anim.slide_out_right. There is no slide_in_right or slide_out_left. So in code, I cannot use android.R.anim.slide_out_left as it gives me a compilation error. – zzheng Aug 23 '13 at 10:03
  • @zzheng: I never said that `android.R.anim.slide_out_left` would work. I did point out a definition of a `slide_out_left` animation resource. You are welcome to copy it or implement your own. Note that this answer was from over four years ago, and so the resource may have changed from the version I link to in the answer. – CommonsWare Aug 23 '13 at 18:18
  • 10
    I know this is an old reply, but I found the source files in `android-sdks\platforms\android-19\data\res\anim` -- copied into project and they worked. No idea why they are not auto-detected. –  Apr 03 '14 at 17:15
  • I think now they're called `slide_left_in` etc instead of `slide_in_left` etc – Tim Rae Oct 09 '15 at 10:16
  • Explanation as to why they don't work here: https://stackoverflow.com/questions/62923422/missing-slide-in-right-and-slide-out-left-animations-in-android/75881117#75881117 – phazei Mar 29 '23 at 18:57
8
android:inAnimation="@android:anim/slide_in_left"
android:outAnimation="@android:anim/slide_out_right"
oguz ismail
  • 1
  • 16
  • 47
  • 69
Ashish Anand
  • 81
  • 1
  • 2
0

Both slide_in_right and slide_out_left exist in Android 2.1 and above.

Magnilex
  • 11,584
  • 9
  • 62
  • 84
emidander
  • 2,383
  • 22
  • 29