I use AddMenuItem3 with png files and a image size of 64 pixels. Thats look really good on my devices, but on a "HTC One S" the icons are to big (see attachments) Only when I use a image size of 32 pixels agrees the size, but they are blurred. Has anyone a idea?
But, i have an idea! I will test the bitmap load with LoadBitmapSample
B4X:
Dim width As Int
Dim pscale As Float
pscale = GetDeviceLayoutValues.Scale
width = 32 * pscale
Activity.AddMenuItem3("MenuItem", "mi", LoadBitmapSample(File.DirAssets, "ic_action_edit_64.png", width, width), True)
The left menu button is 64px with
Activity.AddMenuItem3("MenuItem", "mi", LoadBitmapSample(File.DirAssets, "ic_action_edit_64.png", width, width), True)
You can use the standard Android resources folders to load the icon file.
Create the folders, make sure that the file is read-only and load the drawable with XmlLayoutBuilder.GetDrawable. It will return a BitmapDrawable. You can get the bitmap from it and add it to the menu. http://www.b4x.com/android/forum/threads/xmllayoutbuilder-load-xml-layouts.33762/#content