title: Layering of views during an objectanimation
body: <p>I have a relative layout with a LinearLayout as a child viewgroup and a button as a child view. so when i press the button the linearlayout falls down the screen but it goes under the button , i want it to go over the button .</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
  android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
  android:id="@+id/relative"
  
  &gt;
  
      &lt;LinearLayout
          android:layout_width="365dp"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:id="@+id/linearLayout"
          android:background="@drawable/background"&gt;
  
  
          &lt;EditText
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:inputType="textPersonName"
              android:hint="Name"
              android:ems="10"
              android:id="@+id/editText"
  
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true" /&gt;
  
          &lt;RadioGroup
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_below="@+id/editText"
              android:layout_alignRight="@+id/editText"
              android:layout_alignEnd="@+id/editText"
              &gt;
              &lt;RadioButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Male"
                  android:id="@+id/radioButton"
                  android:layout_below="@+id/linearLayout"
                  android:layout_alignParentLeft="true"
                  android:layout_alignParentStart="true" /&gt;
  
              &lt;RadioButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Female"
                  android:id="@+id/radioButton2"
                  android:layout_below="@+id/linearLayout"
                  android:layout_toRightOf="@+id/radioButton"
                  android:layout_toEndOf="@+id/radioButton" /&gt;
          &lt;/RadioGroup&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Signup"
          android:id="@+id/button"
  
          android:layout_gravity="center"
         android:translationZ="1dp"
          android:layout_below="@+id/linearLayout"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="45dp" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><img src="https://i.stack.imgur.com/rrtU5.png" alt="Layout"></p>
  
  <p>my java code is :</p>
  
  <pre><code>public class MainActivity extends Activity {
  ValueAnimator va;
  LinearLayout linearLayout;
  Button button;
  ValueAnimator objectAnimator;
  RelativeLayout relative;
  boolean b=false;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
     linearLayout=(LinearLayout) findViewById(R.id.linearLayout);
      button=(Button) findViewById(R.id.button);
      setbuttonclick();
      relative=(RelativeLayout) findViewById(R.id.relative);
      relative.bringChildToFront(linearLayout);
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public void setbuttonclick()
  {
      button.setOnClickListener(new View.OnClickListener() {
          @Override
  
          public void onClick(View v) {
  
  
  
  
  
              if(b==false) {
                  objectAnimator = ObjectAnimator.ofFloat(linearLayout,        "TranslationY", 2600f);
                  objectAnimator.setDuration(1000);
                  objectAnimator.setInterpolator(new AnticipateOvershootInterpolator());
                  objectAnimator.start();
  
                  b=true;
              }
  
              else {
                  objectAnimator = ObjectAnimator.ofFloat(linearLayout, "TranslationY", 50f);
                  objectAnimator.setDuration(1000);
                  objectAnimator.setInterpolator(new AnticipateOvershootInterpolator());
                  objectAnimator.start();
  
                  b=false;
              }
  
  
          }
      });
  }
  </code></pre>
  
  <p>}</p>
  
  <p><img src="https://i.stack.imgur.com/qAh12.png" alt="What is happening"></p>