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
- Host: GitHub
- URL: https://github.com/datalux/fabottombar
- Owner: Datalux
- Created: 2020-05-17T15:15:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-18T08:24:43.000Z (over 5 years ago)
- Last Synced: 2024-12-12T16:12:13.043Z (10 months ago)
- Topics: android, android-library, bottombar
- Language: Kotlin
- Homepage:
- Size: 355 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FABottomBar

## 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'
}
```