-
Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.
-
Add a plugin to your project using Cordova CLI:
cordova plugin add https://francescoverheye@bitbucket.org/francescoverheye/checkroom-plugin-confirmpanel.git
Or using PhoneGap CLI:
phonegap local plugin add https://francescoverheye@bitbucket.org/francescoverheye/checkroom-plugin-confirmpanel.git
function showSuccessHud() {
var text = 'success';
var icon = 'success.png';
var timeOut = 3000;
var options = {
text: text,
icon: icon,
timeOut: timeOut
};
hudPlugin.show(options);
}
function hideHud() {
hudPlugin.hide();
}
function askVisibility(){
hudPlugin.isShowing(
function(result){
alert("result " + JSON.stringify(result));
});
}
function showErrorHud() {
var icon = 'error.png';
var timeOut = 0;
var options = {
icon: icon,
timeOut: timeOut
};
hudPlugin.show(options);
}
function showLoadingHud() {
var options = {};
hudPlugin.show(options);
var myVar = setTimeout(hideHud, 1000);
}
function showLoadingHud2() {
var options = {};
hudPlugin.show(options);
var myVar = setTimeout(askVisibility, 1000);
var myVar2 = setTimeout(hideHud, 5000);
}
The text on the HUD.
Type: String
Default: ``
The image resource name (need to include '.png')
Type: String
Default: ``
Example: success.png
Time out to close the HUD (in ms). 0 keeps the hud visible until hide is called.
Type: Integer
Default: 0
- PhoneGap 3.0 or newer / Cordova 3.0 or newer
- Android 2.3.1 or newer / iOS 5 or newer
- add the .png files in /platforms/android/res/drawable
- must be .png
- example used images with a 74x74 dimension
- open the project in Xcode
- File - New - File
- choose iOS Resource on the left
- choose 'Asset Catalog' on the right, press next
- Save as: 'Images'
- save in /PROJECT_NAME/Resources
- add your images (png files) to 'Imagex.xcassets'