Improves tablet layout

This commit is contained in:
tom79 2017-06-20 18:48:20 +02:00
parent e6ff90c0d7
commit 6172a6a489
10 changed files with 370 additions and 15 deletions

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!-- About app name -->
<TextView
android:layout_marginTop="20dp"
android:textSize="22sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- About version -->
<TextView
android:layout_marginTop="10dp"
android:id="@+id/about_version"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- About developer -->
<LinearLayout
android:orientation="horizontal"
android:padding="20dp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textSize="18sp"
android:layout_gravity="center"
android:gravity="center"
android:clickable="true"
android:layout_width="200dp"
android:text="@string/about_developer"
android:layout_height="wrap_content" />
<Button
android:id="@+id/about_developer"
android:text="@string/about_developer_action"
android:layout_width="150dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- About license -->
<LinearLayout
android:orientation="horizontal"
android:padding="20dp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/about_license"
android:textSize="18sp"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/about_license"
android:text="@string/about_license_action"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="150dp"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- About license -->
<LinearLayout
android:orientation="horizontal"
android:padding="18sp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/about_code"
android:textSize="16sp"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/about_code"
android:text="@string/about_code_action"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="150dp"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="#fff"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<ImageView
android:layout_marginTop="20dp"
android:layout_width="100dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/mastodonlogo"
android:layout_height="100dp"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_margin="50dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:layout_height="wrap_content">
<EditText
android:visibility="gone"
android:id="@+id/login_instance"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress"
android:hint="@string/instance"
/>
<EditText
android:id="@+id/login_uid"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="@string/email"
/>
<EditText
android:id = "@+id/login_passwd"
android:inputType="textPassword"
android:hint="@string/password"
android:layout_width="300dp"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/login_button"
android:textAllCaps="false"
android:drawableLeft="@drawable/mastodon_icon"
android:drawableStart="@drawable/mastodon_icon"
android:gravity="center"
android:layout_marginTop="20dp"
android:drawablePadding="10dp"
android:paddingLeft="15dp"
android:paddingStart="15dp"
android:paddingRight="20dp"
android:paddingEnd="20dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/login" />
<TextView
android:id="@+id/login_two_step"
android:textAllCaps="false"
android:gravity="center"
android:layout_marginTop="20dp"
android:drawablePadding="10dp"
android:padding="20dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:text="@string/two_factor_authentification" />
<TextView
android:id="@+id/other_instance"
android:textAllCaps="false"
android:gravity="center"
android:drawablePadding="10dp"
android:padding="20dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:text="@string/other_instance" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
>
<LinearLayout
android:layout_marginTop="5dp"
android:layout_width="400dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal"
android:layout_height="wrap_content"
>
<ImageView
android:padding="10dp"
android:id="@+id/account_pp"
android:layout_width="80dp"
android:layout_height="80dp"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/account_dn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/account_un"
android:maxLines="1"
android:layout_width="wrap_content"
android:textSize="14sp"
android:layout_height="wrap_content"
/>
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/account_followed_by"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/colorPrimary"
android:text="@string/followed_by"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:id="@+id/account_ac"
android:gravity="center"
android:maxLines="1"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:layout_marginTop="10dp"
android:id="@+id/account_follow"
android:textAllCaps="false"
android:gravity="center"
android:layout_gravity="end"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginBottom="10dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/action_follow" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/account_note"
android:padding="5dp"
android:gravity="center"
android:layout_width="match_parent"
android:maxLines="3"
android:autoLink="web"
android:layout_height="wrap_content" />
<android.support.design.widget.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:background="@android:color/white"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:id="@+id/account_tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabMode="fixed"
app:tabGravity="fill"
/>
<android.support.v4.view.ViewPager
android:id="@+id/account_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
/>
</android.support.design.widget.AppBarLayout>
</LinearLayout>

View File

@ -17,10 +17,9 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:maxWidth="500dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Listview status -->

View File

@ -22,6 +22,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
@ -30,7 +32,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:layout_marginTop="10dp"
android:orientation="vertical"
tools:ignore="UselessParent">
@ -56,7 +57,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:layout_marginTop="10dp"
android:orientation="vertical"
tools:ignore="UselessParent">
@ -82,7 +82,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
@ -107,7 +106,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">

View File

@ -19,8 +19,8 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
>

View File

@ -4,6 +4,8 @@
android:id="@+id/main_app_container"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View File

@ -17,8 +17,8 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -17,10 +17,9 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:maxWidth="500dp"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Listview status -->

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="drawer_padding">100dp</dimen>
<dimen name="drawer_padding">5dp</dimen>
<dimen name="toot_padding">200dp</dimen>
<dimen name="fab_margin">100dp</dimen>
<dimen name="activity_vertical_margin">20dp</dimen>
</resources>