Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/178216

Change subject: Fix "read more" margins when in landscape mode.
......................................................................

Fix "read more" margins when in landscape mode.

When the screen height is less than the bottom content height, the margins
were being set incorrectly.

Change-Id: I90f45a84009055bf8d4b14d1402d63b447013e5a
---
M wikipedia/res/layout/fragment_page.xml
M 
wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/16/178216/1

diff --git a/wikipedia/res/layout/fragment_page.xml 
b/wikipedia/res/layout/fragment_page.xml
index 3889c74..e12215e 100644
--- a/wikipedia/res/layout/fragment_page.xml
+++ b/wikipedia/res/layout/fragment_page.xml
@@ -116,14 +116,14 @@
 
                     <TextView
                         android:id="@+id/page_last_updated_text"
-                        android:layout_width="match_parent"
+                        android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_gravity="center_horizontal"
                         android:paddingTop="16dp"
                         android:paddingLeft="@dimen/activity_horizontal_margin"
                         
android:paddingRight="@dimen/activity_horizontal_margin"
                         style="?android:textAppearanceSmall"
-                        android:textColorLink="?attr/link_color"
-                        android:gravity="center"/>
+                        android:textColorLink="?attr/link_color"/>
                     <TextView
                         android:id="@+id/page_license_text"
                         android:layout_width="match_parent"
diff --git 
a/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
 
b/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
index 9fb77f7..a7665a0 100644
--- 
a/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
+++ 
b/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
@@ -154,11 +154,13 @@
         if (bottomOffset > bottomHeight) {
             if (params.bottomMargin != -bottomHeight) {
                 params.bottomMargin = -bottomHeight;
+                params.topMargin = 0;
                 bottomContentContainer.setLayoutParams(params);
                 bottomContentContainer.setVisibility(View.INVISIBLE);
             }
         } else {
             params.bottomMargin = -bottomOffset;
+            params.topMargin = -bottomHeight;
             bottomContentContainer.setLayoutParams(params);
             if (bottomContentContainer.getVisibility() != View.VISIBLE) {
                 bottomContentContainer.setVisibility(View.VISIBLE);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90f45a84009055bf8d4b14d1402d63b447013e5a
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>

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

Reply via email to