KBottomNavigation
A simple and curved bottom navigation bar for Android written in Kotlin
Install / Use
/learn @hamzaahmedkhan/KBottomNavigationREADME
Kotlin Bottom Navigation
A simple & curved & material bottom navigation for Android written in kotlin

Download
build.gradle (project path)
buildscript {
repositories {
jcenter() // this line need
}
....
}
build.gradle (module path)
dependencies {
implementation 'com.github.hamzaahmedkhan:KBottomNavigation:1.0.0'
}
use androidx by adding this lines to gradle.properties
android.useAndroidX=true
android.enableJetifier=true
Usage
add Kotlin Bottom Navigation in xml
<com.hk.kbottomnavigation.KBottomNavigation
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
add menu items in code.
remember icons must be vector drawable
companion object {
private const val ID_HOME = 1
private const val ID_EXPLORE = 2
private const val ID_MESSAGE = 3
private const val ID_NOTIFICATION = 4
private const val ID_ACCOUNT = 5
}
val bottomNavigation = findView(R.id.bottomNavigation)
bottomNavigation.add(KBottomNavigation.Model(ID_HOME, R.drawable.ic_home))
bottomNavigation.add(KBottomNavigation.Model(ID_EXPLORE, R.drawable.ic_explore))
bottomNavigation.add(KBottomNavigation.Model(ID_MESSAGE, R.drawable.ic_message))
bottomNavigation.add(KBottomNavigation.Model(ID_NOTIFICATION, R.drawable.ic_notification))
bottomNavigation.add(KBottomNavigation.Model(ID_ACCOUNT, R.drawable.ic_account))
// To set count
bottomNavigation.setCount(ID_NOTIFICATION, "115")
....
Customization
<com.hk.kbottomnavigation.KBottomNavigation
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mbn_backgroundBottomColor="#ffffff"
app:mbn_countBackgroundColor="#ff6f00"
app:mbn_countTextColor="#ffffff"
app:mbn_countTypeface="fonts/SourceSansPro-Regular.ttf"
app:mbn_defaultIconColor="#90a4ae"
app:mbn_rippleColor="#2f424242"
app:mbn_selectedIconColor="#3c415e"
app:mbn_shadowColor="#1f212121"/>
Listeners
bottomNavigation.setOnShowListener {
val name = when (it.id) {
ID_HOME -> "HOME"
ID_EXPLORE -> "EXPLORE"
ID_MESSAGE -> "MESSAGE"
ID_NOTIFICATION -> "NOTIFICATION"
ID_ACCOUNT -> "ACCOUNT"
else -> ""
}
tv_selected.text = "$name page is selected"
}
bottomNavigation.setOnClickMenuListener {
val name = when (it.id) {
ID_HOME -> "HOME"
ID_EXPLORE -> "EXPLORE"
ID_MESSAGE -> "MESSAGE"
ID_NOTIFICATION -> "NOTIFICATION"
ID_ACCOUNT -> "ACCOUNT"
else -> ""
}
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
