This view makes it quick and easy to let the user make an action.
You need:
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee.
Examples
AS_BottomActionSheet
Author: Alexander Stolte
Version: 1.03
Changelog
You need:
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee.
Simple Example:
BottomActionSheet.Initialize(Me,"BottomActionSheet",Root)
BottomActionSheet.Theme = BottomActionSheet.Theme_Light 'Dark or Light mode
BottomActionSheet.AddItem("Item #1",BottomActionSheet.FontToBitmap(Chr(0xE190),True,30,xui.Color_Black),0)
BottomActionSheet.AddItem("Item #2",BottomActionSheet.FontToBitmap(Chr(0xE190),True,30,xui.Color_Black),1)
BottomActionSheet.AddItem("Item #3",BottomActionSheet.FontToBitmap(Chr(0xE190),True,30,xui.Color_Black),2)
BottomActionSheet.ShowPicker
Wait For BottomActionSheet_ItemClicked(Item As AS_BottomActionSheet_Item)
BottomActionSheet.HidePicker
Log(Item.Text & " clicked")
Examples
[B4X] AS BottomActionSheet - Small Icon
https://www.b4x.com/android/forum/threads/b4x-xui-as-bottomactionsheet.159328/ 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...
www.b4x.com
AS_BottomActionSheet
Author: Alexander Stolte
Version: 1.03
- AS_BottomActionSheet
- Events:
- ActionButtonClicked
- Close
- CustomDrawItem (Item As AS_BottomActionSheet_Item, ItemViews As AS_BottomActionSheet_ItemViews)
- ItemClicked (Item As AS_BottomActionSheet_Item)
- Fields:
- Tag As Object
- Functions:
- AddItem (Text As String, Icon As B4XBitmap, Value As Object) As AS_BottomActionSheet_Item
- AddItem2 (Text As String, Icon As B4XBitmap, SmallIcon As B4XBitmap, Value As Object) As AS_BottomActionSheet_Item
SmallIcon - An icon that can be displayed before or after the text - Class_Globals As String
- FontToBitmap (text As String, IsMaterialIcons As Boolean, FontSize As Float, color As Int) As B4XBitmap
FontAwesome To Bitmap
Unlike an older "TextToBitmap" sub that you can find in the forum, this code vertically centers the icon. It can also be used in B4J and B4i (only need to change the font line). Sub Activity_Create(FirstTime As Boolean) 'usage example Activity.AddMenuItem3("Android", "Test"...www.b4x.com - getActionButton As B4XView
- getActionButtonVisible As Boolean
- getColor As Int
- getDragIndicatorColor As Int
- getHorizontalAlignment_AfterText As String
- getHorizontalAlignment_BeforeText As String
- getItemProperties As AS_BottomActionSheet_ItemProperties
- getItemSmallIconProperties As AS_BottomActionSheet_ItemSmallIconProperties
VerticalAlignment - Top, Center, Bottom
HorizontalAlignment - BeforeText, AfterText
WidthHeight - Default: 15dip
LeftGap - Default: 0dip - GetItemViews (Value As Object) As AS_BottomActionSheet_ItemViews
Gets the item views for a value - GetItemViews2 (Index As Int) As AS_BottomActionSheet_ItemViews
Gets the item views for a index - getSize As Int
Get the number of items - getTheme_Dark As AS_BottomActionSheet_Theme
- getTheme_Light As AS_BottomActionSheet_Theme
- getVerticalAlignment_Bottom As String
- getVerticalAlignment_Center As String
- getVerticalAlignment_Top As String
- HidePicker As String
- Initialize (Callback As Object, EventName As String, Parent As B4XView) As String
Initializes the object. You can add parameters to this method if needed. - IsInitialized As Boolean
Tests whether the object has been initialized. - setActionButtonVisible (Visible As Boolean) As String
- setColor (Color As Int) As String
- setDragIndicatorColor (Color As Int) As String
- setTextColor (Color As Int) As String
- setTheme (Theme As AS_BottomActionSheet_Theme) As String
- ShowPicker
- Properties:
- ActionButton As B4XView [read only]
- ActionButtonVisible As Boolean
- Color As Int
- DragIndicatorColor As Int
- HorizontalAlignment_AfterText As String [read only]
- HorizontalAlignment_BeforeText As String [read only]
- ItemProperties As AS_BottomActionSheet_ItemProperties [read only]
- ItemSmallIconProperties As AS_BottomActionSheet_ItemSmallIconProperties [read only]
VerticalAlignment - Top, Center, Bottom
HorizontalAlignment - BeforeText, AfterText
WidthHeight - Default: 15dip
LeftGap - Default: 0dip - Size As Int [read only]
Get the number of items - TextColor
- Theme
- Theme_Dark As AS_BottomActionSheet_Theme [read only]
- Theme_Light As AS_BottomActionSheet_Theme [read only]
- VerticalAlignment_Bottom As String [read only]
- VerticalAlignment_Center As String [read only]
- VerticalAlignment_Top As String [read only]
- Events:
- AS_BottomActionSheet_Item
- Fields:
- Icon As B4XBitmap
- IsInitialized As Boolean
Tests whether the object has been initialized. - ItemProperties As AS_BottomActionSheet_ItemProperties
- ItemSmallIconProperties As AS_BottomActionSheet_ItemSmallIconProperties
- SmallIcon As B4XBitmap
- Text As String
- Value As Object
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- AS_BottomActionSheet_ItemProperties
- Fields:
- Height As Float
- IconWidthHeight As Float
- IsInitialized As Boolean
Tests whether the object has been initialized. - LeftGap As Float
- SeperatorColor As Int
- SeperatorVisible As Boolean
- TextColor As Int
- xFont As B4XFont
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- AS_BottomActionSheet_ItemSmallIconProperties
- Fields:
- Color As Int
- HorizontalAlignment As String
- IsInitialized As Boolean
Tests whether the object has been initialized. - LeftGap As Float
- VerticalAlignment As String
- WidthHeight As Float
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- AS_BottomActionSheet_ItemViews
- Fields:
- BackgroundPanel As B4XView
- IconImageView As B4XView
- IsInitialized As Boolean
Tests whether the object has been initialized. - SeperatorPanel As B4XView
- TextLabel As B4XView
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- AS_BottomActionSheet_Theme
- Fields:
- BodyColor As Int
- DragIndicatorColor As Int
- IsInitialized As Boolean
Tests whether the object has been initialized. - TextColor As Int
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- 1.00
- Release
- 1.01
- Improvements
- Add get and set DragIndicatorColor
- 1.02
- Add Event CustomDrawItem
- Add Type AS_BottomActionSheet_ItemViews
- Add GetItemViews - Gets the item views for a value
- Add GetItemViews2 - Gets the item views for a index
- Add Event Close
- Add get Size - Get the number of items
- 1.03
- Add Type AS_BottomActionSheet_ItemSmallIconProperties
- Add SmallIcon to Type AS_BottomActionSheet_Item
- Add ItemSmallIconProperties to Type AS_BottomActionSheet_Item
- Add AddItem2 with the SmallIcon Parameter
- Add set Theme
- Add get Theme_Dark
- Add get Theme_Light
Attachments
Last edited: