1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2026-08-26 07:30:21 +00:00

Rewrite application navigation to a better user experience

This commit is contained in:
Loic Blot
2016-03-07 21:25:36 +01:00
parent c8f37561cf
commit c49a098961
24 changed files with 257 additions and 442 deletions
+53 -3
View File
@@ -25,9 +25,59 @@
*/
-->
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
<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:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="fr.unix_experience.owncloud_sms.activities.MainActivity" />
android:fitsSystemWindows="true"
tools:openDrawer="start"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/main_title_welcome"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/ma_title_welcome"
android:gravity="top"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/main_tv_welcome"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:layout_alignParentRight="true"
android:layout_below="@+id/main_title_welcome"
android:text="@string/ma_content_welcome"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/main_tv_swipe"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:layout_alignParentRight="true"
android:layout_below="@+id/main_tv_welcome"
android:text="@string/ma_content_swipeaction"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<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>
@@ -1,120 +0,0 @@
<!--
/*
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-->
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/main_tv_accounts"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
style="@style/h1"
android:text="@string/ma_title_add_account" />
<Button
android:id="@+id/main_button_accounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/main_tv_accounts"
android:onClick="openAddAccount"
style="@style/StandardButton"
android:text="@string/ma_button_goto_sync" />
<TextView
android:id="@+id/textView1"
android:layout_alignLeft="@+id/main_tv_accounts"
android:layout_alignStart="@+id/main_tv_accounts"
android:layout_below="@+id/main_button_accounts"
style="@style/h1"
android:text="@string/ma_title_change_settings" />
<Button
android:id="@+id/main_button_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:onClick="openAppSettings"
style="@style/StandardButton"
android:text="@string/ma_button_goto_settings" />
<TextView
android:id="@+id/tv_launchsync"
android:layout_alignLeft="@+id/main_tv_accounts"
android:layout_alignStart="@+id/main_tv_accounts"
android:layout_below="@+id/main_button_settings"
style="@style/h1"
android:text="@string/ma_title_sync_all" />
<Button
android:id="@+id/main_button_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_launchsync"
android:onClick="syncAllMessages"
style="@style/StandardButton"
android:text="@string/ma_button_sync_accounts_now" />
<TextView
android:id="@+id/tv_remoteaccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_tv_accounts"
android:layout_alignStart="@+id/main_tv_accounts"
android:layout_below="@+id/main_button_sync"
android:layout_marginTop="18dp"
android:text="@string/ma_title_remote_account"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/main_button_choose_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_remoteaccount"
android:onClick="selectRemoteAccount"
style="@style/StandardButton"
android:text="@string/choose_account" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignStart="@+id/textView1"
android:layout_below="@+id/main_button_choose_account"
android:layout_marginTop="33dp"
android:src="@drawable/next_arrow" />
<!-- android:layout_below="@+id/main_button_syncruir" -->
</RelativeLayout>
@@ -1,73 +0,0 @@
<!--
/*
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-->
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/section_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/main_title_welcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="@string/ma_title_welcome"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/main_tv_welcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/section_label"
android:layout_alignStart="@+id/section_label"
android:layout_below="@+id/section_label"
android:layout_marginTop="16dp"
android:text="@string/ma_content_welcome"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:maxHeight="@dimen/arrow_max_height"
android:src="@drawable/next_arrow" />
</RelativeLayout>
@@ -1,83 +0,0 @@
<!--
/*
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-->
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/tv_title_thanksto"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="@string/ma_button_thanksto"
style="@style/h1" />
<TextView
android:id="@+id/tv_thankspeople"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/tv_title_thanksto"
android:layout_marginTop="15dp"
android:text="@string/ma_thanksto_people"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/button_rateus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_rateUs"
android:text="@string/ma_button_rate_us"
android:onClick="openGooglePlayStore"
style="@style/StandardButton" />
<TextView
android:id="@+id/ma_title_rateus"
android:layout_alignLeft="@+id/tv_thankspeople"
android:layout_alignStart="@+id/tv_rateUs"
android:layout_below="@+id/tv_thankspeople"
style="@style/h1"
android:text="@string/ma_title_rate_us" />
<TextView
android:id="@+id/tv_rateUs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_below="@+id/ma_title_rateus"
android:text="@string/ma_content_rate_us"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
+27
View File
@@ -0,0 +1,27 @@
<?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"
android:background="@drawable/side_nav_bar"
android:gravity="top"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:src="@drawable/ic_launcher"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
</LinearLayout>