cordova-plugin-waiting-smooth
v1.0.0
Published
Progress bar horizontal di atas layar Android tanpa tergantung ActionBar
Maintainers
Readme
cordova-plugin-waiting-smooth
A simple Cordova plugin to display a smooth top progress bar with optional dim background and cancel support.
Platform Support
- Android only
Installation
cordova plugin add cordova-plugin-waiting-smoothUsage
Show the loading bar
cordova.plugin.waiting.smooth.show("#2196F3", false, true);Parameters:
color(String): Hex color code of the progress bar.cancelable(Boolean): If true, tapping the dim background will hide the loader and fire anonWaitingCancelevent.dim(Boolean): If true, adds a semi-transparent dim background.
Hide the loading bar
cordova.plugin.waiting.smooth.hide();Events
You can listen for three events using document.addEventListener:
document.addEventListener("onWaitingShow", () => {
console.log("Loading started");
});
document.addEventListener("onWaitingCancel", () => {
console.log("Loading canceled");
});
document.addEventListener("onWaitingHide", () => {
console.log("Loading hidden");
});Events will be automatically fired when:
- Loading is shown via
.show() - Loading is canceled via tap (if
cancelableistrue) - Loading is hidden programmatically using
.hide()
License
MIT
