(Running this on a Google Pixel 7a, running Android 14)
I am working on a launcher application, and I need to be able to display launcher icons as square.
However, whenever I draw the icon, it is always rounded, even if the app does not have any rounded icon in its resources.
How can I obtain the full icon, without it being rounded into a circle?
This is my current code:
var pm = context.getPackageManager()
var mainIntent = Intent(Intent.ACTION_MAIN, null)
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER)
var apps = pm.queryIntentActivities(mainIntent, 0)
for (resolveInfo in apps) {
val iconDrawable = resolveInfo.activityInfo.loadIcon(pm)
var img = ImageView(context)
img.setImageDrawable(icon)
appGrid.addView(img) // always displays as a circle
}