Android Question Android app icon too small & inside "transparent border"

Andrew A Gray

Member
Licensed User
I put the icon.png into the special directory ( with several different resolutions ), and the icon was scaled and it worked. However, it ends up with a transparent border and the icon is inside and too small:


IconTransparentBorder.jpg

How can I get rid of the transparent border and make it like the one on the left in the picture?
 
Last edited:

Andrew A Gray

Member
Licensed User
Yeah Erel, I used just one icon.png at a time in the special directory.

I tried:
72x72
512x512
600x600

Each time the system scaled it correctly. I never had more than one icon.png in the special directory
at one time.

Next, I tried your "B4A" icon.png in the special directory and got the same thing:

B4A_Icon.jpg


Notice that the "Messages" icon and the "Weather" icon extend out into the
transparent border.

OK... Upon further research, I found that for new versions of Samsung's Android,
the default setting may be

Settings->Display->IconsWithBackgrounds

"Show Icons with shaded backgrounds to
make them stand out on the Home Screen
and Apps screen."

https://www.cnet.com/how-to/how-to-change-to-rounded-icons-on-the-galaxy-s7-s7-edge/

This is actually OK with me, except it makes my icon really small.
I am assuming that I need transparent corners or something to
fix this, and to have my icon extend out like the "Messages" icon
in the above pic, with "IconsWithBackgrounds" turned ON
(which is the default, I think).

And further research finds this...

AndroidIconShapes.jpg


From what I have been able to determine using Adobe Photoshop, the checkered
gray background means "transparent". So it seems Android MAY expand an
icon with transparent rounded corners out like I want... out into the transparent
border (like the Messages Icon).

So... my question is...

How do you get around this "Icon Backgrounds" stuff?

Thanks in advance.
Andrew


Edit...
Well... I downloaded GIMP which does transparent areas and created a squircle.png
that had rounded transparent corners, and it did not stop Samsung's
Icon Backgrounds:

RLV_Icon.jpg


Samsung just put my squircle-with-transparent-corners inside the Android transparent border.......
(ignoring the transparent corners)

Sigh .....

And... I found this:

You can disable TouchWiz to surround your application icon in a rounded square frame by setting

<application>
......<meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>

</application>

to your AndroidManifest.xml



Does this have anything to do with B4X?
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that it is better to upload images directly to the forum.


You can disable TouchWiz to surround your application icon in a rounded square frame by setting
Add this to the manifest editor:
B4X:
AddApplicationText(
<meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>
)
 
Upvote 0

Andrew A Gray

Member
Licensed User
Yay. It worked. I added the AppApplicationText with the project->manifest_editor. Then recompiled,
and.... Voila!
As you can see, my App Icon is NOT surrounded with the transparent background, but others are!
Thanks Erel!

SamsungIconBackGround.jpg
 
Upvote 0
Top