Jelajahi Sumber

Merge pull request #6226 from nextcloud/tool-hints

Added some tool hints for easier development
Andy Scherzinger 5 tahun lalu
induk
melakukan
ec5dcefc7d

+ 2 - 2
src/main/res/layout/fragment_etm_menu.xml

@@ -26,7 +26,7 @@
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/etm_menu_list"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
-    </androidx.recyclerview.widget.RecyclerView>
+        android:layout_height="match_parent"
+        tools:listitem="@layout/material_list_item_single_line" />
 
 </FrameLayout>

+ 5 - 3
src/main/res/layout/log_entry_list_item.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<LinearLayout xmlns:tools="http://schemas.android.com/tools"
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
@@ -12,11 +12,13 @@
         android:layout_height="wrap_content"
         android:textStyle="bold"
         android:ellipsize="end"
-        android:lines="1"/>
+        android:lines="1"
+        tools:text="@tools:sample/lorem/random" />
 
     <TextView
         android:id="@+id/log_entry_list_item_message"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
+        android:layout_height="wrap_content"
+        tools:text="@tools:sample/lorem/random" />
 
 </LinearLayout>

+ 3 - 1
src/main/res/layout/multiple_accounts.xml

@@ -22,6 +22,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    xmlns:tools="http://schemas.android.com/tools"
     android:gravity="clip_horizontal"
     android:orientation="vertical"
     android:padding="@dimen/standard_padding">
@@ -29,5 +30,6 @@
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/list"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" />
+        android:layout_height="match_parent"
+        tools:listitem="@layout/account_item" />
 </LinearLayout>

+ 4 - 2
src/main/res/layout/notifications_layout.xml

@@ -19,6 +19,7 @@
   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <androidx.drawerlayout.widget.DrawerLayout 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"
@@ -49,13 +50,14 @@
                     android:id="@android:id/list"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:layout_marginBottom="-3dp"
                     android:layout_marginLeft="-3dp"
                     android:layout_marginRight="-3dp"
+                    android:layout_marginBottom="-3dp"
                     android:clipToPadding="false"
                     android:scrollbarStyle="outsideOverlay"
                     android:scrollbars="vertical"
-                    android:visibility="visible"/>
+                    android:visibility="visible"
+                    tools:listitem="@layout/notification_list_item" />
 
             </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
 

+ 4 - 2
src/main/res/layout/send_button.xml

@@ -34,7 +34,8 @@
         android:layout_width="@dimen/share_icon_size"
         android:layout_height="@dimen/share_icon_size"
         android:layout_gravity="center_horizontal"
-        android:contentDescription="@string/sendbutton_description" />
+        android:contentDescription="@string/sendbutton_description"
+        tools:src="@mipmap/ic_launcher" />
 
     <TextView
         android:id="@+id/send_button_text"
@@ -43,5 +44,6 @@
         android:layout_gravity="center"
         android:gravity="center_horizontal"
         android:paddingTop="@dimen/standard_half_padding"
-        android:textColor="@color/text_color" />
+        android:textColor="@color/text_color"
+        tools:text="@string/app_name" />
 </LinearLayout>

+ 2 - 1
src/main/res/layout/send_share_fragment.xml

@@ -113,6 +113,7 @@
         android:id="@+id/send_button_recycler_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_below="@id/divider"/>
+        android:layout_below="@id/divider"
+        tools:listitem="@layout/send_button" />
     </RelativeLayout>
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 3 - 1
src/main/res/layout/storage_path_dialog.xml

@@ -21,12 +21,14 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    xmlns:tools="http://schemas.android.com/tools"
     android:orientation="vertical"
     android:padding="@dimen/standard_padding">
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/storage_path_recycler_view"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
+        android:layout_height="wrap_content"
+        tools:listitem="@layout/storage_path_item" />
 
 </LinearLayout>

+ 2 - 1
src/main/res/layout/template_button.xml

@@ -44,5 +44,6 @@
         android:ellipsize="middle"
         android:gravity="center_horizontal"
         android:paddingTop="@dimen/standard_half_padding"
-        android:textColor="@color/text_color"/>
+        android:textColor="@color/text_color"
+        tools:text="@tools:sample/lorem" />
 </LinearLayout>

+ 8 - 3
src/main/res/layout/text_file_preview.xml

@@ -18,7 +18,8 @@
 -->
 <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    xmlns:tools="http://schemas.android.com/tools">
 
     <ScrollView
         android:layout_width="match_parent"
@@ -35,7 +36,10 @@
                 android:padding="@dimen/standard_padding"
                 android:textIsSelectable="true"
                 android:textColor="@color/text_color"
-                android:visibility="gone" />
+                android:visibility="gone"
+                tools:visibility="visible"
+                tools:maxLength="40"
+                tools:text="@tools:sample/lorem/random"/>
 
             <RelativeLayout
                 android:id="@+id/multi_view"
@@ -63,6 +67,7 @@
         android:layout_marginEnd="@dimen/standard_margin"
         android:layout_marginBottom="@dimen/standard_margin"
         android:contentDescription="@string/edit_rich_workspace"
-        android:visibility="gone" />
+        android:visibility="gone"
+        tools:visibility="visible" />
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 6 - 3
src/main/res/layout/toolbar_standard.xml

@@ -57,7 +57,8 @@
             android:layout_height="?attr/actionBarSize"
             android:background="@color/appbar"
             android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
-            app:popupTheme="@style/Theme.AppCompat.DayNight.NoActionBar">
+            app:popupTheme="@style/Theme.AppCompat.DayNight.NoActionBar"
+            tools:visibility="gone">
 
             <androidx.appcompat.widget.AppCompatSpinner
                 android:id="@+id/toolbar_spinner"
@@ -82,7 +83,8 @@
         app:background="@color/appbar"
         app:cardCornerRadius="8dp"
         app:cardElevation="2dp"
-        app:strokeWidth="0dp">
+        app:strokeWidth="0dp"
+        tools:visibility="visible">
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
@@ -116,7 +118,8 @@
                 app:layout_constraintBottom_toBottomOf="parent"
                 app:layout_constraintLeft_toRightOf="@id/menu_button"
                 app:layout_constraintRight_toLeftOf="@id/switch_account_button"
-                app:layout_constraintTop_toTopOf="parent" />
+                app:layout_constraintTop_toTopOf="parent"
+                tools:text="Search in Nextcloud"/>
 
             <com.google.android.material.button.MaterialButton
                 android:id="@+id/switch_account_button"

+ 1 - 0
src/main/res/layout/trashbin_activity.xml

@@ -21,6 +21,7 @@
 -->
 <androidx.drawerlayout.widget.DrawerLayout 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"
     android:id="@+id/drawer_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"

+ 4 - 1
src/main/res/layout/user_info_layout.xml

@@ -100,7 +100,10 @@
         android:layout_margin="@dimen/standard_margin"
         android:orientation="vertical"
         android:visibility="gone"
-        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+        tools:visibility="visible"
+        tools:listitem="@layout/user_info_details_table_item"
+        tools:itemCount="3" />
 
     <include layout="@layout/empty_list" />
 

+ 1 - 1
src/main/res/layout/whats_new_activity.xml

@@ -41,7 +41,7 @@
         android:id="@+id/contentPanel"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="82"></androidx.viewpager.widget.ViewPager>
+        android:layout_weight="82" />
 
     <LinearLayout
         android:layout_width="match_parent"

+ 2 - 3
src/main/res/layout/whats_new_webview_element.xml

@@ -7,7 +7,6 @@
     <WebView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:id="@+id/whatsNewWebView">
-    </WebView>
+        android:id="@+id/whatsNewWebView" />
 
-</LinearLayout>
+</LinearLayout>