Bug 1393274: Align webpage item row text to right in RTL, left in LTR. r=liuche
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 30 Aug 2017 13:24:46 -0700
changeset 378035 2a39f7aa9629f1871d5ce205093419f1dcc73fa0
parent 378034 e8bc46732fe116cf263a4e607d8e04ab08b32eb5
child 378036 a1a1f209f8256e0a9742805d9d832e322b7e5b25
push id50163
push usermichael.l.comella@gmail.com
push dateThu, 31 Aug 2017 20:10:45 +0000
treeherderautoland@63b87e31320d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1393274
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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>