Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Consider densityDpi to scale the icon size

parent 7538580f
Loading
Loading
Loading
Loading
+12 −2
Original line number Original line Diff line number Diff line
@@ -28,6 +28,8 @@ public class DeviceProfile {


    public static Path path;
    public static Path path;
    private final float widthCm;
    private final float widthCm;
    private final float ratio;
    private int statusBarHeight;
    public int cellHeightWithoutPaddingPx;
    public int cellHeightWithoutPaddingPx;
    public int hotseatCellHeightWithoutPaddingPx;
    public int hotseatCellHeightWithoutPaddingPx;
    public int fillResIconDpi;
    public int fillResIconDpi;
@@ -157,9 +159,9 @@ public class DeviceProfile {


        widthPx = realSize.x;
        widthPx = realSize.x;
        double x = widthPx / dm.xdpi;
        double x = widthPx / dm.xdpi;
        ratio = dm.densityDpi / dm.xdpi;
        widthCm = (float) (x * 2.540001f);
        widthCm = (float) (x * 2.540001f);
        Log.i(TAG, "DeviceProfile: " + availableWidthPx);

        Log.i(TAG, "DeviceProfile: " + widthPx);
        heightPx = realSize.y;
        heightPx = realSize.y;


        context = getContext(context, Configuration.ORIENTATION_PORTRAIT);
        context = getContext(context, Configuration.ORIENTATION_PORTRAIT);
@@ -226,7 +228,15 @@ public class DeviceProfile {
            iconSizePx = 213;
            iconSizePx = 213;
        }*/
        }*/


        float a = 1.578f;
        float b = 1.23f;

        Log.i(TAG, "updateIconSize: " + (int) a + " " + (int) b);

        iconSizePx = (int) (widthPx / widthCm);
        iconSizePx = (int) (widthPx / widthCm);
        if (ratio >= 1) {
            iconSizePx = iconSizePx * (int) ratio;
        }


        iconTextSizePx = (int) (Utilities.pxFromSp(12, dm) * scale);
        iconTextSizePx = (int) (Utilities.pxFromSp(12, dm) * scale);
        iconDrawablePaddingPx = (availableWidthPx - iconSizePx * 4) / 5;
        iconDrawablePaddingPx = (availableWidthPx - iconSizePx * 4) / 5;
+2 −0
Original line number Original line Diff line number Diff line
package foundation.e.blisslauncher.core.dragndrop
+2 −0
Original line number Original line Diff line number Diff line
package foundation.e.blisslauncher.core.dragndrop