improved layouting

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2020-10-26 12:59:44 +01:00
parent fcb0147d71
commit f802cb3122
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 292 additions and 103 deletions

View file

@ -1,6 +1,7 @@
<!-- <!--
Nextcloud Android client application Nextcloud Android client application
Copyright (C) 2020 Andy Scherzinger
Copyright (C) 2020 Tobias Kaminsky Copyright (C) 2020 Tobias Kaminsky
Copyright (C) 2020 Nextcloud GmbH Copyright (C) 2020 Nextcloud GmbH
@ -28,7 +29,10 @@
android:id="@+id/onlineStatusView" android:id="@+id/onlineStatusView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_half_margin"
android:text="@string/online_status" android:text="@string/online_status"
android:textColor="@color/text_color"
android:textSize="@dimen/activity_list_item_title_header_text_size"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -38,7 +42,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal" android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/onlineStatusView"> app:layout_constraintTop_toBottomOf="@id/onlineStatusView">
@ -46,95 +50,272 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:orientation="horizontal">
<com.google.android.material.card.MaterialCardView
android:id="@+id/onlineStatus"
android:layout_width="match_parent"
android:layout_height="@dimen/account_item_layout_height"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"
app:cardBackgroundColor="@color/grey_200"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/online_icon"
android:layout_width="@dimen/iconized_single_line_item_icon_size"
android:layout_height="@dimen/iconized_single_line_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="top|start"
android:layout_marginEnd="@dimen/standard_half_margin"
android:contentDescription="@null"
android:src="@drawable/online_status"
app:tint="@color/hwSecurityGreen" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_toEndOf="@id/online_icon"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/onlineStatus" android:id="@+id/online_headline"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/account_action_button_margin" android:ellipsize="end"
android:layout_marginEnd="@dimen/account_action_button_margin" android:gravity="bottom"
android:paddingStart="10dp" android:maxLines="1"
android:paddingEnd="0dp"
android:text="@string/online" android:text="@string/online"
android:textAlignment="textStart" android:textAppearance="?android:attr/textAppearanceListItem" />
android:textAllCaps="false"
android:textColor="@color/fontAppbar"
app:backgroundTint="@color/grey_200"
app:cornerRadius="5dp"
app:icon="@drawable/online_status"
app:iconGravity="start"
app:iconPadding="22dp"
app:iconTint="@color/hwSecurityGreen" />
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/dndStatus" android:id="@+id/online_text"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/account_action_button_margin" android:layout_marginStart="@dimen/standard_half_margin"
android:layout_marginEnd="@dimen/account_action_button_margin" android:layout_marginBottom="@dimen/standard_quarter_margin"
android:paddingStart="10dp" android:ellipsize="end"
android:paddingEnd="0dp" android:gravity="top"
android:text="@string/dnd" android:maxLines="1"
android:textAlignment="textStart" android:textColor="?android:attr/textColorSecondary"
android:textAllCaps="false" android:visibility="gone" />
android:textColor="@color/fontAppbar"
app:backgroundTint="@color/grey_200" </LinearLayout>
app:cornerRadius="5dp"
app:icon="@drawable/ic_user_status_dnd" </RelativeLayout>
app:iconGravity="start"
app:iconPadding="22dp" /> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/awayStatus"
android:layout_width="match_parent"
android:layout_height="@dimen/account_item_layout_height"
android:layout_marginStart="@dimen/standard_half_margin"
android:layout_weight="1"
android:orientation="horizontal"
app:cardBackgroundColor="@color/grey_200"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/away_icon"
android:layout_width="@dimen/iconized_single_line_item_icon_size"
android:layout_height="@dimen/iconized_single_line_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="top|start"
android:layout_marginEnd="@dimen/standard_half_margin"
android:contentDescription="@null"
android:src="@drawable/ic_user_status_away"
app:tint="#f4a331" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_toEndOf="@id/away_icon"
android:orientation="vertical">
<TextView
android:id="@+id/away_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="bottom"
android:maxLines="1"
android:text="@string/away"
android:textAppearance="?android:attr/textAppearanceListItem" />
<TextView
android:id="@+id/away_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/standard_half_margin"
android:layout_marginBottom="@dimen/standard_quarter_margin"
android:ellipsize="end"
android:gravity="top"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:orientation="horizontal">
<com.google.android.material.card.MaterialCardView
android:id="@+id/dndStatus"
android:layout_width="match_parent"
android:layout_height="@dimen/account_item_layout_height"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"
app:cardBackgroundColor="@color/grey_200"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/dnd_icon"
android:layout_width="@dimen/iconized_single_line_item_icon_size"
android:layout_height="@dimen/iconized_single_line_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="top|start"
android:layout_marginEnd="@dimen/standard_half_margin"
android:contentDescription="@null"
android:src="@drawable/ic_user_status_dnd" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toEndOf="@id/dnd_icon"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/awayStatus" android:id="@+id/dnd_headline"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/account_action_button_margin" android:ellipsize="end"
android:layout_marginEnd="@dimen/account_action_button_margin" android:gravity="bottom"
android:paddingStart="10dp" android:maxLines="1"
android:paddingEnd="0dp" android:text="@string/dnd"
android:text="@string/away" android:textAppearance="?android:attr/textAppearanceListItem" />
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/fontAppbar"
app:backgroundTint="@color/grey_200"
app:cornerRadius="5dp"
app:icon="@drawable/ic_user_status_away"
app:iconGravity="start"
app:iconPadding="22dp"
app:iconTint="#f4a331" />
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/invisibleStatus" android:id="@+id/dnd_text"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/account_action_button_margin" android:ellipsize="end"
android:layout_marginEnd="@dimen/account_action_button_margin" android:gravity="top"
android:paddingStart="10dp" android:maxLines="1"
android:paddingEnd="0dp" android:text="..."
android:textColor="?android:attr/textColorSecondary"
tools:text="Mute notifications" />
</LinearLayout>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/invisibleStatus"
android:layout_width="match_parent"
android:layout_height="@dimen/account_item_layout_height"
android:layout_marginStart="@dimen/standard_half_margin"
android:layout_weight="1"
android:orientation="horizontal"
app:cardBackgroundColor="@color/grey_200"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_margin"
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/invisible_icon"
android:layout_width="@dimen/iconized_single_line_item_icon_size"
android:layout_height="@dimen/iconized_single_line_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="top|start"
android:layout_marginEnd="@dimen/standard_half_margin"
android:contentDescription="@null"
android:src="@drawable/ic_user_status_invisible" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_toEndOf="@id/invisible_icon"
android:orientation="vertical">
<TextView
android:id="@+id/invisible_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="bottom"
android:maxLines="1"
android:text="@string/invisible" android:text="@string/invisible"
android:textAlignment="textStart" android:textAppearance="?android:attr/textAppearanceListItem" />
android:textAllCaps="false"
android:textColor="@color/fontAppbar" <TextView
app:backgroundTint="@color/grey_200" android:id="@+id/invisible_text"
app:cornerRadius="5dp" android:layout_width="match_parent"
app:icon="@drawable/ic_user_status_invisible" android:layout_height="wrap_content"
app:iconGravity="start" android:ellipsize="end"
app:iconPadding="22dp" android:gravity="top"
app:iconTint="@color/black" /> android:maxLines="1"
android:text="..."
android:textColor="?android:attr/textColorSecondary"
tools:text="Appear offline" />
</LinearLayout>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -154,9 +335,11 @@
android:id="@+id/statusMessage" android:id="@+id/statusMessage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_half_margin"
android:text="@string/status_message" android:text="@string/status_message"
app:layout_constraintTop_toBottomOf="@+id/statusView" android:textColor="@color/text_color"
tools:layout_editor_absoluteX="175dp" /> android:textSize="@dimen/activity_list_item_title_header_text_size"
app:layout_constraintTop_toBottomOf="@+id/statusView" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -195,13 +378,15 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_margin"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/textView3" android:id="@+id/textView3"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/clear_status_message_after" /> android:text="@string/clear_status_message_after"
android:textColor="@color/text_color" />
<Spinner <Spinner
android:id="@+id/spinner" android:id="@+id/spinner"
@ -213,6 +398,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_margin"
android:orientation="horizontal"> android:orientation="horizontal">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -220,7 +406,7 @@
style="@style/OutlinedButton" style="@style/OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_padding" android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/clear_status_message" android:text="@string/clear_status_message"
app:cornerRadius="@dimen/button_corner_radius" /> app:cornerRadius="@dimen/button_corner_radius" />
@ -229,7 +415,6 @@
android:id="@+id/setStatus" android:id="@+id/setStatus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_padding"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/set_status_message" android:text="@string/set_status_message"
android:theme="@style/Button.Primary" android:theme="@style/Button.Primary"

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?><!-- <?xml version="1.0" encoding="utf-8"?><!--
~
~ Nextcloud Android client application Nextcloud Android client application
~
~ @author Tobias Kaminsky Copyright (C) 2020 Andy Scherzinger
~ Copyright (C) 2020 Tobias Kaminsky Copyright (C) 2020 Tobias Kaminsky
~ Copyright (C) 2020 Nextcloud GmbH Copyright (C) 2020 Nextcloud GmbH
~
~ This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version. (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details. GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
--> -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -29,8 +29,8 @@
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textSize="25sp"
android:gravity="center" android:gravity="center"
android:textSize="25sp"
tools:text="📆" /> tools:text="📆" />
<TextView <TextView
@ -38,21 +38,25 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textStyle="bold" android:textAppearance="?android:attr/textAppearanceListItem"
tools:text="In a meeting" /> tools:text="In a meeting" />
<TextView <TextView
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_margin="@dimen/standard_half_margin" android:layout_margin="@dimen/standard_half_margin"
android:text="@string/divider" /> android:gravity="center_vertical"
android:text="@string/divider"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary" />
<TextView <TextView
android:id="@+id/clearAt" android:id="@+id/clearAt"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
tools:text="an hour" /> tools:text="an hour" />
</LinearLayout> </LinearLayout>