B4A Library Droppy - Dropdown Menu

this is a wrap for this Github project.

Droppy
Version:
1
  • DroppyMenuItemView
    Methods:
    • Initialize (EventName As String, anchor As View)
    • IsInitialized As Boolean
    • getChildAt (index As Int) As View
    Properties:
    • ChildCount As Int [read only]
  • DroppyMenuPopup
    Events:
    • onClicked (view As Object, index As Int)
    • onDismissed ( As )
    Methods:
    • 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
    Properties:
    • 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

  • DroppyEx.zip
    8.1 KB · Views: 1,189
  • Resource.zip
    2.5 KB · Views: 1,120
  • DroppyV1.01.zip
    51.6 KB · Views: 1,178
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Is it answer to my question?
As it is not related to this thread: You should create a new Thread for your Issue/Question.
 

Erind Jushaj

Member
Licensed User
Any idea what this error might be and how I can solve it?

AndroidManifest.xml:15: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.AppCompat').
 

Amritha

Member
Hi

I am new to B4A, and i thought of running the above project. I just went through some of the tutorials but didnt find ways on how to add the external libraries, as I am still getting the error as attached. Could you please help me to fix this?
 

Attachments

  • Dropdown.PNG
    Dropdown.PNG
    53.9 KB · Views: 243

Erel

B4X founder
Staff member
Licensed User
Longtime User
See the instructions in the first post:
- 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

The additional libs folder should be configured under Tools - Configure Paths.
 

Amritha

Member
Thanks Erel for your quick reply.

Unfortunately I am still unable to fix the issue. I had already done as you mentioned previously. Is there anything which i have missed out. I have also tried cleaning project but no luck.
 

Attachments

  • folder.PNG
    folder.PNG
    9.1 KB · Views: 229
  • ExternalLib.PNG
    ExternalLib.PNG
    48.2 KB · Views: 209
  • Dropdown1.PNG
    Dropdown1.PNG
    60.3 KB · Views: 221

Amritha

Member
Hard to tell with the informations you provided.

Can you provide an AnyDescID so i could connect to your pc and help you setting up B4A correctly. I fear something is missing or not configured correctly.


That will be great if you find some time and fix this issue for me. I have followed the same steps as mentioned in B4A installation guide. How would you want me to share my screen and the time you will be available.

I would also like to add a point that I am able to run simple Android projects. But when a project needs to use additional libraries these error occurs.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
That will be great if you find some time and fix this issue for me. I have followed the same steps as mentioned in B4A installation guide. How would you want me to share my screen and the time you will be available.
Download Anydesc
Run the App (no need to install), Give me the ID the app shows.
Note that i am german and have a Timezone of GMT+1
 

Amritha

Member
Download Anydesc
Run the App (no need to install), Give me the ID the app shows.
Note that i am german and have a Timezone of GMT+1


I know you are trying to help me. But I would want to share my ID of anytime till your time 9 pm GMT. My Id is 560 706 674
 

Amritha

Member
For the protocol.

I reinstalled everything new on his PC (starting with B4A 9.9, the SDK, AdditionalLibs folder, and configured properly. It is now working.


Thank you. That was quick and error free. I missed adding the libraries properly.

Have a question when I run this DroppyEx project on my phone. I get a message telling "Do you want to install an update to this existing application? " And when I click on Install. I get error App not installed. Is it an issue with phone?
 
Top