aurelhubert / ahbottomnavigation

A library to reproduce the behavior of the Bottom Navigation guidelines from Material Design.
3.84k stars 682 forks source link

CoordinatorLayout + ViewPager + Snackbar #275

Open ghost opened 7 years ago

ghost commented 7 years ago

hi i am using the below code in my XML. The bottom navigation is above the last item of the recyclerview and snackbar flickers when dismissing

<android.support.v4.widget.DrawerLayout
    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/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/coo"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/colorPrimary"
                android:fitsSystemWindows="true"
                app:popupTheme="@style/AppTheme.PopupOverlay">

                   </android.support.v7.widget.Toolbar>

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

        <com.aurelhubert.ahbottomnavigation.AHBottomNavigationViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

        <com.aurelhubert.ahbottomnavigation.AHBottomNavigation
            android:id="@+id/bottom_navigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_anchor="@id/viewpager"
            app:layout_anchorGravity="bottom"
            android:layout_gravity="bottom"/>

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

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="?attr/lightBackgroundColor"
        android:fitsSystemWindows="true"
        app:itemIconTint="?attr/iconTintColor"
        app:itemTextColor="?attr/primaryTextColor"
        app:menu="@menu/activity_main_drawer"/>

</android.support.v4.widget.DrawerLayout>
davenotdavid commented 6 years ago

+1

Fuhrmann commented 6 years ago

Same problem here.