Эх сурвалжийг харах

UI fine tuning for link items / sharing fragments

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 жил өмнө
parent
commit
3c7fe3a405

+ 39 - 49
src/main/res/layout/file_details_share_public_link_add_new_item.xml

@@ -1,56 +1,48 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-  ~
-  ~ Nextcloud Android client application
-  ~
-  ~ @author Tobias Kaminsky
-  ~ Copyright (C) 2020 Tobias Kaminsky
-  ~ Copyright (C) 2020 Nextcloud GmbH
-  ~
-  ~ 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
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ (at your option) any later version.
-  ~
-  ~ This program 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 Affero General Public License for more details.
-  ~
-  ~ 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/>.
-  -->
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
 
-<LinearLayout android:id="@+id/new_public_share"
+  @author Tobias Kaminsky
+  @author Andy Scherzinger
+  Copyright (C) 2020 Andy Scherzinger
+  Copyright (C) 2020 Tobias Kaminsky
+  Copyright (C) 2020 Nextcloud GmbH
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program 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 AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/new_public_share"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+    android:layout_height="@dimen/standard_list_item_size"
     android:orientation="horizontal"
-    android:padding="@dimen/standard_half_padding"
-    xmlns:android="http://schemas.android.com/apk/res/android"
     android:visibility="gone">
 
     <ImageView
         android:id="@+id/copy_internal_link_icon"
-        android:layout_width="40dp"
-        android:layout_height="40dp"
-        android:layout_gravity="center_horizontal"
-        android:contentDescription="@string/share"
-        android:src="@drawable/shared_via_link"
-        android:paddingTop="@dimen/copy_internal_link_padding"
-        android:paddingRight="@dimen/copy_internal_link_padding"
-        android:paddingEnd="@dimen/copy_internal_link_padding"
-        android:paddingBottom="@dimen/copy_internal_link_padding"
-        android:paddingLeft="@dimen/copy_internal_link_padding"
-        android:paddingStart="@dimen/copy_internal_link_padding"
-        android:layout_marginBottom="@dimen/standard_half_margin"
-        android:layout_marginEnd="@dimen/standard_margin"
-        android:layout_marginLeft="@dimen/standard_margin"
-        android:layout_marginRight="@dimen/standard_margin"
+        android:layout_width="@dimen/share_icon_size"
+        android:layout_height="@dimen/share_icon_size"
+        android:layout_gravity="center_vertical"
         android:layout_marginStart="@dimen/standard_margin"
-        android:layout_marginTop="@dimen/standard_half_margin"
-        android:background="@drawable/round_bgnd" />
+        android:layout_marginEnd="@dimen/standard_margin"
+        android:background="@drawable/round_bgnd"
+        android:contentDescription="@string/share"
+        android:padding="@dimen/standard_half_padding"
+        android:src="@drawable/shared_via_link" />
 
     <TextView
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:layout_weight="1"
@@ -59,12 +51,10 @@
     <ImageView
         android:id="@+id/add_new_public_share_link"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="end|center"
-        android:layout_marginStart="@dimen/standard_half_margin"
-        android:layout_weight="0"
+        android:layout_height="match_parent"
+        android:layout_gravity="center_vertical"
         android:contentDescription="@string/add_new_public_share"
-        android:paddingStart="@dimen/standard_half_padding"
-        android:paddingEnd="@dimen/zero"
+        android:paddingStart="@dimen/standard_padding"
+        android:paddingEnd="@dimen/standard_padding"
         android:src="@drawable/ic_plus" />
 </LinearLayout>

+ 42 - 52
src/main/res/layout/file_details_share_public_link_item.xml

@@ -1,52 +1,44 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-  ~
-  ~ Nextcloud Android client application
-  ~
-  ~ @author Tobias Kaminsky
-  ~ Copyright (C) 2020 Tobias Kaminsky
-  ~ Copyright (C) 2020 Nextcloud GmbH
-  ~
-  ~ 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
-  ~ the Free Software Foundation, either version 3 of the License, or
-  ~ (at your option) any later version.
-  ~
-  ~ This program 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 Affero General Public License for more details.
-  ~
-  ~ 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/>.
-  -->
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
 
-<LinearLayout android:id="@+id/share_by_link_container"
+  @author Tobias Kaminsky
+  @author Andy Scherzinger
+  Copyright (C) 2020 Andy Scherzinger
+  Copyright (C) 2020 Tobias Kaminsky
+  Copyright (C) 2020 Nextcloud GmbH
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program 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 AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/share_by_link_container"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="horizontal"
-    android:padding="@dimen/standard_half_padding"
-    xmlns:android="http://schemas.android.com/apk/res/android">
+    android:layout_height="@dimen/standard_list_item_size"
+    android:orientation="horizontal">
 
     <ImageView
         android:id="@+id/copy_internal_link_icon"
-        android:layout_width="40dp"
-        android:layout_height="40dp"
-        android:layout_gravity="center_horizontal"
-        android:contentDescription="@string/share"
-        android:src="@drawable/shared_via_link"
-        android:paddingTop="@dimen/copy_internal_link_padding"
-        android:paddingRight="@dimen/copy_internal_link_padding"
-        android:paddingEnd="@dimen/copy_internal_link_padding"
-        android:paddingBottom="@dimen/copy_internal_link_padding"
-        android:paddingLeft="@dimen/copy_internal_link_padding"
-        android:paddingStart="@dimen/copy_internal_link_padding"
-        android:layout_marginBottom="@dimen/standard_half_margin"
-        android:layout_marginEnd="@dimen/standard_margin"
-        android:layout_marginLeft="@dimen/standard_margin"
-        android:layout_marginRight="@dimen/standard_margin"
+        android:layout_width="@dimen/share_icon_size"
+        android:layout_height="@dimen/share_icon_size"
+        android:layout_gravity="center_vertical"
         android:layout_marginStart="@dimen/standard_margin"
-        android:layout_marginTop="@dimen/standard_half_margin"
-        android:background="@drawable/round_bgnd" />
+        android:layout_marginEnd="@dimen/standard_margin"
+        android:background="@drawable/round_bgnd"
+        android:contentDescription="@string/share"
+        android:padding="@dimen/standard_half_padding"
+        android:src="@drawable/shared_via_link" />
 
     <TextView
         android:layout_width="wrap_content"
@@ -56,9 +48,9 @@
 
     <ImageView
         android:id="@+id/share_link_copy_icon"
-        android:layout_width="wrap_content"
-        android:layout_height="32dp"
-        android:layout_gravity="start|center"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
         android:layout_weight="1"
         android:contentDescription="@string/copy_link"
         android:paddingStart="@dimen/standard_half_margin"
@@ -71,12 +63,10 @@
     <ImageView
         android:id="@+id/overflow_menu_share_link"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="end|center"
-        android:layout_marginStart="@dimen/standard_half_margin"
-        android:layout_weight="0"
+        android:layout_height="match_parent"
         android:contentDescription="@string/overflow_menu"
-        android:paddingStart="@dimen/standard_half_padding"
-        android:paddingEnd="@dimen/zero"
+        android:paddingStart="@dimen/standard_padding"
+        android:paddingEnd="@dimen/standard_padding"
         android:src="@drawable/ic_dots_vertical" />
+
 </LinearLayout>

+ 21 - 27
src/main/res/layout/file_details_sharing_fragment.xml

@@ -33,12 +33,12 @@
 
         <androidx.appcompat.widget.SearchView
             android:id="@+id/searchView"
+            style="@style/ownCloud.SearchView"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/standard_eighth_margin"
+            android:layout_marginStart="@dimen/standard_quarter_margin"
             android:layout_marginEnd="@dimen/standard_margin"
-            android:hint="@string/share_search"
-            style="@style/ownCloud.SearchView"/>
+            android:hint="@string/share_search" />
 
         <LinearLayout
             android:id="@+id/shared_with_you_container"
@@ -52,8 +52,8 @@
 
             <ImageView
                 android:id="@+id/shared_with_you_avatar"
-                android:layout_width="40dp"
-                android:layout_height="40dp"
+                android:layout_width="@dimen/user_icon_size"
+                android:layout_height="@dimen/user_icon_size"
                 android:contentDescription="@string/avatar"
                 android:src="@drawable/ic_user" />
 
@@ -121,48 +121,42 @@
             android:id="@+id/copy_internal_container"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/standard_margin"
+            android:orientation="horizontal"
             android:paddingStart="@dimen/zero"
+            android:paddingTop="@dimen/standard_half_padding"
             android:paddingEnd="@dimen/standard_padding"
-            android:orientation="horizontal">
+            android:paddingBottom="@dimen/standard_padding">
 
             <ImageView
                 android:id="@+id/copy_internal_link_icon"
-                android:layout_width="40dp"
-                android:layout_height="40dp"
-                android:layout_gravity="center_horizontal"
-                android:contentDescription="@string/share"
-                android:src="@drawable/ic_external"
-                android:paddingTop="@dimen/copy_internal_link_padding"
-                android:paddingRight="@dimen/copy_internal_link_padding"
-                android:paddingEnd="@dimen/copy_internal_link_padding"
-                android:paddingBottom="@dimen/copy_internal_link_padding"
-                android:paddingLeft="@dimen/copy_internal_link_padding"
-                android:paddingStart="@dimen/copy_internal_link_padding"
-                android:layout_marginBottom="@dimen/standard_half_margin"
-                android:layout_marginEnd="@dimen/standard_margin"
-                android:layout_marginLeft="@dimen/standard_margin"
-                android:layout_marginRight="@dimen/standard_margin"
+                android:layout_width="@dimen/share_icon_size"
+                android:layout_height="@dimen/share_icon_size"
+                android:layout_gravity="top"
                 android:layout_marginStart="@dimen/standard_margin"
-                android:layout_marginTop="@dimen/standard_half_margin"
-                android:background="@drawable/round_bgnd" />
+                android:layout_marginEnd="@dimen/standard_margin"
+                android:background="@drawable/round_bgnd"
+                android:contentDescription="@string/share"
+                android:padding="@dimen/standard_half_padding"
+                android:src="@drawable/ic_external" />
 
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/standard_half_margin"
                 android:orientation="vertical">
 
                 <TextView
                     android:id="@+id/shareInternalLink"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:textColor="@color/text_color"
-                    android:text="@string/share_internal_link" />
+                    android:text="@string/share_internal_link"
+                    android:textColor="@color/text_color" />
 
                 <TextView
                     android:id="@+id/shareInternalLinkText"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
+                    android:layout_height="wrap_content"
+                    tools:text="@string/share_internal_link_to_folder_text" />
             </LinearLayout>
 
         </LinearLayout>