Browse Source

Pre-added a menu to manage accounts

Signed-off-by: Kilian Périsset <kilian.perisset@infomaniak.com>
Kilian Périsset 5 years ago
parent
commit
886c0c6394

+ 47 - 31
src/main/res/layout/account_item.xml

@@ -55,40 +55,56 @@
             android:contentDescription="@string/active_user"/>
     </FrameLayout>
 
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_centerInParent="true"
-        android:layout_toEndOf="@id/avatar_container"
-        android:orientation="vertical"
-        android:paddingEnd="@dimen/zero"
-        android:paddingStart="3dp">
 
-        <TextView
-            android:id="@+id/user_name"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginEnd="@dimen/standard_half_margin"
-            android:layout_marginStart="@dimen/standard_margin"
-            android:layout_marginTop="@dimen/standard_quarter_margin"
-            android:ellipsize="end"
-            android:gravity="bottom"
-            android:maxLines="1"
-            android:text="@string/placeholder_filename"
-            android:textAppearance="?android:attr/textAppearanceListItem"/>
+            android:layout_centerInParent="true"
+            android:layout_toEndOf="@id/avatar_container"
+            android:orientation="vertical"
+            android:paddingEnd="@dimen/zero"
+            android:layout_marginEnd="25dp"
+            android:paddingStart="3dp">
 
-        <TextView
-            android:id="@+id/account"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginBottom="@dimen/standard_quarter_margin"
-            android:layout_marginEnd="@dimen/standard_half_margin"
-            android:layout_marginStart="@dimen/standard_margin"
-            android:ellipsize="end"
-            android:gravity="top"
-            android:maxLines="2"
-            android:text="@string/placeholder_sentence"
-            android:textColor="?android:attr/textColorSecondary"/>
-    </LinearLayout>
+            <TextView
+                android:id="@+id/user_name"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="@dimen/standard_half_margin"
+                android:layout_marginStart="@dimen/standard_margin"
+                android:layout_marginTop="@dimen/standard_quarter_margin"
+                android:ellipsize="end"
+                android:gravity="bottom"
+                android:maxLines="1"
+                android:text="@string/placeholder_filename"
+                android:textAppearance="?android:attr/textAppearanceListItem"/>
+
+            <TextView
+                android:id="@+id/account"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="@dimen/standard_quarter_margin"
+                android:layout_marginEnd="@dimen/standard_half_margin"
+                android:layout_marginStart="@dimen/standard_margin"
+                android:ellipsize="end"
+                android:gravity="top"
+                android:maxLines="2"
+                android:text="@string/placeholder_sentence"
+                android:textColor="?android:attr/textColorSecondary"/>
+
+        </LinearLayout>
+
+        <ImageView
+            android:id="@+id/overflow_menu"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_centerVertical="true"
+            android:layout_alignParentEnd="true"
+            android:clickable="true"
+            android:contentDescription="@string/overflow_menu"
+            android:focusable="true"
+            android:paddingEnd="@dimen/alternate_padding"
+            android:paddingStart="@dimen/standard_half_padding"
+            android:src="@drawable/ic_dots_vertical"/>
 
 </RelativeLayout>

+ 38 - 0
src/main/res/menu/item_account.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Nextcloud Android client application
+
+ @author  Infomaniak Network SA (Kilian P.)
+ Copyright (C) 2020 Infomaniak
+ 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/>.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+      xmlns:app="http://schemas.android.com/apk/res-auto"
+      xmlns:tools="http://schemas.android.com/tools"
+      tools:ignore="AppCompatResource">
+
+    <item
+        android:id="@+id/action_open_account"
+        android:title="@string/common_choose_account"
+        app:showAsAction="never"
+        android:showAsAction="never" />
+
+    <item
+        android:id="@+id/delete_account"
+        android:title="@string/common_remove"
+        app:showAsAction="never"
+        android:showAsAction="never" />
+</menu>

+ 1 - 0
src/main/res/values-fr/strings.xml

@@ -107,6 +107,7 @@
     <string name="common_loading">Chargement…</string>
     <string name="common_no">Non</string>
     <string name="common_ok">OK</string>
+    <string name="common_open">Ouvrir</string>
     <string name="common_pending">En attente</string>
     <string name="common_remove">Supprimer</string>
     <string name="common_rename">Renommer</string>

+ 1 - 0
src/main/res/values/strings.xml

@@ -136,6 +136,7 @@
     <string name="common_loading">Loading…</string>
     <string name="common_unknown">unknown</string>
     <string name="common_error_unknown">Unknown error</string>
+    <string name="common_open">Open</string>
     <string name="common_pending">Pending</string>
     <string name="common_delete">Delete</string>
     <string name="common_send">Send</string>