Android: Top Down Animation hidden onCreate
<p>In my Application i have a Menu that moves in from top when a button is clicked.
That Menu is nested in a LinearLayout</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical"&gt;

    &lt;!-- Top Menu --&gt;

    &lt;LinearLayout
        android:id="@+id/top_menu"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:visibility="visible"
        android:orientation="vertical"&gt;

        &lt;The 3 Menu Buttons as ImageButton&gt;
    &lt;/LinearLayout&gt;

    &lt;!-- End of Top Menu --&gt;

    ...[Rest of Layout / the always visible content
&lt;/LinearLayout&gt;
</code></pre>

<p>Now I want the Menu to be hidden when the Activity is created doing this as follows:</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_someactivity);        

    animHelp = new AnimationHelper(getWindow().getDecorView().getRootView());        
    // Not really working temporary fix for the Animation 'moveup thingy' that happens the first time (view.gone/view.visible issue)
    animHelp.doSlideUp(0); // int param = animation.setDuration(0);
</code></pre>

<p><b>The Problem</b>: When the Activity starts you see the animation happening / the content part moving up</p>

<p><b>The Question</b>: How can i hide the top_menu in a way where you don't see the animation happen?</p>

<p><b>Tries</b>: 
- Using Visibility:Gone as a start parameter doesn't solve the problem either. </p>

<p>For completeness here is the AnimationHelper.class</p>

<pre><code>public class AnimationHelper {

    private boolean isDown = false;

    private LinearLayout ll;
    private LinearLayout menu;

    public AnimationHelper(View v) {
        ll = (LinearLayout)v.findViewById(R.id.root);
        menu  = (LinearLayout) v.findViewById(R.id.top_menu);
    }

    public void doSlideDown(int time) {
        menu.setVisibility(View.VISIBLE);

        Animation slideDown = setLayoutAnim_slidedown(time);
        ll.startAnimation(slideDown);
    }

    public void doSlideUp(int time) {

         Animation slideUp = setLayoutAnim_slideup(time);
         ll.startAnimation(slideUp);
    }

    private Animation setLayoutAnim_slidedown(int time) {

         Animation animation = new TranslateAnimation(
                 Animation.ABSOLUTE, 0,
                 Animation.ABSOLUTE, 0,
                 Animation.ABSOLUTE, -menu.getHeight(),
                 Animation.ABSOLUTE, 0);

            animation.setDuration(time);
            animation.setAnimationListener(new AnimationListener() {

                public void onAnimationStart(Animation animation) {}

                public void onAnimationEnd(Animation animation) {
                    isDown = true;              
                }

                public void onAnimationRepeat(Animation animation) {}

            });

         return animation;

    }

    private Animation setLayoutAnim_slideup(int time) {

        Animation animation = new TranslateAnimation(
                Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, -menu.getHeight());

        animation.setDuration(time);
        animation.setAnimationListener(new AnimationListener() {        

            public void onAnimationStart(Animation animation) {}

            public void onAnimationEnd(Animation animation) {
                ll.clearAnimation();
                menu.setVisibility(View.GONE);
                isDown = false;

            }

            public void onAnimationRepeat(Animation animation) {}

         });

         return animation;
    }

    public boolean isDown() {
        return isDown;
    }

}
</code></pre>

<p>Thank you very much for your time!</p>
