Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26769] Android: Add parity with Ti.UI.iOS.MenuPopup using the PopupMenu API

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2019-01-26T10:18:57.000+0000
Updated2019-01-26T15:11:49.000+0000

Description

This ticket is about adding support the MenuPopup API on Android, which is currently iOS only via Ti.UI.iOS.MenuPopup. It can be done by using the native [PopupMenu](https://developer.android.com/reference/android/widget/PopupMenu) API.

Comments

  1. Hans Knöchel 2019-01-26

    PR: https://github.com/appcelerator/titanium_mobile/pull/10652 Example:
       var win = Ti.UI.createWindow({
           backgroundColor: "#fff",
       });
       var button = Ti.UI.createButton({
           title: "Show options"
       });
       win.add(button);
       var menu = Ti.UI.createMenuPopup({
           items: ["Option 1", "Option 2"]
       });
       menu.addEventListener("click", function(e) {
           alert(e);
       });
       button.addEventListener("click", function() {
           menu.show({
               view: button
           });
       });
       win.open();
       

JSON Source