Dimezis/BottomNavigationBar


Simple Bottom Navigation Bar for Android

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.Dimezis:BottomNavigationBar:version-0.9.6'
	}
	dependencies {
		implementation("com.github.Dimezis:BottomNavigationBar:version-0.9.6")
	}
	<dependency>
	    <groupId>com.github.Dimezis</groupId>
	    <artifactId>BottomNavigationBar</artifactId>
	    <version>version-0.9.6</version>
	</dependency>

                            
    libraryDependencies += "com.github.Dimezis" % "BottomNavigationBar" % "version-0.9.6"
        
        

                            
    :dependencies [[com.github.Dimezis/BottomNavigationBar "version-0.9.6"]]
        
        

Readme


Stand With Ukraine

BottomNavigationBar

Simple Bottom Navigation Bar for Android.

alt tag

alt tag

How to use it

  <com.eightbitlab.bottomnavigationbar.BottomNavigationBar
      android:id="@+id/bottom_bar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/colorPrimary"
      app:activeTabColor="@android:color/white"
      app:inactiveTabColor="@color/bottomBarDefaultTextColor"/>
  BottomBarItem item = new BottomBarItem(R.drawable.test_icon, R.string.title);

  bottomNavigationBar.addTab(item);
  
  // Optional badge 
  bottomNavigationBar.showBadge(position, badge);
  bottomBar.setOnSelectListener(new BottomNavigationBar.OnSelectListener() {
      @Override
      public void onSelect(int position) {
          doStuff(position);
      }
  });

Gradle

compile 'com.eightbitlab:bottomnavigationbar:0.9.6'

Why is it better than library X?

1) Tabs without titles are supported

2) Properly displayed in layout editor

3) Simple layout, no nested containers

4) Simple API and code

5) Smooth native animations, no alpha or requestLayout() calls

6) Properly scales to any height

7) It's tiny. Much smaller than some average bottom bar lib

Why is it worse than library X?

1) There's only a single behavior - fixed tabs. No shifting mode, no dynamic color change of bottom bar

2) No special tablet mode

3) Currently no animation customization