Android Example [B4X] AS BottomActionSheet - Small Icon


In this example I will show you how you can add a small icon to an item and customize it to your needs.

A small icon is an icon that can be placed before or after the text, e.g. it symbolizes that this item is only available in the premium version.

(75) mage.png


Add Item with a small icon
You can use the new AddItem2 function to add an item with a small icon.
B4X:
BottomActionSheet.AddItem2("Item #4",Null,BottomActionSheet.FontToBitmap(Chr(0xE897),True,25dip,xui.Color_White),4)

Customize
You can specify the position, size and a gap of the small icon.
You can only customize it before the item is added.
B4X:
    BottomActionSheet.ItemSmallIconProperties.HorizontalAlignment = BottomActionSheet.HorizontalAlignment_AfterText
    BottomActionSheet.ItemSmallIconProperties.VerticalAlignment = BottomActionSheet.VerticalAlignment_Top
    BottomActionSheet.ItemSmallIconProperties.LeftGap = 5dip
    BottomActionSheet.ItemSmallIconProperties.WidthHeight = 15dip
 
Top