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

Commit 47af0f49 authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Change to AdaptiveIconDrawable.getExtraInsetFraction()

b/37079814
Test: manual, builds

Change-Id: Iba2c388d9aaac5cb4b451e9b60e6dd76785c6862
parent e7d62c09
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -406,9 +406,9 @@ public class DynamicShortcuts {

        // If on O or higher, add padding around the bitmap.
        final int paddingW = (int) (bitmap.getWidth() *
                AdaptiveIconDrawable.getExtraInsetPercentage());
                AdaptiveIconDrawable.getExtraInsetFraction());
        final int paddingH = (int) (bitmap.getHeight() *
                AdaptiveIconDrawable.getExtraInsetPercentage());
                AdaptiveIconDrawable.getExtraInsetFraction());

        final Bitmap scaledBitmap = Bitmap.createBitmap(bitmap.getWidth() + paddingW,
                bitmap.getHeight() + paddingH, bitmap.getConfig());
@@ -426,7 +426,7 @@ public class DynamicShortcuts {
        if (BuildCompat.isAtLeastO()) {
            // Add padding on >= O
            padding = (int) (RECOMMENDED_ICON_PIXEL_LENGTH *
                    AdaptiveIconDrawable.getExtraInsetPercentage());
                    AdaptiveIconDrawable.getExtraInsetFraction());
            width = RECOMMENDED_ICON_PIXEL_LENGTH + padding;
            height = RECOMMENDED_ICON_PIXEL_LENGTH + padding;
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ public class ShortcutIntentBuilder {

        // On >= O scale image up by AdaptiveIconDrawable.DEFAULT_VIEW_PORT_SCALE.
        final int scale = (int) (icon.getHeight() *
                (1f / (1 + 2 * AdaptiveIconDrawable.getExtraInsetPercentage())));
                (1f / (1 + 2 * AdaptiveIconDrawable.getExtraInsetFraction())));
        final Bitmap scaledBitmap = Bitmap.createBitmap(icon.getWidth() + scale,
                icon.getHeight() + scale, icon.getConfig());
        Canvas scaledCanvas = new Canvas(scaledBitmap);