jenkins-bot has submitted this change and it was merged.
Change subject: Tweak page title spacing for Lollipop+
......................................................................
Tweak page title spacing for Lollipop+
Change-Id: I61d153a377f1d89c0a77cff618099dfb73a9ce4f
---
M wikipedia/src/main/java/org/wikipedia/page/leadimages/LeadImagesHandler.java
1 file changed, 14 insertions(+), 5 deletions(-)
Approvals:
BearND: Looks good to me, approved
jenkins-bot: Verified
diff --git
a/wikipedia/src/main/java/org/wikipedia/page/leadimages/LeadImagesHandler.java
b/wikipedia/src/main/java/org/wikipedia/page/leadimages/LeadImagesHandler.java
index 50cbd5f..88310e9 100644
---
a/wikipedia/src/main/java/org/wikipedia/page/leadimages/LeadImagesHandler.java
+++
b/wikipedia/src/main/java/org/wikipedia/page/leadimages/LeadImagesHandler.java
@@ -395,7 +395,11 @@
final float lineSpacing = 0.8f;
final int lineSpacePadding = (int)(12 * displayDensity);
pageTitleText.setLineSpacing(0, lineSpacing);
- titleBottomPadding += lineSpacePadding;
+ // however, if it's Lollipop or greater, then don't boost the
bottom padding of the
+ // title text, since it now correctly does it automatically.
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
+ titleBottomPadding += lineSpacePadding;
+ }
}
pageTitleText.setPadding(pageTitleText.getPaddingLeft(),
pageTitleText.getPaddingTop(),
pageTitleText.getPaddingRight(), titleBottomPadding);
@@ -482,10 +486,15 @@
}
final int animDuration = 500;
// adjust the space between the title and the description...
- // in 2.3, the descenders of the font go a little lower, so
the space needs to be slightly different:
- final int marginSpHC = 20;
- final int marginSpGB = 16;
- int marginSp = Build.VERSION.SDK_INT >=
Build.VERSION_CODES.HONEYCOMB ? marginSpHC : marginSpGB;
+ // for >2.3 and <5.0, the space needs to be a little
different, because it doesn't
+ // correctly adjust the bottom padding of the page title.
+ final int marginSpL = 16;
+ final int marginSpH = 20;
+ int marginSp = marginSpL;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
+ && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
+ marginSp = marginSpH;
+ }
final int newMargin = pageDescriptionText.getHeight()
- (leadImagesEnabled ? (int)(marginSp *
displayDensity) : 0);
final int origPadding = pageTitleText.getPaddingBottom();
--
To view, visit https://gerrit.wikimedia.org/r/175781
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I61d153a377f1d89c0a77cff618099dfb73a9ce4f
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits