From 280a92be5101da9ffafcf72559cf609f54547602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey?= Date: Tue, 22 Nov 2022 10:14:27 +0100 Subject: [PATCH] Fix style and static analysis issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename ShortcutUtils.kt to ShortcutUtil.kt to match contained class - Remove unused const - Fix formatting with spotless Signed-off-by: Álvaro Brey --- .../utils/{ShortcutUtils.kt => ShortcutUtil.kt} | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename app/src/main/java/com/nextcloud/utils/{ShortcutUtils.kt => ShortcutUtil.kt} (95%) diff --git a/app/src/main/java/com/nextcloud/utils/ShortcutUtils.kt b/app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt similarity index 95% rename from app/src/main/java/com/nextcloud/utils/ShortcutUtils.kt rename to app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt index ef5314801f..7daeb7078f 100644 --- a/app/src/main/java/com/nextcloud/utils/ShortcutUtils.kt +++ b/app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt @@ -45,8 +45,6 @@ import com.owncloud.android.utils.theme.ViewThemeUtils import javax.inject.Inject import kotlin.math.roundToInt -private const val i = 108 - class ShortcutUtil @Inject constructor(private val mContext: Context) { /** @@ -95,8 +93,10 @@ class ShortcutUtil @Inject constructor(private val mContext: Context) { .build() val pinnedShortcutCallbackIntent = shortcutManager.createShortcutResultIntent(pinShortcutInfo) val successCallback = PendingIntent.getBroadcast( - mContext, 0, - pinnedShortcutCallbackIntent, FLAG_IMMUTABLE + mContext, + 0, + pinnedShortcutCallbackIntent, + FLAG_IMMUTABLE ) shortcutManager.requestPinShortcut( pinShortcutInfo, @@ -116,7 +116,9 @@ class ShortcutUtil @Inject constructor(private val mContext: Context) { val bitmap = Bitmap.createBitmap(adaptiveIconSize, adaptiveIconSize, Bitmap.Config.ARGB_8888) val canvas = Canvas(bitmap) drawable.setBounds( - adaptiveIconOuterSides, adaptiveIconOuterSides, adaptiveIconSize - adaptiveIconOuterSides, + adaptiveIconOuterSides, + adaptiveIconOuterSides, + adaptiveIconSize - adaptiveIconOuterSides, adaptiveIconSize - adaptiveIconOuterSides ) drawable.draw(canvas)