There is an activity with two elements:
- WebView (full screen).
- ProgressBar in the middle (hidden by default).
You need to add an AdView banner from Yandex down the screen. The height of the banner is not fixed (AdSize.flexibleSize ()), that is, the height of the webview should vary depending on the height of the adview.
How to do it?
Code:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="horizontal"> <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" /> <ProgressBar android:id="@+id/progressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:visibility="invisible" android:layout_centerVertical="true"/> <com.yandex.mobile.ads.AdView android:id="@+id/banner_view" android:layout_width="match_parent" android:layout_height="wrap_content"/> </RelativeLayout> 