An open API service indexing awesome lists of open source software.

https://github.com/datalux/fabottombar

An Android library that implements a bottom bar with FAB
https://github.com/datalux/fabottombar

android android-library bottombar

Last synced: 8 months ago
JSON representation

An Android library that implements a bottom bar with FAB

Awesome Lists containing this project

README

          

# FABottomBar

![FABottomBar](fabottom.gif)

## Usage
### Add layout
```xml


```

#### Change bottom bar backgorund color
Add `background_color` in `FABottomBar` tag.
```xml
app:background_color="@color/colorPrimary"

```

### Use it in your Activity or Fragment
#### Initialization
```kotlin
val faBottomBar = findViewById(R.id.fab_bottom_bar)
```

#### Add your FAB item
```kotlin
faBottomBar.setFabItem(R.id.item_id)
```

#### Hide FAB
```kotlin
faBottomBar!!.hideFAB(findViewById(R.id.your_fab_id)
```

#### Show FAB
```kotlin
faBottomBar!!.showFAB(findViewById(R.id.your_fab_id)
```

#### Hide Item
```kotlin
faBottomBar.hideItem()
```

#### Show Item
```kotlin
faBottomBar.hideItem()
```

#### Set your OnNavigationItemSelectedListener
```kotlin
faBottomBar.setOnNavigationItemSelectedListener(
BottomNavigationView.OnNavigationItemSelectedListener { item: MenuItem ->
when (item.itemId) {
R.id.a ->
return@OnNavigationItemSelectedListener faBottomBar!!.hideFAB(findViewById(R.id.fab))
R.id.b ->
return@OnNavigationItemSelectedListener faBottomBar!!.showFAB(findViewById(R.id.fab))
R.id.c ->
return@OnNavigationItemSelectedListener faBottomBar!!.hideFAB(findViewById(R.id.fab))
}
false
})
```

## Gradle Dependency
- gradle project level
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
- gradle application level
```gradle
dependencies {
implementation 'com.github.Datalux:FABottomBar:0.1'
}
```