mirror of
https://github.com/lampaa/com.lampa.startapp.git
synced 2026-04-12 00:00:30 +08:00
upload plugin (phonegap 3.0.0)
This commit is contained in:
74
www/android/startApp.js
Normal file
74
www/android/startApp.js
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
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 ]);
|
||||
}
|
||||
};
|
||||
33
www/startApp.js
Normal file
33
www/startApp.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var platform = require('cordova/platform');
|
||||
|
||||
|
||||
/** Open a native alert dialog, with a customizable title and button text.
|
||||
*
|
||||
* @param {String} message app name
|
||||
* @param {Function} completeCallback The callback that is called when open app
|
||||
*/
|
||||
module.exports = function(message, completeCallback) {
|
||||
exec(completeCallback, null, "startApp", "startapp", [message]);
|
||||
}
|
||||
Reference in New Issue
Block a user