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

  • Home
  • SEARCH
  • 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 7852019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:19:12+00:00 2026-06-02T19:19:12+00:00

I am setting up a menu expand animation. The expanding options are 2 RelativeLayout

  • 0

I am setting up a “menu expand” animation. The expanding options are 2 RelativeLayout nested in a vertical LinearLayout. The TranslateAnimation is applied to the surrounding LinearLayout and makes the options expand from the bottom.

The problem is that only the first nested RelativeLayout is displayed. The second just becomes visible without animation.

Below, the XML layout in question, the method applying the animation, and the call.
Thank you very much for your thoughts

<LinearLayout
    android:id="@+id/bmb_navigation_expanded"
    style="@style/bmb_RelativeLayout"
    android:layout_above="@id/bmb_bottom_bar"
    android:orientation="vertical"
    android:visibility="gone" >

    <RelativeLayout
        style="@style/bmb_RelativeLayout">

     option 1 stuff

    </RelativeLayout>

    <RelativeLayout            
        style="@style/bmb_RelativeLayout">

     option 2 stuff

    </RelativeLayout>

</LinearLayout>

Method applying the animation to the LinearLayout:

    public static void setSlideIn(ViewGroup panel, Context ctx) {

      AnimationSet set = new AnimationSet(false);

      Animation animation = new TranslateAnimation(
          Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
          Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f
      );
      animation.setDuration(200);
      set.addAnimation(animation);

      LayoutAnimationController controller = new LayoutAnimationController(set, 0);
      panel.setLayoutAnimation(controller);

    }

This is how I call the animation:

        layout.setVisibility(View.VISIBLE);
        setSlideIn(layout, getActivity());
  • 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-06-02T19:19:14+00:00Added an answer on June 2, 2026 at 7:19 pm

    Answering my own question here. LayoutAnimationController distributes the animation to all ViewGroup childs. If I want to animate the ViewGroup as a single entity I must do the following:

    panel.setAnimation(set);
    set.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using all options in the menu setting Options|Display|Paren Highlighting, but nothing works
As the title suggests... I'm setting up a superfish menu using the Wordpress CSS
On many Android devices you can get into a secret settings menu from Phone
I'm using the Pure CSS menu from here: http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ It works fine, but I
I'm an Android newbie, and working on an app which needs an Options menu.
I am currently trying to make a navigation-menu where an active-class is applied to
I'm having difficulty setting up a simple menu that displays results on a div
I am setting up a simple 'boot menu' for my app, where the (experienced)
I've got a splitbutton with a menu and a custom menuAlign setting (so that
So Im setting up a menu that has different background :hover colors. The buttons

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.