Fix style and static analysis issues

- Rename ShortcutUtils.kt to ShortcutUtil.kt to match contained class
- Remove unused const
- Fix formatting with spotless

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2022-11-22 10:14:27 +01:00
parent 8a24ea03a0
commit 280a92be51
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -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)