Blog Fragment in Navigation Drawer with Tabs

This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Closes #409
This commit is contained in:
Torsten Grote
2016-06-02 19:06:53 -03:00
parent bba7083660
commit 3f838b0472
40 changed files with 410 additions and 109 deletions

View File

@@ -1,110 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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="@dimen/nav_drawer_width"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/menu_background"
android:orientation="vertical">
<TextView
android:id="@+id/nav_menu_header"
style="@style/BriarTextTitleInverted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/briar_primary"
android:paddingBottom="@dimen/margin_large"
android:paddingLeft="@dimen/margin_large"
android:paddingTop="@dimen/margin_xlarge"
android:textStyle="bold"
tools:text="Username"
/>
<ScrollView
android:layout_width="match_parent"
<android.support.design.widget.NavigationView
android:id="@+id/navigation"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fadingEdge="none"
android:fillViewport="true">
android:layout_gravity="start"
app:headerLayout="@layout/navigation_header"
app:menu="@menu/navigation_drawer">
<LinearLayout
android:layout_width="match_parent"
<include
layout="@layout/transports_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/nav_btn_contacts"
style="@style/NavMenuButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/social_person"
android:onClick="onNavigationClick"
android:text="@string/contact_list_button"/>
<View
style="@style/Divider"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_separator_height"
android:layout_marginLeft="@dimen/margin_large"/>
<Button
android:id="@+id/nav_btn_forums"
style="@style/NavMenuButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/social_chat"
android:onClick="onNavigationClick"
android:text="@string/forums_button"/>
<View
style="@style/Divider"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_separator"
android:layout_marginLeft="@dimen/margin_large"/>
<Button
android:id="@+id/nav_btn_settings"
style="@style/NavMenuButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/action_settings"
android:onClick="onNavigationClick"
android:text="@string/settings_button"/>
<View
style="@style/Divider"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_separator"
android:layout_marginLeft="@dimen/margin_large"/>
<Button
android:id="@+id/nav_btn_signout"
style="@style/NavMenuButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/device_access_accounts"
android:onClick="onNavigationClick"
android:text="@string/sign_out_button"/>
<View
style="@style/Divider"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_separator"
android:layout_marginLeft="@dimen/margin_large"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"/>
<include
layout="@layout/transports_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
android:layout_gravity="bottom"
tools:visibility="gone"/>
</android.support.design.widget.NavigationView>
</LinearLayout>