Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ibrahimsn98/nicebottombar
A lightweight Android material bottom navigation bar library
https://github.com/ibrahimsn98/nicebottombar
android android-bottom-navigation android-development android-library android-tabs bottom-navigation
Last synced: about 14 hours ago
JSON representation
A lightweight Android material bottom navigation bar library
- Host: GitHub
- URL: https://github.com/ibrahimsn98/nicebottombar
- Owner: ibrahimsn98
- License: mit
- Created: 2019-03-11T18:38:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T16:09:40.000Z (almost 4 years ago)
- Last Synced: 2025-01-24T03:34:57.297Z (8 days ago)
- Topics: android, android-bottom-navigation, android-development, android-library, android-tabs, bottom-navigation
- Language: Kotlin
- Size: 350 KB
- Stars: 199
- Watchers: 4
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NiceBottomBar
A lightweight Android material bottom navigation bar library
[![](https://jitpack.io/v/ibrahimsn98/NiceBottomBar.svg)](https://jitpack.io/#ibrahimsn98/NiceBottomBar)
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)## GIF
## Usage
- Create menu.xml under your res/menu/ folder
```xml
```
- Add view into your layout file
```xml```
- Use NiceBottomBar functions in your activity
```kotlin
bottomBar.setActiveItem(1)
bottomBar.setBadge(2)
bottomBar.removeBadge(2)bottomBar.onItemSelected = {
status.text = "Item $it selected"
}bottomBar.onItemReselected = {
status.text = "Item $it re-selected"
}bottomBar.onItemLongClick = {
status.text = "Item $it long click"
}
```OR
```kotlin
bottomBar.setOnItemSelectedListener(object: OnItemSelectedListener {
override fun onItemSelect(pos: Int) {
status.text = "Item $pos selected"
}
})bottomBar.setOnItemReselectedListener(object: OnItemReselectedListener {
override fun onItemReselect(pos: Int) {
status.text = "Item $pos re-selected"
}
})bottomBar.setOnItemLongClickListener(object: OnItemLongClickListener {
override fun onItemLongClick(pos: Int) {
status.text = "Item $pos long click"
}
})
```## Use in Java
```
NiceBottomBar bottomBar = (NiceBottomBar) findViewById(R.id.bottomBar);bottomBar.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelect(int pos) {
// Do action
}
});bottomBar.setOnItemReselectedListener(new OnItemReselectedListener() {
@Override
public void onItemReselect(int pos) {
// Do action
}
});bottomBar.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public void onItemLongClick(int pos) {
// Do action
}
});```
## Customization
```xml
```
## Setup
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.ibrahimsn98:NiceBottomBar:2.2'
}
```## License
```
MIT LicenseCopyright (c) 2019 İbrahim Süren
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```> Follow me on Twitter [@ibrahimsn98](https://twitter.com/ibrahimsn98)