A customisable bottom navigation bar with Lottie Animation
buildscript {
...
repositories {
...
maven {
url "https://dl.bintray.com/subsub/maven"
}
}
dependencies {
...
}
}
...
allprojects {
repositories {
...
maven {
url "https://dl.bintray.com/subsub/maven"
}
}
}
implementation "com.subkhansarif.libs:bottomnavbarlib:{latestVersion}"
See sample project.
<com.subkhansarif.bottomnavbar.LottieBottomNavbar
android:id="@+id/bottom_navbar"
android:layout_width="0dp"
android:layout_height="56dp"
android:background="@color/colorWhite"
android:elevation="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
ArrayList<BottomMenu> menu = ArrayList();
menu.add(new BottomMenu(0L, getString(R.string.lbl_menu_profile), R.drawable.ic_person_grey, "a_cup_of_coffee.json"));
menu.add(new BottomMenu(1L, getString(R.string.lbl_menu_pet), R.drawable.ic_pets_grey, "a_cup_of_coffee.json"));
menu.add(new BottomMenu(2L, getString(R.string.lbl_menu_Food), R.drawable.ic_restaurant_menu_grey, null));
BottomMenu constructor parameters:
id: Long
, id for your buttonlabel: String
, label for this button. This will be shown below button iconicon: drawable res
, image resource for this button(optional) lottie_animation: String
, a String of json file name for Lottie Animation.
LottieBottomNavbar bottom_navbar = findViewById(R.id.bottom_navbar)
bottom_navbar.setSelected(1)
bottom_navbar.setMenu(menu)
bottom_navbar.setMenuClickListener(this)