OSDN Git Service

Sharesheet - Add copy text in response to UXR
authorMatt Pietal <mpietal@google.com>
Mon, 15 Apr 2019 15:38:39 +0000 (11:38 -0400)
committerMatt Pietal <mpietal@google.com>
Tue, 16 Apr 2019 12:26:53 +0000 (08:26 -0400)
Add copy text underneath image to make it clear what the button
means. Make text clickable. Align text colors with spec.

Bug: 130350131
Test: Manual inspection
Change-Id: Ia2916fd48ef8b2d1862d9baf5f9f695f54187d55

core/res/res/layout/chooser_grid_preview_text.xml

index 3c9ffdb..f3ca0af 100644 (file)
@@ -24,9 +24,9 @@
     android:layout_height="wrap_content"
     android:orientation="vertical"
     android:paddingBottom="@dimen/chooser_view_spacing"
-    android:background="?attr/colorBackgroundFloating">
+    android:background="?android:attr/colorBackgroundFloating">
 
-  <LinearLayout
+  <RelativeLayout
       android:layout_width="@dimen/chooser_preview_width"
       android:layout_height="wrap_content"
       android:layout_gravity="center"
       android:paddingRight="@dimen/chooser_edge_margin_normal"
       android:layout_marginBottom="@dimen/chooser_view_spacing"
       android:id="@+id/content_preview_text_layout">
+
     <TextView
         android:id="@+id/content_preview_text"
-        android:layout_width="0dp"
-        android:layout_weight="1"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
+        android:layout_alignParentStart="true"
+        android:layout_toStartOf="@id/copy_button"
+        android:layout_centerVertical="true"
         android:ellipsize="end"
-        android:gravity="start|top"
-        android:paddingRight="@dimen/chooser_view_spacing"
+        android:textColor="?android:attr/textColorPrimary"
         android:maxLines="2"/>
-    <ImageButton
+
+    <LinearLayout
         android:id="@+id/copy_button"
-        android:layout_width="48dp"
-        android:layout_height="48dp"
-        android:padding="12dp"
+        android:orientation="vertical"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:layout_alignParentEnd="true"
+        android:layout_marginStart="@dimen/chooser_view_spacing"
         android:gravity="center"
-        android:layout_gravity="center_vertical"
-        android:src="@drawable/ic_content_copy_gm2"
+        android:minWidth="48dp"
+        android:minHeight="48dp"
         android:clickable="true"
-        android:contentDescription="@string/copy"
-        android:background="?attr/selectableItemBackgroundBorderless"/>
-  </LinearLayout>
+        android:background="?android:attr/selectableItemBackgroundBorderless">
+
+      <ImageView
+          android:layout_width="24dp"
+          android:layout_height="24dp"
+          android:gravity="top|center_horizontal"
+          android:src="@drawable/ic_content_copy_gm2" />
+
+      <TextView
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginTop="4dp"
+          android:gravity="center_horizontal"
+          android:text="@string/copy"
+          android:textColor="?android:textColorSecondary"
+          android:textSize="12sp"
+          android:maxWidth="72dp"
+          android:maxLines="2"
+          android:ellipsize="end" />
+    </LinearLayout>
+  </RelativeLayout>
 
   <!-- Required sub-layout so we can get the nice rounded corners-->
   <!-- around this section -->
         android:layout_gravity="center_vertical"
         android:ellipsize="end"
         android:maxLines="2"
-        android:textSize="20sp"/>
+        android:textSize="20sp"
+        android:textColor="?android:attr/textColorPrimary"/>
   </LinearLayout>
 </LinearLayout>