RSPopupMenu wraps the native Android PopupMenu (API 11+) and attaches a PopUpMenu to a view.
You can add menu's or submenus and 2 events are called:
RSPopupMenu
Author: XverhelstX
Version: 1
Kind regards,
Tomas
You can add menu's or submenus and 2 events are called:
B4X:
public sub Initialize
dim PopupMenu As RSPopupMenu
'Initialize the PopupMenu
PopupMenu.Initialize("PopupMenu", ivPopup)
PopupMenu.AddMenuItem(0, 0, "View")
PopupMenu.AddMenuItem(1, 1, "Edit")
PopupMenu.AddMenuItem(2, 2, "Details")
PopupMenu.AddMenuItem(3, 3, "Remove")
end sub
Sub ivPopup_Click
PopupMenu.Show
End Sub
Sub PopupMenu_Dismiss
ToastMessageShow("PopupMenu dismissed", False)
End Sub
Sub PopupMenu_MenuItemClick (ItemId As Int) As Boolean
ToastMessageShow("Item " & ItemId & " clicked.", False)
Return False
End Sub
RSPopupMenu
Author: XverhelstX
Version: 1
- RSPopupMenu
Methods:- AddMenuItem (ItemId As Int, Order As Int, Title As String)
Add a new item to the menu. - AddMenuItem2 (GroupId As Int, ItemId As Int, Order As Int, Title As String)
Add a new item to the menu. - AddSubMenuItem (ItemId As Int, Order As Int, Title As String)
Add a new item to the menu. - AddSubMenuItem2 (GroupId As Int, ItemId As Int, Order As Int, Title As String)
Add a new item to the menu. - Dismiss
Dismiss the menu popup. - Initialize (EventName As String, view As ConcreteViewWrapper)
Initializes the Popup Menu.
A PopupMenu displays a Menu in a modal popup window anchored to a View.
The popup will appear below the anchor view if there is room, or above it if there is not.
If the IME is visible the popup will not overlap it until it is touched.
Touching outside of the popup will dismiss it. - Initialize2 (EventName As String, view As ConcreteViewWrapper, Gravity As Int)
Initializes the Popup Menu.
A PopupMenu displays a Menu in a modal popup window anchored to a View.
The popup will appear below the anchor view if there is room, or above it if there is not.
If the IME is visible the popup will not overlap it until it is touched.
Touching outside of the popup will dismiss it. - IsInitialized As Boolean
- Show
Show the menu popup anchored to the view specified during construction.
- AddMenuItem (ItemId As Int, Order As Int, Title As String)
Kind regards,
Tomas