Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

BottomBar

The Bottom Bar Component displays three to five destinations at the bottom of the screen.

banner-BottomBar

The Bottom Bar Component displays three to five destinations at the bottom of the screen. Each destination is represented by an icon and an optional text label. When the bottom navigation icon is clicked, the user is taken to the corresponding top-level navigation destination associated with that icon.

Legion Bottombar Android

Usage

To implement bottombar, you can follow the steps below.

Basic Bottom Bar

<com.telkom.legion.component.bottombar.LgnBottomBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="?attr/spacing2"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottombar_menu"/>

Bottom bar with Middle button

<com.telkom.legion.component.bottombar.LgnBottomBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="?attr/spacing2"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottombar_menu"
app:showMiddleButton="true"
app:middleButtonIconDrawable="@drawable/ic_camera"/>

Kotlin Code

Setup with navController

...
binding.apply {
...
bottomBarView.setupWithNavController(navController)
...
}
...

Setup with Selected Item Listener

...
binding.apply {
...
bottomBarView.setOnItemSelectedListener { menuItem ->
when (menuItem.itemId) {
...
R.id.home -> {
...
true

Setup middle button

...
binding.apply {
...
bottomBarView.setOnMiddleButtonClickListener {
...
}
...
}

Attributes

Attribute NameXml AttrsRelated method(s)Description
Menuapp:menu.menuSet menu item on Bottom bar
label visibility modeapp:labelVisibilityMode.labelVisibilityModeSet label visibility on menu item in Bottom bar
Show Middle Buttonapp:showMiddleButton.showMiddleButtonSet visibility on middle button on Bottom bar
Middle Button Icon Drawableapp:middleButtonIconDrawable.middleButtonIconDrawableSet icon drawable for middle button on Bottom bar
Get or Create BadgeN/AgetOrCreateBadgeCreate or Get existing badge on Menu in Bottom bar
Remove BadgeN/AremoveBadgeRemove existing badge on Menu in Bottom bar
Setup Bottom bar With NavControllerN/AsetupWithNavControllerSet up Bottom bar with NavController
Listener for selected menu itemN/ASetOnItemSelectedListenerSet up listener for selected menu item on Bottom bar
Listener for reselected menu itemN/ASetOnItemReselectedListenerSet up listener for reselected menu item on Bottom bar
Listener for middle buttonN/AsetOnMiddleButtonClickListenerSet up listener for middle button on Bottom bar