How to slide up and slide down with animation in android

android slide up animation programmatically
android animation slide up from bottom
android animation slide down from top
fall down animation in android
slide animation android
android slide button animation
up/down animation
android slide up animation activity

I have layout file

<LinearLayout
    android:id="@+id/linear_search"
    android:orientation="vertical"
    android:background="#fee102"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

   <TextView
       android:textSize="20sp"
       android:id="@+id/search"
       android:gravity="left|center"
       android:paddingLeft="10dp"
       android:paddingTop="15dp"
       android:paddingBottom="15dp"
       android:drawablePadding="10dp"
       android:textColor="#5b5a52"
       android:text="What - When - Where?"
       android:drawableLeft="@drawable/ic_search_black_24px"
       android:background="#ffed64"
       android:layout_marginTop="10dp"
       android:layout_marginBottom="10dp"
       android:layout_marginLeft="15dp"
       android:layout_marginRight="15dp"
       android:layout_width="match_parent"
       android:layout_height="wrap_content" />

    <EditText
        android:visibility="gone"
        android:textSize="20sp"
        android:id="@+id/what"
        android:gravity="left|center"
        android:paddingLeft="10dp"
        android:paddingTop="15dp"
        android:paddingBottom="15dp"
        android:drawablePadding="10dp"
        android:textColor="#5b5a52"
        android:text="What?"
        android:background="#ffed64"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <EditText
        android:visibility="gone"
        android:textSize="20sp"
        android:id="@+id/when"
        android:gravity="left|center"
        android:paddingLeft="10dp"
        android:paddingTop="15dp"
        android:paddingBottom="15dp"
        android:drawablePadding="10dp"
        android:textColor="#5b5a52"
        android:text="When?"
        android:background="#ffed64"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <EditText
        android:visibility="gone"
        android:textSize="20sp"
        android:id="@+id/where"
        android:gravity="left|center"
        android:paddingLeft="10dp"
        android:paddingTop="15dp"
        android:paddingBottom="15dp"
        android:drawablePadding="10dp"
        android:textColor="#5b5a52"
        android:text="Where?"
        android:background="#ffed64"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

I want to slide down when search text view click and then search text view gone and all other edit text view visible with animation how to do this?

how to do in java please tell me the whole code for this

public void slideUp(View view) {
    view.setVisibility(View.VISIBLE);
    TranslateAnimation animate = new TranslateAnimation(
            0,                 // fromXDelta
            0,                 // toXDelta
            view.getHeight() ,  // fromYDelta
            0);                // toYDelta
    animate.setDuration(500);
    animate.setFillAfter(true);
    view.startAnimation(animate);
}

public void slideDown(final View view) {
    TranslateAnimation animate = new TranslateAnimation(
            0,                 // fromXDelta
            0,                 // toXDelta
            0,                 // fromYDelta
            view.getHeight()); // toYDelta
    animate.setDuration(500);
    animate.setFillAfter(true);
    view.startAnimation(animate);
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            view.setVisibility(View.GONE);
        }
    }, 500);
}

Slidedown and slideup layout with animation, With the new animation API that was introduced in Android 3.0 (Honeycomb) it is very simple to create such animations. Sliding a View down by a distance: This example demonstrate about how to Show and hide a View with a slide up/down animation in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml.

You can use ObjectAnimator.

You can animate in any direction (x or y).

Android reference link https://developer.android.com/reference/android/animation/ObjectAnimator.html

Show and hide a View with a slide up/down animation, public void slideUp(View view) { view.setVisibility(View.VISIBLE); TranslateAnimation animate = new TranslateAnimation( 0, // fromXDelta 0,  Stack Overflow Public Slidedown and slideup layout with animation. I found a third-party library which does a slide-up, slide-down and slide-right in Android.

make a slide_down.xml file in anim folder and copy the following code

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
    android:duration="1500"
    android:fromYDelta="5"
    android:toYDelta="90%" />

for slide_up.xml

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
    android:duration="1500"
    android:fromYDelta="90%"
    android:toYDelta="0" />

now in your java code use the following code

Animation slideUpAnimation = AnimationUtils.loadAnimation(getApplicationContext(),
            R.anim.slide_up_animation);

lastly cast it to your imageview or whatever u are using..

imageView.startAnimation(slideUpAnimation);

How to slide up and slide down with animation in android, In Android, there are many ways to create an animation. From transitioning activities with animation to showing and hiding views, you get many choices when  After lunch suddenly i feel like a damn genius guy and damn idiots at the same time, by finding a very simple solution to this, which is setting the element visibility parameter into hide before animation and show after animation ended for slide down and the reverse for slide up.

Sliding Up And Down: View Animation - Mudit Sen, This example demonstrate about how to Show and hide a View with a slide up/​down animation in android.Step 1 − Create a new project in  With the new animation API that was introduced in Android 3.0 (Honeycomb) it is very simple to create such animations. Sliding a View down by a distance: view.animate().translationY(distance); You can later slide the View back to its original position like this: view.animate().translationY(0);

How to Show and hide a View with a slide up/down animation in , After some research, I found out that implementing animation on android is not that hard, just need some patience and a few hours of trial and  Make a folder anim in the res folder of the project. Now add slide_up.xml for slide_up animation. Then add slide_down.xml for slide down animation.

Android Slide Up & Down Animation, In Android Animations are the visuals that are added to make the user In this article we will be discussing how to create a Slide Up/Down animation in Kotlin. This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. android development tutorial, android programming