Material CAB

Additional

Language
Kotlin
Version
1.0.0 (Jul 21, 2018)
Created
May 4, 2015
Updated
Jul 22, 2018
Owner
Aidan Follestad (afollestad)
Contributors
Aidan Follestad (afollestad)
MDXDave
Niklas Baudy (vanniktech)
John Carlson (Jawnnypoo)
4
Activity
Badge
Generate
Download
Source code
APK file

Advertising

Material Contextual Action Bar

Material CAB allows you to implement a customizable and flexible contextual action bar in your app. The traditional stock CAB on Android is limited to being placed at the top of your Activity, and the navigation drawer cannot go over it. This library lets you choose its exact location, and a toolbar is used, allowing views to be be placed over and under it.

Gradle Dependency

Add Material CAB to your module's build.gradle dependencies block:

dependencies {

    implementation 'com.afollestad:material-cab:1.0.0'
}


You attach a Material CAB to the Activity like this:

MaterialCab.attach(this, R.id.cab_stub)

val active = MaterialCab.isActive // true

R.id.cab_stub references the ViewStub, which is replaced with the CAB toolbar.

In addition, you can also pass the ID of a ViewGroup (such as a FrameLayout). The CAB will get added as a child to that view group.