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

Commit 0c5af647 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge branch 'sprint_delhi' into 'master'

[RELEASE] Sprint delhi

Closes #172 and #171

See merge request e/apps/BlissLauncher!20
parents a3cf67b6 e5efc5f0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
// Manifest version information!
def versionMajor = 1
def versionMinor = 3
def versionPatch = 0
def versionPatch = 1

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
            android:resumeWhilePausing="true"
            android:screenOrientation="nosensor"
            android:stateNotNeeded="true"
            android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize"
            android:theme="@style/HomeScreenTheme"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ public class BlissLauncher extends Application {
        return deviceProfile;
    }

    public void resetDeviceProfile() {
        deviceProfile = new DeviceProfile(this);
    }

    public IconsHandler getIconsHandler() {
        if (iconsPackHandler == null) {
            iconsPackHandler = new IconsHandler(this);
+11 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ 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;

@@ -27,6 +28,7 @@ public class DeviceProfile {

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

        widthPx = realSize.x;
        double x = widthPx / dm.xdpi;
        ratio = dm.densityDpi / dm.xdpi;
        widthCm = (float) (x * 2.540001f);
        heightPx = realSize.y;

@@ -231,7 +234,15 @@ public class DeviceProfile {
            iconSizePx = 213;
        }*/

        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;
        }

        iconTextSizePx = (int) (Utilities.pxFromSp(12, dm) * scale);
        iconDrawablePaddingPx = (availableWidthPx - iconSizePx * 4) / 5;
+8 −2
Original line number Diff line number Diff line
@@ -229,6 +229,12 @@ public class Utilities {
        return defaultValue;
    }



    /**
     * Ensures that a value is within given bounds. Specifically:
     * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound,
     * return upperBound; else return value unchanged.
     */
    public static int boundToRange(int value, int lowerBound, int upperBound) {
        return Math.max(lowerBound, Math.min(value, upperBound));
    }
}
Loading