From 7216750793101bca2f470b473314c693cc0cf404 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Tue, 27 Oct 2020 11:29:19 +0530 Subject: [PATCH] Use densityDpi instead of xdpi for icon sizes --- .gitignore | 2 ++ .idea/codeStyles/Project.xml | 17 +++++++++++++---- .idea/misc.xml | 2 +- .../e/blisslauncher/core/DeviceProfile.java | 13 +++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 4851e9d46e..20ff14c5a3 100755 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,8 @@ build/ .idea/modules.xml .idea/assetWizardSettings.xml .idea/markdown-navigator* +.idea/compiler.xml +.idea/jarRepositories.xml projectFilesBackup/ gradle.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index c82ee7068f..0b7502afca 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,17 +1,26 @@ - - + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index f5c6d9eb6a..58918f5033 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/app/src/main/java/foundation/e/blisslauncher/core/DeviceProfile.java b/app/src/main/java/foundation/e/blisslauncher/core/DeviceProfile.java index 306a9e480a..efa4d261fc 100755 --- a/app/src/main/java/foundation/e/blisslauncher/core/DeviceProfile.java +++ b/app/src/main/java/foundation/e/blisslauncher/core/DeviceProfile.java @@ -10,7 +10,6 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; import android.util.DisplayMetrics; -import android.util.Log; import android.view.Display; import android.view.WindowManager; @@ -158,8 +157,8 @@ public class DeviceProfile { display.getRealSize(realSize); widthPx = realSize.x; - double x = widthPx / dm.xdpi; - ratio = dm.densityDpi / dm.xdpi; + double x = widthPx / dm.densityDpi; + ratio = (float) dm.densityDpi / dm.xdpi; widthCm = (float) (x * 2.540001f); heightPx = realSize.y; @@ -237,13 +236,7 @@ public class DeviceProfile { float a = 1.578f; float b = 1.23f; - Log.i(TAG, "updateIconSize: " + (int) a + " " + (int) b); - - iconSizePx = (int) (widthPx / widthCm); - if (ratio >= 1) { - iconSizePx = iconSizePx * (int) ratio; - } - + iconSizePx = (int) (0.75 * widthPx / widthCm); iconTextSizePx = (int) (Utilities.pxFromSp(12, dm) * scale); iconDrawablePaddingPx = (availableWidthPx - iconSizePx * 4) / 5; -- GitLab