| var exec = require('cordova/exec'); |
| |
| /** |
| * Provides Android enhanced notification API. |
| */ |
| module.exports = { |
| activityStart : function(title, message) { |
| // If title and message not specified then mimic Android behavior of |
| // using default strings. |
| if (typeof title === "undefined" && typeof message == "undefined") { |
| title = "Busy"; |
| message = 'Please wait...'; |
| } |
| |
| exec(null, null, 'Notification', 'activityStart', [ title, message ]); |
| }, |
| |
| /** |
| * Close an activity dialog |
| */ |
| activityStop : function() { |
| exec(null, null, 'Notification', 'activityStop', []); |
| }, |
| |
| /** |
| * Display a progress dialog with progress bar that goes from 0 to 100. |
| * |
| * @param {String} |
| * title Title of the progress dialog. |
| * @param {String} |
| * message Message to display in the dialog. |
| */ |
| progressStart : function(title, message) { |
| exec(null, null, 'Notification', 'progressStart', [ title, message ]); |
| }, |
| |
| /** |
| * Close the progress dialog. |
| */ |
| progressStop : function() { |
| exec(null, null, 'Notification', 'progressStop', []); |
| }, |
| |
| /** |
| * Set the progress dialog value. |
| * |
| * @param {Number} |
| * value 0-100 |
| */ |
| progressValue : function(value) { |
| exec(null, null, 'Notification', 'progressValue', [ value ]); |
| }, |
| }; |