This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| implementation 'android.arch.navigation:navigation-fragment:2.3.0-alpha04' | |
| implementation 'android.arch.navigation:navigation-ui:2.3.0-alpha04' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <menu xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item | |
| android:id="@+id/homeFragment" | |
| android:icon="@drawable/ic_home_black_24dp" | |
| android:title="Home" /> | |
| <item | |
| android:id="@+id/navFirstFragment" | |
| android:icon="@drawable/ic_page" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override fun onSupportNavigateUp(): Boolean {// Up button will work on this method | |
| return Navigation.findNavController(this, R.id.my_nav_host_fragment).navigateUp() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".MainActivity"> | |
| <fragment | |
| android:id="@+id/my_nav_host_fragment" |