Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <android.support.design.widget.BottomNavigationView
- android:id="@+id/navigation"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="0dp"
- android:layout_marginStart="0dp"
- app:labelVisibilityMode="labeled"
- android:background="?android:attr/windowBackground"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:menu="@menu/navigation"/>
- <?xml version="1.0" encoding="utf-8"?>
- <item
- android:id="@+id/navigation_home"
- android:icon="@drawable/ic_home_light"
- android:title="@string/str_home"/>
- <item
- android:id="@+id/navigation_medidate"
- android:icon="@drawable/ic_meditation_light"
- android:title="@string/str_meditade"/>
- <item
- android:id="@+id/navigation_lessions"
- android:icon="@drawable/ic_lesson_light"
- android:title="@string/str_lessions"/>
- <item
- android:id="@+id/navigation_sleep"
- android:visible="false"
- android:icon="@drawable/ic_sleep_light"
- android:title="@string/str_sleep"/>
- <item
- android:id="@+id/navigation_cources"
- android:icon="@drawable/ic_course_light"
- android:visible="false"
- android:title="@string/str_courses"/>
- private val mOnNavigationItemSelectedListener = BottomNavigationView.OnNavigationItemSelectedListener { item ->
- when (item.itemId) {
- R.id.navigation_home -> {
- return@OnNavigationItemSelectedListener true
- }
- R.id.navigation_cources -> {
- return@OnNavigationItemSelectedListener true
- }
- R.id.navigation_lessions -> {
- return@OnNavigationItemSelectedListener true
- }
- R.id.navigation_medidate -> {
- return@OnNavigationItemSelectedListener true
- }
- R.id.navigation_sleep -> {
- return@OnNavigationItemSelectedListener true
- }
- }
- false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement