title: Android Layout with 3 Sections
body: <p>I am working on a basic Android app that has 3 "sections" in the layout for the main activity -> </p>
  
  <ol>
  <li>Ad banner at the top</li>
  <li>Main section for content</li>
  <li>BottomNavigationView at the bottom</li>
  </ol>
  
  <p>The layout I have works, but the ad banner at the top overlaps some of the main section (Note: the ad banner is dynamically created and inserted into <code>ad_layout</code> with <code>match_parent</code> width and <code>wrap_content</code> height). I want the ad banner to occupy its own space and then have the main section occupy its own space and then the BottomNavigationView occupy its own space.</p>
  
  <p>The XML I have right now seems like a mess. Is there a better way to have 3 distinct sections, each occupying their own space? Thanks</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/outer_layout"&gt;
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/main_layout"
          android:background="@android:color/white"&gt;
      &lt;!-- Main Content --&gt;
  &lt;com.google.android.material.bottomnavigation.BottomNavigationView
      android:id="@+id/toolbar_bottom"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:background="@color/primary_dark"
      app:itemIconTint="@android:color/white"
      app:itemTextColor="@android:color/white"
      app:menu="@menu/toolbar_bottom_menu"
      app:labelVisibilityMode="unlabeled"/&gt;
          &lt;FrameLayout
              android:id="@+id/ad_layout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content" /&gt;
      &lt;/RelativeLayout&gt;
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>