mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2025-07-07 18:42:53 +00:00
Preliminary version of drawer
This commit is contained in:
9
app/src/main/res/drawable/side_nav_bar.xml
Normal file
9
app/src/main/res/drawable/side_nav_bar.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:centerColor="#009688"
|
||||
android:endColor="#00695C"
|
||||
android:startColor="#4DB6AC"
|
||||
android:type="linear" />
|
||||
</shape>
|
@ -1,23 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
android:fitsSystemWindows="false"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/main_fragment"
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="2" />
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<android.support.design.widget.BottomNavigationView
|
||||
android:id="@+id/main_bottom_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:menu="@menu/main_bottom_navigation" />
|
||||
<FrameLayout
|
||||
android:id="@+id/main_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2" />
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
36
app/src/main/res/layout/nav_header_main.xml
Normal file
36
app/src/main/res/layout/nav_header_main.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_header_height"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@drawable/side_nav_bar"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/nav_header_desc"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
android:src="@drawable/default_account_image" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
tools:text="User name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="email@example.com" />
|
||||
|
||||
</LinearLayout>
|
@ -6,17 +6,17 @@
|
||||
android:title="@string/navigation_bottom_notif_item"
|
||||
android:icon="@drawable/ic_notif"/>
|
||||
|
||||
<!--<item
|
||||
<item
|
||||
android:id="@+id/main_bottom_navigation_friends_list"
|
||||
android:title="@string/navigation_bottom_friends_item"
|
||||
android:icon="@drawable/ic_menu_allfriends"
|
||||
/>-->
|
||||
/>
|
||||
|
||||
<!--<item
|
||||
<item
|
||||
android:id="@+id/main_bottom_navigation_users_view"
|
||||
android:title="@string/navigation_bottom_user_item"
|
||||
android:icon="@drawable/perm_group_personal_info"
|
||||
android:visible="false" />-->
|
||||
android:visible="false" />
|
||||
|
||||
<item
|
||||
android:id="@+id/main_bottom_navigation_me_view"
|
@ -1,4 +1,11 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="nav_header_vertical_spacing">8dp</dimen>
|
||||
<dimen name="nav_header_height">176dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
|
||||
<!-- The default size of an account image -->
|
||||
<dimen name="account_image_default_width">64dp</dimen>
|
||||
<dimen name="account_image_default_height">64dp</dimen>
|
||||
|
@ -196,4 +196,7 @@
|
||||
<string name="tab_posts">Posts</string>
|
||||
<string name="member_for">Member for</string>
|
||||
<string name="action_create_post">Create a new post</string>
|
||||
<string name="nav_header_desc">Navigation header</string>
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
</resources>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
|
Reference in New Issue
Block a user