apache / cordova-plugin-dialogs

Apache Cordova Dialogs Plugin
https://cordova.apache.org/
Apache License 2.0
290 stars 354 forks source link

(android): Added ability to setCancelable #134

Open ebhsgit opened 4 years ago

ebhsgit commented 4 years ago

Platforms affected

Android

Motivation and Context

When user taps outside the dialog in Android, it cancels the dialog. This may not be the expected behaviour for some users, since the user has not tap any of the buttons. Resulting in confusion for some users.

This change allows the developer to set globally, whether dialog should be cancelable

Description

Changes are added specifically for Android platform.

Added a property - isCancelable, to Notification.java class that controls whether new dialogs are cancelable. Default is true, so the change is backward compatible

Added a function - setCancelable(enable), to set the isCancelable property