title: Animate two Views together in Android
body: <p>In my layout I have one button and an AddView on the top of the screen (Image below explain it better). I need the AddView to show only when it is loaded and for that I made an AdListener. But now I want my button to slide down when the AddView is shown. ¿How do I do that? Thank you in advance.</p>
  
  <p>Here is my AdListener</p>
  
  <pre><code>adView.setAdListener(new AdListener() {
  
          @Override
          public void onAdLoaded(){
              adView.bringToFront();
              adView.startAnimation(slide_from_top);
          }
  
      });
  </code></pre>
  
  <p>Here is my XML animation slide_from_top:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;translate
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:fromYDelta="-100%p"
     android:toYDelta="0%p"
     android:duration="1000"/&gt;
  </code></pre>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Here is my Layouts XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
  &lt;com.google.android.gms.ads.AdView 
     xmlns:ads="http://schemas.android.com/apk/res-auto"
     android:id="@+id/adView"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     ads:adUnitId="MY_AD_UNIT_ID"
     ads:adSize="BANNER"
     android:layout_alignParentTop="true"
     android:layout_centerHorizontal="true"/&gt;   
  
  &lt;Button
     android:id="@+id/MY_BUTTON"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_alignParentTop="true"
     android:layout_centerHorizontal="true"
     android:text="MY_BUTTON" /&gt;
    &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xIoYb.png" alt="enter image description here"></p>