Google Adview в верхней части нижней навигационной прокрутки - PullRequest
0 голосов
/ 12 сентября 2018

Я реализовал скрытую навигацию внизу прокрутки, которая работает правильно, однако, когда я добавил Adview поверх нее, прокрутка перестала работать. В результате я ищу некоторые рекомендации / советы о том, как решить эту проблему. Я заметил, что это возможно, поскольку я видел эту же функцию в других приложениях.

APP_BAR_MAIN

        <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:theme="@style/AppTheme.AppBarOverlay">
            <android.support.v7.widget.Toolbar

                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/xxxxxxx_screen_background_color"
                app:popupTheme="@style/AppTheme.PopupOverlay">  
                <ImageButton
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:clickable="true"

 android:background="@color/xxxxxxx_screen_background_color"
                     android:src="@drawable/logo7" />
            </android.support.v7.widget.Toolbar>

        </android.support.design.widget.AppBarLayout>   

        <include
            layout="@layout/content_main" />


    </android.support.design.widget.CoordinatorLayout>

content_main

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/app_bar_main" />

MAIN

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <include
            layout="@layout/app_bar_main"
            android:layout_width="match_parent"
            android:layout_height="match_parent" /> 

        <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.google.android.gms.ads.AdView
            android:id="@+id/adView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|center"
            android:layout_above="@+id/navigation"
            app:adSize="BANNER"
            app:adUnitId="@string/test_banner_ad_unit_id" />

        <android.support.design.widget.BottomNavigationView
            android:id="@+id/navigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_alignParentBottom="true"       
            android:background="#166cba"
            app:elevation="16dp"
            app:layout_behavior="com.xxxxx.xxxx.Helpers.BottomNavigationViewBehavior"
            app:menu="@menu/navigation" />
            </RelativeLayout>


    </android.support.design.widget.CoordinatorLayout>
...