来自http://androidwing.net/index.php
我这里只是简单的介绍如何的使用,具体实现参考原博主
1.在gradle 编译库文件
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.githubwing:ByeBurger:1.1.0'//
compile 'com.android.support:design:25.0.0'//
}
2.添加 app:layout_behavior属性,即可实现滑动的隐藏和显示
<android.support.design.widget.CoordinatorLayout>
<Viewpager />
<Toolbar
app:layout_behavior="@string/bye_burger_title_behavior"
/>
<BottomTab
android:layout_gravity="bottom"
app:layout_behavior="@string/bye_burger_bottom_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
具体的就是:
标题栏可以是Toolbar或者LinearLayout或者其他
// 对于标题栏
app:layout_behavior="@string/bye_burger_title_behavior"
底部导航栏可以是最新的 BottomNavigationView 亦或者TabLayout在古老一点的RadioButton都可以!
//对于底部导航栏
app:layout_behavior="@string/bye_burger_bottom_behavior"