NavigationBarView

SESL Varaint Provides an abstract implementation of a navigation bar that can be used to implementation such as Bottom Navigation or Navigation rail.

Navigation bars make it easy for users to explore and switch between top-level views in a single tap.

The bar contents can be populated by specifying a menu resource file. Each menu item title, icon and enabled state will be used for displaying navigation bar items. Menu items can also be used for programmatically selecting which destination is currently active. It can be done using MenuItem#setChecked(true)

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, @AttrRes defStyleAttr: Int, @StyleRes defStyleRes: Int)

Types

Link copied to clipboard
Menu Label visibility mode enum for component provide an implementation of navigation bar view.
Link copied to clipboard
Listener for handling reselection events on navigation items.
Link copied to clipboard
Listener for handling selection events on navigation items.

Properties

Link copied to clipboard
Link copied to clipboard
Label behaves as "labeled" when there are 3 items or less, or "selected" when there are 4 items or more.
Link copied to clipboard
Label is shown on all navigation items.
Link copied to clipboard
Label is shown on the selected navigation item.
Link copied to clipboard
Label is not shown on any navigation items.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Get the distance between the active indicator container and the item's label.
Link copied to clipboard
open fun getBadge(menuItemId: Int): BadgeDrawable
Returns an instance of BadgeDrawable associated with menuItemId, null if none was initialized.
Link copied to clipboard
Get the color of the active indicator drawable.
Link copied to clipboard
Get the width of an item's active indicator.
Link copied to clipboard
Get the margin that will be maintained at the start and end of the active indicator away from the edges of its parent container.
Link copied to clipboard
Link copied to clipboard
Get the width of an item's active indicator.
Link copied to clipboard
Returns the background drawable of the menu items.
Link copied to clipboard
Returns the background resource of the menu items.
Link copied to clipboard
Returns the size provided for the menu item icons in pixels.
Link copied to clipboard
Returns the tint which is applied to our menu items' icons.
Link copied to clipboard
Get the distance from the bottom of an item's label to the bottom of the navigation bar item.
Link copied to clipboard
Get the distance from the top of an item's icon/active indicator to the top of the navigation bar item.
Link copied to clipboard
Returns the text appearance used for the active menu item label.
Link copied to clipboard
Returns the text appearance used for inactive menu item labels.
Link copied to clipboard
Returns colors used for the different states (normal, selected, focused, etc.) of the menu item text.
Link copied to clipboard
Returns the current label visibility mode used by this NavigationBarView.
Link copied to clipboard
abstract fun getMaxItemCount(): Int
Returns the maximum number of items that can be shown in NavigationBarView.
Link copied to clipboard
open fun getMenu(): Menu
Returns the Menu instance associated with this navigation bar.
Link copied to clipboard
Returns the MenuView instance associated with this navigation bar.
Link copied to clipboard
open fun getOrCreateBadge(menuItemId: Int): BadgeDrawable
Creates an instance of BadgeDrawable associated with menuItemId if none exists.
Link copied to clipboard
Returns the currently selected menu item ID, or zero if there is no menu.
Link copied to clipboard
open fun inflateMenu(resId: Int)
Inflate a menu resource into this navigation view.
Link copied to clipboard
Get whether or not a selected item should show an active indicator.
Link copied to clipboard
open fun removeBadge(menuItemId: Int)
Removes the BadgeDrawable associated with menuItemId.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun seslSetHasIcon(hasIcon: Boolean)
Link copied to clipboard
open fun seslSetLabelTextAppearance(@StyleRes textAppearanceRes: Int)
Link copied to clipboard
open fun seslSetUpdateAnimation(enabled: Boolean)
Link copied to clipboard
open fun seslSetViewType(viewType: Int)
Link copied to clipboard
Link copied to clipboard
open fun setActiveIndicatorLabelPadding(@Px activeIndicatorLabelPadding: Int)
Set the distance between the active indicator container and the item's label.
Link copied to clipboard
open fun setElevation(elevation: Float)
Sets the base elevation of this view, in pixels.
Link copied to clipboard
Set the ColorStateList of the active indicator drawable.
Link copied to clipboard
Set whether a selected item should show an active indicator.
Link copied to clipboard
open fun setItemActiveIndicatorHeight(@Px height: Int)
Set the height of an item's active indicator.
Link copied to clipboard
open fun setItemActiveIndicatorMarginHorizontal(@Px horizontalMargin: Int)
Set the horizontal margin that will be maintained at the start and end of the active indicator, making sure the indicator remains the given distance from the edge of its parent container.
Link copied to clipboard
Set the ShapeAppearanceModel of the active indicator drawable.
Link copied to clipboard
Set the width of an item's active indicator.
Link copied to clipboard
open fun setItemBackground(@Nullable background: Drawable)
Set the background of our menu items to the given drawable.
Link copied to clipboard
Set the background of our menu items to the given resource.
Link copied to clipboard
open fun setItemIconSize(@Dimension iconSize: Int)
Set the size to provide for the menu item icons.
Link copied to clipboard
open fun setItemIconSizeRes(@DimenRes iconSizeRes: Int)
Set the size to provide for the menu item icons using a resource ID.
Link copied to clipboard
Set the tint which is applied to our menu items' icons.
Link copied to clipboard
open fun setItemOnTouchListener(menuItemId: Int, @Nullable onTouchListener: View.OnTouchListener)
Sets an android.view.View.OnTouchListener for the item view associated with the provided menuItemId.
Link copied to clipboard
open fun setItemPaddingBottom(@Px paddingBottom: Int)
Set the distance from the bottom of an item's label to the bottom of the navigation bar item.
Link copied to clipboard
open fun setItemPaddingTop(@Px paddingTop: Int)
Set the distance from the top of an items icon/active indicator to the top of the navigation bar item.
Link copied to clipboard
open fun setItemTextAppearanceActive(@StyleRes textAppearanceRes: Int)
Sets the text appearance to be used for the menu item labels.
Link copied to clipboard
open fun setItemTextAppearanceInactive(@StyleRes textAppearanceRes: Int)
Sets the text appearance to be used for inactive menu item labels.
Link copied to clipboard
Set the colors to use for the different states (normal, selected, focused, etc.) of the menu item text.
Link copied to clipboard
open fun setLabelVisibilityMode(labelVisibilityMode: Int)
Sets the navigation items' label visibility mode.
Link copied to clipboard
Set a listener that will be notified when the currently selected navigation item is reselected.
Link copied to clipboard
Set a listener that will be notified when a navigation item is selected.
Link copied to clipboard
open fun setSelectedItemId(@IdRes itemId: Int)
Set the selected menu item ID.