Loading...

Lightweight Android Material Bottom Navigation Bar

SmoothBottomBar

A lightweight Android material bottom navigation bar library

GIF

Design Credits

All design and inspiration credits belong to Alejandro Ausejo.

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/menu_dashboard"
        android:icon="@drawable/ic_dashboard_white_24dp"/>

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

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

    <item
        android:id="@+id/item3"
        android:title="@string/menu_profile"
        android:icon="@drawable/ic_person_outline_white_24dp"/>

</menu>
  • Add view into your layout file
<me.ibrahimsn.lib.SmoothBottomBar
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_height="70dp"
    app:backgroundColor="@color/colorPrimary"
    app:menu="@menu/menu_bottom"/>
  • Use SmoothBottomBar callbacks in your activity
bottomBar.onItemSelected = {
    status.text = "Item $it selected"
}

bottomBar.onItemReselected = {
    status.text = "Item $it re-selected"
}
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"
    }
})

Customization

<me.ibrahimsn.lib.SmoothBottomBar
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        app:menu=""
        app:backgroundColor=""
        app:indicatorColor=""
        app:indicatorRadius=""
        app:sideMargins=""
        app:itemPadding=""
        app:textColor=""
        app:itemFontFamily=""
        app:textSize=""
        app:iconSize=""
        app:iconTint=""
        app:iconTintActive=""
        app:activeItem=""
        app:duration="" />

Setup

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

dependencies {
        implementation 'com.github.ibrahimsn98:SmoothBottomBar:1.7'
}

Download From GitHub

android-tabs-examples 7078256885086071998
Home item