https://github.com/enchev/nativescript-dialog
https://github.com/enchev/nativescript-dialog
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/enchev/nativescript-dialog
- Owner: enchev
- License: apache-2.0
- Created: 2015-10-26T12:30:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-21T12:15:02.000Z (over 7 years ago)
- Last Synced: 2025-03-01T17:37:33.928Z (11 months ago)
- Language: JavaScript
- Size: 1.41 MB
- Stars: 22
- Watchers: 1
- Forks: 11
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nativescript - Custom Dialog - NativeScript plugin for iOS and Android that allows you to create custom dialog. (Awesome {N} [](https://github.com/sindresorhus/awesome) / Table of Contents)
README
# NativeScript Dialog
A NativeScript plugin for iOS and Android that allows you to create custom dialog.
## Installation
`tns plugin add nativescript-dialog`
## Usage
###
```XML
```
```JavaScript
var platform = require("platform");
var application = require("application");
var dialog = require("nativescript-dialog");
exports.buttonTap = function(args){
var nativeView;
if(platform.device.os === platform.platformNames.ios){
nativeView = UIActivityIndicatorView.alloc().initWithActivityIndicatorStyle(UIActivityIndicatorViewStyle.UIActivityIndicatorViewStyleGray);
nativeView.startAnimating();
} else if(platform.device.os === platform.platformNames.android){
nativeView = new android.widget.ProgressBar(application.android.currentContext);
nativeView.setIndeterminate(true);
}
dialog.show({
title: "Loading...",
message: "Please wait!",
cancelButtonText: "Cancel",
nativeView: nativeView}
).then(function(r){ console.log("Result: " + r); },
function(e){console.log("Error: " + e)});
}
```
iOS | Android
------------ | -------------
 | 