From 0b80d423f4bc38284d681e88f01dce31824a733f Mon Sep 17 00:00:00 2001 From: brave-builds Date: Fri, 25 Mar 2022 14:44:42 +0000 Subject: [PATCH] Uplift of #12711 (squashed) to release --- .../chrome/browser/ntp_background_images/util/NTPUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPUtil.java b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPUtil.java index 55fb7f268859..1db06599dd41 100644 --- a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPUtil.java +++ b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPUtil.java @@ -109,12 +109,11 @@ public static int correctImageCreditLayoutTopPosition(NTPImage ntpImage) { // Correction defaults to tablet BackgroundImage imageCreditCorrection = isLandscape ? (int) (pxHeight * (isCompensate ? 0.48 : 0.54)) : (int) (pxHeight * (isCompensate ? 0.60 : 0.30)); - if (ntpImage instanceof BackgroundImage) { if (!isTablet) { imageCreditCorrection = isLandscape ? (int) (pxHeight * (isCompensate ? 0.12 : 0.88)) - : (int) (pxHeight * (isCompensate ? 0.53 : 0.59)); + : (int) (pxHeight - dpToPx(activity, 355)); } if (!ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_NEWS)) { imageCreditCorrection = (int) imageCreditCorrection - (int) (pxHeight * 0.04); @@ -123,7 +122,7 @@ public static int correctImageCreditLayoutTopPosition(NTPImage ntpImage) { if (!isTablet) { imageCreditCorrection = isLandscape ? (int) (pxHeight * (isCompensate ? 0.02 : 0.98)) - : (int) (pxHeight * (isCompensate ? 0.36 : 0.50)); + : (int) (pxHeight - dpToPx(activity, 480)); } else { imageCreditCorrection = isLandscape ? (int) (pxHeight * (isCompensate ? 0.28 : 0.72)) @@ -205,6 +204,7 @@ public static void updateOrientedUI( layoutParams.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL; layoutParams.setMargins(0, 0, 0, dpToPx(context, 5)); } + parentLayout.setOrientation(LinearLayout.VERTICAL); imageCreditLayout.setLayoutParams(imageCreditLayoutParams);