this is a wrap for this Github project.
Droppy
Version: 1
Setup:
- Download the library zip and extract the three files to your additional libs folder. Droppy.xml/jar/aar
- Download Resource.zip for the Resources in the Example-Project. Here are the Images for the Dropmenu
Example Code (simplyfied; see Exampleproject for a full Example)
Droppy
Version: 1
- DroppyMenuItemView
Methods:- Initialize (EventName As String, anchor As View)
- IsInitialized As Boolean
- getChildAt (index As Int) As View
- ChildCount As Int [read only]
- DroppyMenuPopup
Events:- onClicked (view As Object, index As Int)
- onDismissed ( As )
- Initialize (EventName As String, anchor As View)
- IsInitialized As Boolean
- addMenuItem (item As String) As DroppyMenuPopupBuilderWrapper
- addMenuItem2 (item As String, resource As String) As DroppyMenuPopupBuilderWrapper
- addMenuItem3 (view As View) As DroppyMenuPopupBuilderWrapper
- addSeparator As DroppyMenuPopupBuilderWrapper
- addclickcallback As DroppyMenuPopupBuilderWrapper
- addonDismissCallback As DroppyMenuPopupBuilderWrapper
- build
- dismiss (itemSelected As Boolean)
- fromMenu (menu As Int) As DroppyMenuPopupBuilderWrapper
- getMenuItemById (id As Int) As DroppyMenuItemInterface
- hideAnimationCompleted (itemSelected As Boolean)
- setXOffset (xOffset As Int) As DroppyMenuPopupBuilderWrapper
- setYOffset (yOffset As Int) As DroppyMenuPopupBuilderWrapper
- show
- triggerOnAnchorClick (onAnchorClick As Boolean) As DroppyMenuPopupBuilderWrapper
- MenuView As View [read only]
Setup:
- Download the library zip and extract the three files to your additional libs folder. Droppy.xml/jar/aar
- Download Resource.zip for the Resources in the Example-Project. Here are the Images for the Dropmenu
Example Code (simplyfied; see Exampleproject for a full Example)
B4X:
pop.Initialize("Droppy",Button1)
pop.addMenuItem("Test1").addMenuItem2("Test2","ic_add_alert_black_18dp").addMenuItem("Options").addclickcallback.addonDismissCallback.addSeparator.addMenuItem("Options1a").addMenuItem("Options1b").triggerOnAnchorClick(True).build
Sub Droppy_onClicked(view As Object, index As Int)
Log($"Droppy_onClicked(${view}, ${index})"$)
If view Is Button Then
Log("btn")
else if view Is Label Then
Log("lbl")
else if view Is DroppyMenuItemView Then
Dim item As DroppyMenuItemView = view
Log(item.ChildCount)
If item.ChildCount = 1 Then
If item.getChildAt(0) Is Label Then
Dim lbl As Label = item.getChildAt(0)
Log(lbl.Text)
End If
End If
End If
End Sub
Sub Droppy_onDismissed()
Log($"Droppy_onDismissed()"$)
End Sub
Attachments
Last edited: