fix: IconCompat

This commit is contained in:
J-Jamet
2025-10-09 18:39:59 +02:00
parent fa63265599
commit 366e8bf1d7

View File

@@ -31,6 +31,7 @@ import android.widget.RemoteViews
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.IconCompat
import com.kunzisoft.keepass.R import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.database.ContextualDatabase import com.kunzisoft.keepass.database.ContextualDatabase
import com.kunzisoft.keepass.model.EntryInfo import com.kunzisoft.keepass.model.EntryInfo
@@ -359,7 +360,7 @@ object EntrySelectionHelper {
try { try {
database.iconDrawableFactory.getBitmapFromIcon(context, database.iconDrawableFactory.getBitmapFromIcon(context,
this.icon, ContextCompat.getColor(context, R.color.green))?.let { bitmap -> this.icon, ContextCompat.getColor(context, R.color.green))?.let { bitmap ->
return Icon.createWithBitmap(bitmap) return IconCompat.createWithBitmap(bitmap).toIcon(context)
} }
} catch (e: Exception) { } catch (e: Exception) {
Log.e(RemoteViews::class.java.name, "Unable to assign icon in remote view", e) Log.e(RemoteViews::class.java.name, "Unable to assign icon in remote view", e)