GithubHelp home page GithubHelp logo

checkroom-plugin-hud's Introduction

ConfirmPanel Plugin for Cordova/PhoneGap 3.0 (iOS and Android)

Installation

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.

  2. Add a plugin to your project using Cordova CLI:

cordova plugin add https://[email protected]/francescoverheye/checkroom-plugin-confirmpanel.git

Or using PhoneGap CLI:

phonegap local plugin add https://[email protected]/francescoverheye/checkroom-plugin-confirmpanel.git

Usage

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);
}

Options

text - iOS, Android

The text on the HUD.

Type: String

Default: ``

icon - iOS, Android

The image resource name (need to include '.png')

Type: String

Default: ``

Example: success.png

timeOut - iOS, Android

Time out to close the HUD (in ms). 0 keeps the hud visible until hide is called.

Type: Integer

Default: 0

Requirements

  • PhoneGap 3.0 or newer / Cordova 3.0 or newer
  • Android 2.3.1 or newer / iOS 5 or newer

How to add image to both platforms

Android

  • add the .png files in /platforms/android/res/drawable
  • must be .png
  • example used images with a 74x74 dimension

iOS

  1. open the project in Xcode
  2. File - New - File
  3. choose iOS Resource on the left
  4. choose 'Asset Catalog' on the right, press next
  5. Save as: 'Images'
  6. save in /PROJECT_NAME/Resources
  7. add your images (png files) to 'Imagex.xcassets'

checkroom-plugin-hud's People

Contributors

jeroenv avatar verheyefrancesco avatar michieldemey avatar

Watchers

 avatar

Forkers

michieldemey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.