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.
Here is my AdListener
adView.setAdListener(new AdListener() {
@Override
public void onAdLoaded(){
adView.bringToFront();
adView.startAnimation(slide_from_top);
}
});
Here is my XML animation slide_from_top:
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="-100%p"
android:toYDelta="0%p"
android:duration="1000"/>
EDIT
Here is my Layouts XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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"/>
<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" />
</RelativeLayout>