Popup menu anchored to a button. It can include text options, icons from the application's "Assets", HTML text, change the menu radius, background color and the separator line between items.
Function
ShowPopupMenu
anchorComponent : Button where the menu will be anchored.
options : List of text options to display in the menu.
icons : List of icons from Assets. If the list of icons is smaller than the list of options, the first icon is reused.
backgroundColor : Background color of the menu, which accepts both hexadecimal and int formats.
cornerRadius : Radius of the corners of the menu.
textSize : Text size.
textColor : Text color, which also accepts hexadecimal or int formats.
useHtml : Boolean indicating whether text options should be interpreted as HTML or not.
separatorColor : Color of the separators between the options.
showAboveAnchor : Boolean to determine whether the menu should appear above or below the anchored component.
Event
PopupMenuItemSelected
item : Texto de la opción seleccionada.
index : Indice de la opción seleccionada.
iconPath : Ruta del icono asociado con la opción seleccionada, si hay uno disponible.
Extension:
joejsanz.joedevpopupmenu.aix (12.4 KB)
Thanks.
13 Likes
TIMAI2
October 24, 2024, 9:38am
2
Good work, looks like a prettified version of Ulli's PopupMenu extension.
Does the popupmenu have to be anchored to a component? can it be positioned by coordinates or location - e.g. centre/centre
what happens if "showAboveAnchor" is set to false, and the anchor is at the bottom of a fixed page view
2 Likes
I am using your extension with several popupmenus linked together. Works great!
But what I am missing here is a ripple effect when an item gets clicked.
I can add this for you if you like (when you give me the source code)
Hi.
I'm testing the extension, it's very nice and usable.
I'm having problems with Kodular: everything works fine in Companion, but building the APK gives errors.
There are only 2 blocks!
I'm attaching the file with the build logs.
If it works in Kodular, I can pay you.
Thanks.
error_build_apk.txt (5.4 KB)
What about providing the complete error log here?
Taifun
Here you are:
Kodular is unable to compile this project.
The compiler error output was
[ReadBuildInfo] Starting Task
[ReadBuildInfo] Task succeeded in 0.006 seconds
[LoadComponentInfo] Starting Task
[LoadComponentInfo] INFO: Generating assets...
[LoadComponentInfo] Component assets needed, n = 7
[LoadComponentInfo] INFO: Generating activities...
[LoadComponentInfo] Component activities needed, n = 0
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify activityMetadata
[LoadComponentInfo] Component activity metadata needed, n = 0
[LoadComponentInfo] INFO: Generating broadcast receivers...
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify broadcastReceivers
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify contentProviders
[LoadComponentInfo] INFO: Generating libraries...
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify libraries
[LoadComponentInfo] Libraries needed, n = 4
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify metadata
[LoadComponentInfo] Component metadata needed, n = 0
[LoadComponentInfo] INFO: Generating Android minimum SDK...
[LoadComponentInfo] INFO: Generating native libraries...
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify native
[LoadComponentInfo] Native Libraries needed, n = 0
[LoadComponentInfo] INFO: Generating permissions...
[LoadComponentInfo] usesLocation = False
[LoadComponentInfo] Permissions needed, n = 4
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify queries
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify services
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify xmls
[LoadComponentInfo] Component xmls needed, n = 0
[LoadComponentInfo] INFO: Generating component broadcast receivers...
[LoadComponentInfo] INFO: Component "joejsanz.joedevpopupmenu.JoeDevPopupMenu" does not specify broadcastReceiver
[LoadComponentInfo] Task succeeded in 0.011 seconds
[CheckDeprecatedComponents] Starting Task
[CheckDeprecatedComponents] Task succeeded in 0.024 seconds
[CheckComponentRequirements] Starting Task
[CheckComponentRequirements] Task succeeded in 0.0 seconds
[VerifyExtensions] Starting Task
[VerifyExtensions] Task succeeded in 0.088 seconds
[GenerateBuildId] Starting Task
[GenerateBuildId] INFO: Skipping Build ID generation for App with no required components.
[GenerateBuildId] Task succeeded in 0.0 seconds
[RetrieveGamAdUnit] Starting Task
[RetrieveGamAdUnit] INFO: Skipping Ad Unit ID retrieval for app with no required components.
[RetrieveGamAdUnit] Task succeeded in 0.0 seconds
[PrepareAppIcon] Starting Task
[PrepareAppIcon] INFO: Creating mipmap dirs...
[PrepareAppIcon] INFO: Generating icons...
[PrepareAppIcon] Generating icons for mipmap-mdpi
[PrepareAppIcon] Generating icons for mipmap-hdpi
[PrepareAppIcon] Generating icons for mipmap-xhdpi
[PrepareAppIcon] Generating icons for mipmap-xxhdpi
[PrepareAppIcon] Generating icons for mipmap-xxxhdpi
[PrepareAppIcon] Task succeeded in 0.08 seconds
[XmlConfig] Starting Task
[XmlConfig] INFO: Creating animation xml
[XmlConfig] Creating zoom_enter.xml
[XmlConfig] Creating fadeout.xml
[XmlConfig] Creating slide_v_exit.xml
[XmlConfig] Creating fadein.xml
[XmlConfig] Creating zoom_exit.xml
[XmlConfig] Creating slide_v_enter.xml
[XmlConfig] Creating zoom_exit_reverse.xml
[XmlConfig] Creating slide_v_enter_reverse.xml
[XmlConfig] Creating zoom_enter_reverse.xml
[XmlConfig] Creating slide_enter_reverse.xml
[XmlConfig] Creating slide_exit.xml
[XmlConfig] Creating hold.xml
[XmlConfig] Creating slide_enter.xml
[XmlConfig] Creating slide_v_exit_reverse.xml
[XmlConfig] Creating slide_exit_reverse.xml
[XmlConfig] INFO: Creating colors xml
[XmlConfig] INFO: Creating styles xml
[XmlConfig] INFO: Creating provider_path xml
[XmlConfig] INFO: Creating network_security_config xml
[XmlConfig] INFO: Generating adaptive icon file
[XmlConfig] INFO: Generating round adaptive icon file
[XmlConfig] INFO: Generating adaptive icon background file
[XmlConfig] INFO: Creating fragment xml
[XmlConfig] INFO: Creating listview xml
[XmlConfig] INFO: Creating listview-21 xml
[XmlConfig] INFO: Creating drawable xml
[XmlConfig] INFO: Creating drawable-21 xml
[XmlConfig] INFO: Creating strings xml
[XmlConfig] Task succeeded in 0.003 seconds
[CreateManifest] Starting Task
[CreateManifest] INFO: Reading project specs...
[CreateManifest] VCode: 1
[CreateManifest] VName: 1.0
[CreateManifest] Custom Package Name: io.kodular.usr_q04k0k4qfc8uc40yjqa7.popup_menu1
[CreateManifest] Min SDK 21
[CreateManifest] INFO: Writing screen 'io.kodular.henryferrets.popup_menu1.Screen1'
[CreateManifest] Task succeeded in 0.001 seconds
[AttachNativeLibs] Starting Task
[AttachNativeLibs] Task succeeded in 0.0 seconds
[AttachAarLibs] Starting Task
[AttachAarLibs] Task succeeded in 0.06 seconds
[AttachCompAssets] Starting Task
[AttachCompAssets] Task succeeded in 0.003 seconds
[MergeResources] Starting Task
[MergeResources] Task succeeded in 0.062 seconds
[SetupLibs] Starting Task
[SetupLibs] Task succeeded in 0.0 seconds
[RunAapt] Starting Task
[RunAapt] ERROR: Error running AAPT
[RunAapt] Task errored in 0.237 seconds
.
I replicated your blocks in AppInventor and was able to compile the project without issue
1 Like
That's strange, I've tried the same two blocks in Kodular and it compiles fine.
Here's the AIA project for you to try.
PopupMenu.aia (26.3 KB)
1 Like
Thanks @Taifun
Thanks @TIMAI2
Thanks @Joejsanz
I redid a new project and it works!
I checked the old project, and in the settings, under the 'Theme' section, the colors were no longer there... and if I click to edit, the error appears.
I actually checked the project settings, but... I skipped the 'Theme' section, so I didn't notice!
I don't know why those fields are in that state.
Thanks everyone.
Enrico