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 7000521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:40:58+00:00 2026-05-27T20:40:58+00:00

I trying to use the new android compatibility package to include fragments into my

  • 0

I trying to use the new android compatibility package to include fragments into my project.
I am trying to include a transition animation when I add a new fragment. The thing is only one of my animation work. The In animation works but the Out animation doesn’t work.
I read somewhere that it is a bug in the compatibility package. But I also read that the bug was fixed in the 3rd revision of the compatibility package. Can anyone help me with this issue

In Animation

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/anticipate_interpolator"
android:fromXDelta="0"
android:toXDelta="0"
android:fromYDelta="100%"        
android:toYDelta="0%"
android:duration="1000"/>

Out Animation

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="0"
android:toXDelta="0"
android:zAdjustment="top"
android:fromYDelta="0%"        
android:toYDelta="100%"
android:duration="1000"/>

This is the code I use to add fragments

newFragment = new HelloWorldFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.bottom_top_animation, R.anim.top_bottom_animation);
ft.add(R.id.outer_layout, newFragment);
ft.addToBackStack(null);
ft.commit();
  • 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-05-27T20:40:59+00:00Added an answer on May 27, 2026 at 8:40 pm

    This works in the current version of the library, but it was definitely broken previously. You can use something like this:

    final FragmentManager fm = getSupportFragmentManager();
    final FragmentTransaction ft = fm.beginTransaction();
    ft.setCustomAnimations(R.anim.slide_up, R.anim.slide_down, R.anim.slide_up, R.anim.slide_down)
      .add(R.id.fragment_container, new SomeFragment(), FRAGMENT_TAG)
      .addToBackStack(FRAGMENT_TAG)
      .commit();
    

    where R.anim.slide_up is your in animation and R.anim.slide_down is your out animation. The second pair of params (3 and 4) for setCustomAnimations allow you to specify the pop in/out animations for popping the backstack (e.g., when the user presses back, the fragment will animate away with the animation specified as the fourth param).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use SubSonic for a new project with an existing database but
I'm trying to use URL rewrite in my new project. But I also need
I'm trying to use MVC for a new project after having been around the
I am trying to use HashMap in Android sample project. Now, am doing sample
I'm new to android apps development. I'm trying to use the camera of my
I am new in Android Programming and I am trying to include GTalk application
I'm quite new to Android and I'm trying to use a custom multiple choice
I am new to Android development. I am trying to use the following code
I'm trying to use the new Android 4.0 VPN framework with the Emulator. In
I'm trying to use new OpenCV feature on Android: native camera access. According to

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.