-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add navigation view to activity_main.xml file
- Loading branch information
Yağmur Erdoğan
committed
Aug 19, 2021
1 parent
5946855
commit 8f49b94
Showing
3 changed files
with
41 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
62 changes: 39 additions & 23 deletions
62
NavigationComponent2/app/src/main/res/layout/activity_main.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http:https://schemas.android.com/apk/res/android" | ||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http:https://schemas.android.com/apk/res/android" | ||
xmlns:app="http:https://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http:https://schemas.android.com/tools" | ||
android:id="@+id/drawer_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".MainActivity"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/purple_500" | ||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | ||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> | ||
|
||
<androidx.fragment.app.FragmentContainerView | ||
android:id="@+id/nav_host_fragment" | ||
android:name="androidx.navigation.fragment.NavHostFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_above="@id/bottom_nav" | ||
android:layout_below="@id/toolbar" | ||
app:defaultNavHost="true" | ||
app:navGraph="@navigation/nav_graph" /> | ||
android:layout_height="match_parent"> | ||
|
||
<com.google.android.material.bottomnavigation.BottomNavigationView | ||
android:id="@+id/bottom_nav" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/purple_500" | ||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | ||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> | ||
|
||
<androidx.fragment.app.FragmentContainerView | ||
android:id="@+id/nav_host_fragment" | ||
android:name="androidx.navigation.fragment.NavHostFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_above="@id/bottom_nav" | ||
android:layout_below="@id/toolbar" | ||
app:defaultNavHost="true" | ||
app:navGraph="@navigation/nav_graph" /> | ||
|
||
<com.google.android.material.bottomnavigation.BottomNavigationView | ||
android:id="@+id/bottom_nav" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
app:menu="@menu/drawer_bottom_nav_menu" /> | ||
|
||
</RelativeLayout> | ||
|
||
<com.google.android.material.navigation.NavigationView | ||
android:id="@+id/nav_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="start" | ||
app:menu="@menu/drawer_bottom_nav_menu" /> | ||
</RelativeLayout> | ||
|
||
|
||
</androidx.drawerlayout.widget.DrawerLayout> |