Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
val bottomNavigation = bottomNavigation {
id = R.id.bottom_nav_view
inflateMenu(R.menu.bottom_navigation_menu)
}
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@id/homeFragment"
android:icon="@drawable/ic_home"
android:title="@string/menu_title_home"/>
<item
android:id="@id/usersFragment"
android:icon="@drawable/ic_users"
android:title="@string/menu_title_users"/>
<item
android:id="@id/detailsFragment"
android:icon="@drawable/ic_info"
android:title="@string/menu_title_details"/>
<item
android:id="@id/moreFragment"
android:icon="@drawable/ic_more"
android:title="@string/menu_title_more"/>
</menu>
bottomNavigation {
val bottomNavigation = bottomNavigation {
id = R.id.bottom_nav_view
inflateMenu(R.menu.bottom_navigation_menu)
}
connect(
START to START of PARENT_ID,
END to END of PARENT_ID,
TOP to BOTTOM of R.id.fragment_container,
BOTTOM to BOTTOM of PARENT_ID
)
}inline fun ViewManager.bottomNavigation(init: BottomNavigationView.() -> Unit = {}) = ankoView({ BottomNavigationView(it) }, theme = 0, init = init)
Создание Bottom Navigation Bar на Kotlin с использованием Anko