roughike / BottomBar

(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.
Apache License 2.0
8.41k stars 1.5k forks source link

Bottombar animation and Floating Action Button #498

Open alexbeville opened 8 years ago

alexbeville commented 8 years ago

Hi, Great job for the new version of the library.

I have still an issue with your library, and I don't know how to resolve it.

What I want is to have a bottombar in shy mode (so hiding when I scroll the view) and my Floating Aciton Button is attached to the top of the bottombar. So whatever the state of the bottombar (showed / hidden), my Floating Action Button is still visible.

For now, my Floating Action Button is behind the Bottombar, and it's only fully visible when my Bottombar is hidden.

Here is my layout :

<?xml version="1.0" encoding="utf-8"?>
<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"
    tools:context=".activities.MainNavigationActivity">
    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        >
        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/appbar_padding_top"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_scrollFlags="scroll|enterAlways"
                android:background="?attr/colorPrimary"
                app:popupTheme="@style/AppTheme.PopupOverlay">

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

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:visibility="gone"
                app:layout_collapseMode="pin"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

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

        <FrameLayout

            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_gravity="fill_vertical"
            android:id="@+id/fragmentContent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <com.roughike.bottombar.BottomBar
            android:id="@+id/bottomBar"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_gravity="bottom"
            app:bb_behavior="shy"
            app:bb_tabXmlResource="@xml/bottombar_menu"
            />

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:visibility="gone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|bottom"
            android:layout_margin="@dimen/fab_margin"
            android:src="@drawable/ic_action_add" />

    </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:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/nav_menu" />

</android.support.v4.widget.DrawerLayout>
vandervdb commented 8 years ago

Same issue here... (and yeah! great job, many thanks)

g33kidd commented 7 years ago

Same issue here...