Commit 72167507 authored by Amit Kumar's avatar Amit Kumar 💻
Browse files

Use densityDpi instead of xdpi for icon sizes

parent 6c2b9e60
Pipeline #81050 passed with stage
in 6 minutes and 18 seconds
......@@ -44,6 +44,8 @@ build/
.idea/modules.xml
.idea/assetWizardSettings.xml
.idea/markdown-navigator*
.idea/compiler.xml
.idea/jarRepositories.xml
projectFilesBackup/
gradle.xml
......
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment