Navigation drawer (squashed and rebased).

This commit is contained in:
Ernir Erlingsson
2016-01-13 21:25:01 +01:00
committed by akwizgran
parent d33dbca25a
commit dae29eecce
26 changed files with 1260 additions and 637 deletions

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The first child(root) is the content view -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/BriarToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/default_background"/>
<RelativeLayout
android:id="@+id/container_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/default_background"
android:visibility="invisible"
tools:visibility="visible">
<ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleLargeInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
<TextView
android:id="@+id/title_progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/progress_bar"
android:gravity="center"
android:paddingTop="@dimen/margin_large"
tools:text="progress bar title"
/>
</RelativeLayout>
</FrameLayout>
</LinearLayout>
<!-- The second child is the menu -->
<include
android:id="@+id/navigation_menu_drawer"
layout="@layout/navigation_menu"
android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"/>
</android.support.v4.widget.DrawerLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dashboard_background"
>
</RelativeLayout>

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/nav_drawer_width"
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:layout_height="match_parent"
android:fadingEdge="none"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.AppCompatButton
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_seperator_height"
android:layout_marginLeft="@dimen/margin_large"/>
<android.support.v7.widget.AppCompatButton
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_seperator"
android:layout_marginLeft="@dimen/margin_large"/>
<android.support.v7.widget.AppCompatButton
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_seperator"
android:layout_marginLeft="@dimen/margin_large"/>
<android.support.v7.widget.AppCompatButton
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_seperator"
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>
</LinearLayout>

View File

@@ -26,4 +26,8 @@
<!-- this is needed as preference_category_material layout uses this color as the text color -->
<color name="preference_fallback_accent_color">@color/briar_accent</color>
<color name="default_background">#ffffff</color>
<color name="default_seperator">#000000</color>
<color name="default_seperator_inverted">#ffffff</color>
<color name="menu_background">#FFFFFF</color>
</resources>

View File

@@ -17,5 +17,7 @@
<dimen name="text_size_medium">16sp</dimen>
<dimen name="text_size_large">20sp</dimen>
<dimen name="text_size_xlarge">34sp</dimen>
<dimen name="nav_drawer_width">300dp</dimen>
<dimen name="nav_seperator_height">1dp</dimen>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nav_drawer_open_description">Open the navigation drawer</string>
<string name="nav_drawer_close_description">Close the navigation drawer</string>
<string name="app_name">Briar</string>
<string name="crash_report_title">Briar Crash Report</string>
<string name="ongoing_notification_title">Signed into Briar</string>
@@ -141,4 +141,15 @@
<string name="dialog_message_delete_contact">Are you sure that you want to remove this contact and all messages exchanged with this contact?</string>
<string name="dialog_title_connect_panic_app">Confirm Panic App</string>
<string name="dialog_message_connect_panic_app">Are you sure that you want to allow %1$s to trigger destructive panic button actions?</string>
<string name="dialog_title_welcome">Welcome to Briar</string>
<string name="dialog_welcome_message">Add a contact to start communicating securely or press the icon in the upper left corner of the screen for more options.</string>
<string name="dialog_button_ok">OK</string>
<!-- Toolbar headers -->
<string name="dashboard_toolbar_header">Briar</string>
<string name="settings_toolbar_header">Settings</string>
<string name="contacts_toolbar_header">Contacts</string>
<string name="forums_toolbar_header">Forums</string>
<!-- Progress titles -->
<string name="progress_title_logout">Signing out of Briar..</string>
<string name="progress_title_please_wait">Please wait..</string>
</resources>

View File

@@ -12,6 +12,36 @@
<item name="android:textColorLink">@color/briar_text_link</item>
</style>
<style name="BriarThemeNoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/BriarToolbar</item>
<item name="colorPrimary">@color/briar_primary</item>
<item name="colorPrimaryDark">@color/briar_primary_dark</item>
<item name="colorAccent">@color/briar_primary</item>
<item name="android:textColorPrimary">@color/briar_text_primary</item>
<item name="android:textColorPrimaryInverse">@color/briar_text_primary_inverse</item>
<item name="android:textColorSecondary">@color/briar_text_primary</item>
<item name="android:textColorLink">@color/briar_text_link</item>
</style>
<style name="BriarThemeNoActionBar.Default" />
<style name="BriarToolbar" parent="Widget.AppCompat.Toolbar">
<item name="android:background">?colorPrimary</item>
<item name="android:textColorPrimary">@color/briar_text_primary_inverse</item>
<item name="android:textSize">@dimen/text_size_medium</item>
<item name="colorPrimary">@color/briar_primary</item>
<item name="titleTextAppearance">@style/BriarToolbarTextAppearance</item>
<item name="android:theme">@style/BriarToolbarTheme</item>
</style>
<style name="BriarToolbarTheme">
<item name="colorControlNormal">@color/briar_text_primary_inverse</item>
</style>
<style name="BriarToolbarTextAppearance" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textColor">@color/briar_text_primary_inverse</item>
</style>
<style name="BriarTheme" parent="BriarBaseTheme">
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="android:listSeparatorTextViewStyle">@style/BriarTheme.ListSeparatorTextView</item>
@@ -33,6 +63,10 @@
<item name="android:textColor">@android:color/primary_text_light</item>
</style>
<style name="BriarTextTitleInverted" parent="BriarTextTitle">
<item name="android:textColor">@android:color/primary_text_dark</item>
</style>
<style name="BriarTextBody">
<item name="android:textSize">@dimen/text_size_small</item>
<item name="android:textColor">@android:color/primary_text_light</item>
@@ -47,6 +81,17 @@
<item name="android:layout_height">1px</item>
</style>
<style name="NavMenuButton" parent="Widget.AppCompat.Button.Borderless.Colored">
<item name="android:textSize">@dimen/text_size_medium</item>
<item name="android:textColor">@android:color/tertiary_text_light</item>
<item name="android:paddingTop">@dimen/margin_large</item>
<item name="android:paddingBottom">@dimen/margin_large</item>
<item name="android:drawablePadding">@dimen/margin_xlarge</item>
<item name="android:gravity">left|center_vertical</item>
<item name="android:layout_margin">0dp</item>
<item name="android:paddingLeft">@dimen/margin_large</item>
</style>
<!-- This fixes a UI bug in the support preference library -->
<style name="BriarTheme.ListSeparatorTextView">
<item name="android:textSize">14sp</item>