From 83b042c897b9e7eb63be65a27ca11a2a7b82d00f Mon Sep 17 00:00:00 2001 From: Tobias Dubois Date: Mon, 11 Jun 2018 16:54:51 +0200 Subject: [PATCH 1/2] Use View.getHeight() instead of Canvas.getHeight() for PageIndicatorDots Use View.getHeight() instead of Canvas.getHeight() to get the same height regardless of using hardware or software accelerated drawing. Test: manual Change-Id: I475afef017102d7968f28a7aab8116238af3d90d --- src/com/android/launcher3/pageindicators/PageIndicatorDots.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java index 709975f02c..f7c730a6c5 100644 --- a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java +++ b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java @@ -244,7 +244,7 @@ public class PageIndicatorDots extends View implements PageIndicator { float startX = (getWidth() - mNumPages * circleGap + mDotRadius) / 2; float x = startX + mDotRadius; - float y = canvas.getHeight() / 2; + float y = getHeight() / 2; if (mEntryAnimationRadiusFactors != null) { // During entry animation, only draw the circles From d38f791b68a9cdbd66ea9d534f39f1f6ab8184b8 Mon Sep 17 00:00:00 2001 From: Tobias Dubois Date: Mon, 11 Jun 2018 16:17:17 +0200 Subject: [PATCH 2/2] Lint fix: IS_DEBUG_DEVICE: Implied default locale Use the ROOT locale to make sure toLowerCase has consistent behavior regardless of the currently set language. Test: Manual Change-Id: Ie43f76cbc15eee0d96314e92d2acd5abb22f7077 --- src/com/android/launcher3/Utilities.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 4bd9a9bf25..b2f8146397 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -109,8 +109,9 @@ public final class Utilities { * Indicates if the device has a debug build. Should only be used to store additional info or * add extra logging and not for changing the app behavior. */ - public static final boolean IS_DEBUG_DEVICE = Build.TYPE.toLowerCase().contains("debug") - || Build.TYPE.toLowerCase().equals("eng"); + public static final boolean IS_DEBUG_DEVICE = + Build.TYPE.toLowerCase(Locale.ROOT).contains("debug") || + Build.TYPE.toLowerCase(Locale.ROOT).equals("eng"); // An intent extra to indicate the horizontal scroll of the wallpaper. public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET";