Change style of drawer navigation
Change-Id: I8e8856a4fbac712e52fd5d28a5d520b90132226c
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 037aa3f..fe3c704 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -2,6 +2,7 @@
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -14,13 +15,13 @@
android:layout_height="match_parent"
/>
- <!-- DrawerFragment for user navigation -->
- <FrameLayout
+ <com.google.android.material.navigation.NavigationView
android:id="@+id/navigation_drawer"
- android:layout_width="@dimen/drawer_width"
+ android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
- tools:layout="@layout/activity_main_drawer_listview"
+ app:headerLayout="@layout/drawer_header"
+ app:menu="@menu/drawer_menu"
/>
</androidx.drawerlayout.widget.DrawerLayout>
diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml
new file mode 100644
index 0000000..c36facc
--- /dev/null
+++ b/app/src/main/res/layout/drawer_header.xml
@@ -0,0 +1,14 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:padding="10dp"
+ android:gravity="center"
+ android:layout_height="80dp"
+ android:layout_gravity="center">
+
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:src="@drawable/ndn_logo"
+ android:layout_gravity="center" />
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/list_item_drawer_item.xml b/app/src/main/res/layout/list_item_drawer_item.xml
index 08a598b..c14d385 100644
--- a/app/src/main/res/layout/list_item_drawer_item.xml
+++ b/app/src/main/res/layout/list_item_drawer_item.xml
@@ -4,8 +4,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/drawer_item_background_activated"
- android:paddingLeft="@dimen/default_padding_left"
- android:paddingRight="@dimen/default_padding_right"
+ android:paddingStart="@dimen/default_padding_left"
+ android:paddingEnd="@dimen/default_padding_right"
>
<ImageView