jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/397923 )

Change subject: Fix alignment of the first edit pencil on articles
......................................................................


Fix alignment of the first edit pencil on articles

  - Update layout
  - Add an autoMirrored attribute to the pencil icon

Bug: T160753
Change-Id: I51c3785b440fce8f336ba5b55a51569ab869638b
---
M app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java
M app/src/main/res/drawable/ic_mode_edit_white_24dp.xml
M app/src/main/res/layout/view_page_header.xml
M app/src/main/res/values/dimens.xml
4 files changed, 61 insertions(+), 62 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java 
b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java
index a024c16..8072167 100644
--- a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java
+++ b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java
@@ -24,7 +24,6 @@
 import android.view.Gravity;
 import android.view.MenuItem;
 import android.view.View;
-import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
@@ -60,6 +59,7 @@
     @BindView(R.id.view_page_subtitle_text) AppTextView subtitleText;
     @BindView(R.id.view_page_header_divider) View divider;
     @BindView(R.id.view_page_header_edit_pencil) ImageView editPencil;
+    @BindView(R.id.view_page_subtitle_container) LinearLayout 
subtitleContainer;
 
     @Nullable private Callback callback;
     @VisibleForTesting @NonNull CharSequence title = "";
@@ -167,13 +167,16 @@
         LinearLayout.LayoutParams dividerParams = (LinearLayout.LayoutParams) 
divider.getLayoutParams();
         dividerParams.gravity = isLangRTL(locale) ? Gravity.RIGHT : 
Gravity.LEFT;
         divider.setLayoutParams(dividerParams);
-        FrameLayout.LayoutParams pencilParams = (FrameLayout.LayoutParams) 
editPencil.getLayoutParams();
+        LinearLayout.LayoutParams pencilParams = (LinearLayout.LayoutParams) 
editPencil.getLayoutParams();
         pencilParams.gravity = Gravity.BOTTOM | (isLangRTL(locale) ? 
Gravity.LEFT : Gravity.RIGHT);
+        subtitleContainer.setLayoutDirection(isLangRTL(locale) ? 
LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR);
+
         int subtitlePadding = editPencil.getWidth();
         subtitleText.setPadding(isLangRTL(locale) ? subtitlePadding : 0,
                 subtitleText.getPaddingTop(),
                 isLangRTL(locale) ? 0 : subtitlePadding,
                 subtitleText.getPaddingBottom());
+
         if (TextUtils.isEmpty(subtitle)) {
             subtitleText.setCompoundDrawablesWithIntrinsicBounds(
                     isLangRTL(locale) ? 0 : R.drawable.ic_short_text,
diff --git a/app/src/main/res/drawable/ic_mode_edit_white_24dp.xml 
b/app/src/main/res/drawable/ic_mode_edit_white_24dp.xml
index 7dc0640..b58ac1d 100644
--- a/app/src/main/res/drawable/ic_mode_edit_white_24dp.xml
+++ b/app/src/main/res/drawable/ic_mode_edit_white_24dp.xml
@@ -3,7 +3,8 @@
     android:width="24dp"
     android:height="24dp"
     android:viewportWidth="24"
-    android:viewportHeight="24">
+    android:viewportHeight="24"
+    android:autoMirrored="true">
 
     <path
         android:fillColor="#000000"
diff --git a/app/src/main/res/layout/view_page_header.xml 
b/app/src/main/res/layout/view_page_header.xml
index c712e40..5aaec75 100644
--- a/app/src/main/res/layout/view_page_header.xml
+++ b/app/src/main/res/layout/view_page_header.xml
@@ -1,74 +1,72 @@
-<FrameLayout
+<LinearLayout
     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:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <org.wikipedia.page.leadimages.PageHeaderImageView
+        android:id="@+id/view_page_header_image"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <org.wikipedia.views.AppTextView
+        style="@style/RtlAwareTextView"
+        android:id="@+id/view_page_title_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingTop="12dp"
+        android:layout_marginRight="@dimen/activity_horizontal_margin"
+        android:layout_marginLeft="@dimen/activity_horizontal_margin"
+        android:textSize="@dimen/titleTextSize"
+        android:lineSpacingMultiplier="@dimen/lead_title_leading_scalar"
+        android:maxLines="3"
+        android:ellipsize="end"
+        android:textColor="?attr/primary_text_color"
+        tools:text="Title" />
 
     <LinearLayout
+        android:id="@+id/view_page_subtitle_container"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <org.wikipedia.page.leadimages.PageHeaderImageView
-            android:id="@+id/view_page_header_image"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/activity_horizontal_margin"
+        android:layout_marginRight="@dimen/activity_horizontal_margin">
 
         <org.wikipedia.views.AppTextView
-            style="@style/RtlAwareTextView"
-            android:id="@+id/view_page_title_text"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingTop="12dp"
-            android:layout_marginRight="@dimen/activity_horizontal_margin"
-            android:layout_marginLeft="@dimen/activity_horizontal_margin"
-            android:textSize="@dimen/titleTextSize"
-            android:lineSpacingMultiplier="@dimen/lead_title_leading_scalar"
-            android:maxLines="3"
-            android:ellipsize="end"
-            android:textColor="?attr/primary_text_color"
-            tools:text="Title" />
-
-        <org.wikipedia.views.AppTextView
-            style="@style/RtlAwareTextView"
             android:id="@+id/view_page_subtitle_text"
-            android:layout_width="match_parent"
+            style="@style/RtlAwareTextView"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
-            android:layout_marginRight="@dimen/activity_horizontal_margin"
-            android:layout_marginLeft="@dimen/activity_horizontal_margin"
-            android:paddingTop="4dp"
-            android:paddingEnd="40dp"
-            android:paddingRight="40dp"
-            android:textSize="@dimen/descriptionTextSize"
+            android:layout_weight="1"
+            android:drawablePadding="8dp"
             android:lineSpacingMultiplier="@dimen/lead_subtitle_leading_scalar"
+            android:layout_marginEnd="16dp"
             android:textColor="?attr/secondary_text_color"
             android:textColorLink="?attr/secondary_text_color"
-            android:drawablePadding="8dp"
+            android:textSize="@dimen/descriptionTextSize"
+            android:paddingTop="4dp"
             tools:text="Subtitle" />
 
-        <View
-            android:id="@+id/view_page_header_divider"
-            android:layout_width="53.5dp"
-            android:layout_height="1dp"
-            android:layout_marginTop="20dp"
-            android:layout_marginLeft="@dimen/activity_horizontal_margin"
-            android:layout_marginRight="@dimen/activity_horizontal_margin"
-            android:background="@color/base70"/>
+        <android.support.v7.widget.AppCompatImageView
+            android:id="@+id/view_page_header_edit_pencil"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:contentDescription="@string/article_header_edit_hint"
+            android:scaleType="fitCenter"
+            android:layout_marginEnd="8dp"
+            android:layout_gravity="bottom"
+            app:srcCompat="@drawable/ic_mode_edit_white_24dp"
+            app:tint="?attr/material_theme_secondary_color"
+            app:tintMode="src_in" />
     </LinearLayout>
 
-    <android.support.v7.widget.AppCompatImageView
-        android:id="@+id/view_page_header_edit_pencil"
-        android:layout_width="@dimen/edit_pencil_size"
-        android:layout_height="@dimen/edit_pencil_size"
-        android:layout_marginLeft="@dimen/edit_pencil_horizontal_margin"
-        android:layout_marginRight="@dimen/edit_pencil_horizontal_margin"
-        android:layout_gravity="bottom|end"
-        app:srcCompat="@drawable/ic_mode_edit_white_24dp"
-        app:tint="?attr/material_theme_secondary_color"
-        app:tintMode="src_in"
-        android:scaleType="fitCenter"
-        android:background="?attr/selectableItemBackgroundBorderless"
-        android:contentDescription="@string/article_header_edit_hint" />
-
-</FrameLayout>
\ No newline at end of file
+    <View
+        android:id="@+id/view_page_header_divider"
+        android:layout_width="53.5dp"
+        android:layout_height="1dp"
+        android:layout_marginTop="16dp"
+        android:background="@color/base70"
+        android:layout_marginLeft="@dimen/activity_horizontal_margin"
+        android:layout_marginRight="@dimen/activity_horizontal_margin"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml 
b/app/src/main/res/values/dimens.xml
index e9641fb..8fb01e8 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -5,9 +5,6 @@
 
     <dimen name="toolbar_default_elevation">4dp</dimen>
 
-    <dimen name="edit_pencil_size">24dp</dimen>
-    <dimen name="edit_pencil_horizontal_margin">24dp</dimen>
-
     <dimen name="popup_menu_drop_down_horizontal_offset">8dp</dimen>
     <dimen name="popup_menu_drop_down_vertical_offset">-8dp</dimen>
 

-- 
To view, visit https://gerrit.wikimedia.org/r/397923
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I51c3785b440fce8f336ba5b55a51569ab869638b
Gerrit-PatchSet: 3
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Cooltey <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Sharvaniharan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to