Bug 1393274: Align webpage item row text to right in RTL, left in LTR. r=liuche draft
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 30 Aug 2017 13:24:46 -0700
changeset 656874 5657b1f2032d543c0c39b562ebc2130dbadf8b4a
parent 656873 9a2b980a8f00ddb2cb28a24ab85d684df04b05b7
child 656875 b011a5ce0247abe3f88ce73bfcf113afc1df52af
push id77357
push usermichael.l.comella@gmail.com
push dateThu, 31 Aug 2017 20:08:00 +0000
reviewersliuche
bugs1393274
milestone57.0a1
Bug 1393274: Align webpage item row text to right in RTL, left in LTR. r=liuche MozReview-Commit-ID: 6VSF73V6Mda
mobile/android/app/src/main/res/layout/activity_stream_webpage_item_row.xml
--- a/mobile/android/app/src/main/res/layout/activity_stream_webpage_item_row.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_webpage_item_row.xml
@@ -37,44 +37,50 @@
         android:layout_alignParentEnd="true"
         android:layout_alignParentRight="true"
         android:layout_alignParentTop="true"
         android:layout_gravity="right|end|top"
         android:contentDescription="@string/menu"
         android:paddingBottom="16dp"
         android:paddingTop="16dp" />
 
+    <!-- In RTL locales, we don't want a large horizontal gap between the domain, page title and source
+         text so we set textAlignment=viewStart for all of them so that it's to the left in LTR and
+         right in RTL. -->
     <TextView
         android:id="@+id/page_domain"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_toEndOf="@id/icon_wrapper"
         android:layout_toLeftOf="@id/menu"
         android:layout_toRightOf="@id/icon_wrapper"
         android:layout_toStartOf="@id/menu"
         android:paddingLeft="@dimen/activity_stream_base_margin"
         android:paddingStart="@dimen/activity_stream_base_margin"
         android:paddingTop="@dimen/activity_stream_base_margin"
+        android:textAlignment="viewStart"
         android:textColor="@color/activity_stream_subtitle"
         android:textSize="12sp"
         tools:text="twitter" />
 
+    <!-- See id/page_domain for textAlignment comment. -->
     <TextView
         android:id="@+id/page_title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@id/page_domain"
         android:layout_toEndOf="@id/icon_wrapper"
         android:layout_toLeftOf="@id/menu"
         android:layout_toRightOf="@id/icon_wrapper"
         android:layout_toStartOf="@id/menu"
         android:ellipsize="end"
         android:maxLines="3"
         android:paddingLeft="@dimen/activity_stream_base_margin"
         android:paddingStart="@dimen/activity_stream_base_margin"
+        android:textAlignment="viewStart"
         android:textColor="#ff000000"
         android:textSize="14sp"
         android:textStyle="bold"
         tools:text="Descriptive title of a page that is veeeeeeery long - maybe even too long?" />
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -93,20 +99,22 @@
         tools:ignore="UseCompoundDrawables">
 
         <ImageView
             android:id="@+id/page_source_icon"
             android:layout_width="12dp"
             android:layout_height="12dp"
             tools:src="@drawable/ic_as_bookmarked" />
 
+        <!-- See id/page_domain for textAlignment comment. -->
         <TextView
             android:id="@+id/page_source"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_marginLeft="2dp"
             android:layout_weight="1"
+            android:textAlignment="viewStart"
             android:textColor="@color/activity_stream_subtitle"
             android:textSize="12sp"
             tools:text="Bookmarked" />
 
     </LinearLayout>
 </RelativeLayout>