• Stars
    star
    186
  • Rank 200,089 (Top 5 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created about 5 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight Android material bottom navigation bar library

NiceBottomBar

A lightweight Android material bottom navigation bar library

API

GIF

Usage

  • Create menu.xml under your res/menu/ folder
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

	<item
		android:id="@+id/item0"
		android:title="@string/servers"
		android:icon="@drawable/ic_dns_black_24dp" />

	<item
		android:id="@+id/item1"
		android:title="@string/search"
		android:icon="@drawable/ic_search_black_24dp" />

	<item
		android:id="@+id/item2"
		android:title="@string/billing"
		android:icon="@drawable/ic_receipt_black_24dp" />

	<item
		android:id="@+id/item3"
		android:title="@string/account"
		android:icon="@drawable/ic_account_circle_black_24dp" />
    
</menu>
  • Add view into your layout file
<me.ibrahimsn.lib.NiceBottomBar
	android:id="@+id/bottomBar"
	android:layout_width="match_parent"
	android:layout_height="60dp"
	app:menu="@menu/bottom_menu" />
  • Use NiceBottomBar functions in your activity
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

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

<me.ibrahimsn.lib.NiceBottomBar
	android:id="@+id/bottomBar"
	android:layout_width="match_parent"
	android:layout_height="60dp"
	app:menu="@menu/bottom_menu"
	app:backgroundColor=""
	app:indicatorEnabled=""
	app:indicatorColor=""
	app:indicatorWidth=""
	app:indicatorGravity=""
	app:itemFontFamily=""
	app:textColor=""
	app:textColorActive=""
	app:textSize=""
	app:iconSize=""
	app:iconMargin=""
	app:activeItem=""
	app:badgeColor=""
	app:indicatorInterpolator="anticipateOvershoot" />

Setup

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
        implementation 'com.github.ibrahimsn98:NiceBottomBar:2.2'
}

License

MIT License

Copyright (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

More Repositories

1

SmoothBottomBar

A lightweight Android material bottom navigation bar library
Kotlin
1,888
star
2

android-particles

A lightweight Particle Animation Library for Android
Kotlin
423
star
3

speedometer

A lightweight circular indicator view library for Android
Kotlin
262
star
4

web-dev-tools-android

Sample Android Application - MVVM, Clean Architecture, Modularization, Repository Pattern
Kotlin
260
star
5

PhoneNumberKit

Android Kotlin library to parse and format international phone numbers. Country code picker.
Kotlin
156
star
6

taskprogressview

A lightweight task progress calendar view library for Android
Kotlin
128
star
7

android-mvvm-dagger-2-rxjava-example

Sample Android Application - MVVM, Dagger 2, RxJava, Retrofit
Java
113
star
8

Freya

A lightweight, simplified form validation library for Android
Kotlin
88
star
9

CirclesLoadingView

Android Google Style Loading Animation Library (Needs performance optimizations!!)
Kotlin
84
star
10

live-preferences

Live Shared Preferences library for Android
Kotlin
72
star
11

achilles

A Simple Retrofit Inspired Android Websocket Client (In Development)
Kotlin
43
star
12

android-eth-wallet

Android cryptocurrency wallet app with clean architecture
Kotlin
37
star
13

android-datausage

An Android library to monitor cellular and wifi data usage easily
Kotlin
30
star
14

blockchain-in-go

A basic blockchain implementation in Golang
Go
21
star
15

android-live-broadcasts

Live broadcast receiver library for Android
Kotlin
21
star
16

sdwebui-kotlin

Kotlin API client for AUTOMATIC1111/stable-diffusion-webui
Kotlin
17
star
17

InputValidator

A Lightweight input validation library for Android
Kotlin
9
star
18

android-preference-editor

Edit the preferences of the Android applications
Python
5
star
19

gradle-maven-publish-example

Kotlin
4
star
20

aucc-game

Cyber security quiz game
Kotlin
4
star
21

github-explorer

A startup page Chrome extension which shows GitHub repositories that are related with your interests
JavaScript
4
star
22

yazgig

JavaScript
1
star
23

maven-version-fetcher

Go
1
star
24

pocketmine-mp-worldguard-plugin

Minecraft PE - PocketMine-MP-WorldGuard-Plugin
PHP
1
star
25

opencv-trials

Python
1
star
26

intellij-idea-plugin-trial

first intellij idea plugin
1
star