Bug 1393274: Align webpage item row text to right in RTL, left in LTR. r=liuche
MozReview-Commit-ID: 6VSF73V6Mda
--- 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>