The Android Design Extensions 1.5 are now available. This version works with Xojo 2023r3 and brings about 90 new extensions:
- Declares for the new MobilePopupMenu
- Declares for MobileMoviePlayer
- Extensions for all MobileUIControl subclasses
- New extensions for AndroidMobileTable
- New extensions for MobileScrollableArea
- New extensions for MobileSwitch
- New extensions for MobileTabPanel
- New extensions for MobileTextArea
- New extensions for MobileTextField
Use MobilePopupMenu to Display it in Other Controls
The new MobilePopupMenu is a nice new addition to Xojo’s Android control library. Wouldn’t it be nice to display the popup menu when clicking on a Button or Canvas as well? With the Android Design Extensions you can achieve this.
- Create a new Android project
- Import the Android Design Extension folder into your project
- Add a MobilePopupMenu (PopupMenu1) from the library to Screen1
- Add some entries to the PopupMenu1 in the Inspector in the InitialValue section (say “Apple”, “Banana”, “Peach”)
- Set the Visible property of the PopupMenu1 to
- Add a MobileButton (Button1) from the library to Screen1 and place it over the “invisible” PopupMenu1
- Add the Pressed-Event to Button1 with the following code:
8. Add the SelectionChanged-Event to the PopupMenu1 with the following code:
Button1.Caption = Me.SelectedRowText
9. Run your project by clicking Run.
You can use this technique with any control that you want to have a popup menu. For example, in a Canvas you would use the PointerDown-Event.
Feel free to take a look at the developer repository, create feature requests, and provide feedback on extending this extension library.
Martin T. is a Xojo MVP and has been very involved in testing Android support.