Cordova PhoneGap ActionSheet plugin for iOS and Android
Recently I was wondering how hard it could be to add a Cordova plugin for showing a native ActionSheet like Twitter on iOS does:
.. so I gave it a try
– A title, on top of the dialog.
– Multiple options, shown in blue.
– A ‘desctructive option’, shown in red. This does the same as the other buttons, but can be used to indicate to the user this action can not be undone.
– A cancel button.
There are two differences to keep in mind when using this plugin on Android:
– The cancel button is hidden by default, even when a label for the cancel button was passed in. This is common Android behavior as all devices have a dedicated backbutton which can be used to close the popup as well. If you want a cancel button (like the screenshots), there is an option in the API to tell the plugin to do so.
– The ‘destructive option’ (the red ones in the iOS screenshots) don’t have a different color.
Head over to the GitHub repo, star it, and follow the instructions to install it.
What about PhoneGap Build?
Check out the plugin page and search for the ActionSheet plugin (I would have provided a deeplink, but the URL changes with every update of the plugin). Android support was added in version 1.0.0 which has not yet been approved at the time of writing.