@nstudio/nativescript-loading-indicator 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -99,5 +99,5 @@ export enum Mode {
99
99
  DeterminateHorizontalBar = 2,
100
100
  AnnularDeterminate = 3,
101
101
  CustomView = 4,
102
- Text = 5
102
+ Text = 5,
103
103
  }
@@ -1,4 +1,4 @@
1
- import { Application, Color, ImageSource, Screen, Frame, Utils } from '@nativescript/core';
1
+ import { Application, Color, Frame, ImageSource, Screen, } from '@nativescript/core';
2
2
  import { Mode } from './loading-indicator.common';
3
3
  export * from './loading-indicator.common';
4
4
  const R_ATTR_PROGRESS_BAR_STYLE_HORIZONTAL = 0x01010078;
@@ -21,20 +21,23 @@ export class LoadingIndicator {
21
21
  this._isCreatingPopOver = false;
22
22
  }
23
23
  show(options) {
24
- const context = Utils.android.getApplicationContext();
24
+ const context = Application.android.foregroundActivity || Application.android.startActivity;
25
25
  if (context) {
26
26
  options = options || {};
27
27
  options.android = options.android || {};
28
- options.userInteractionEnabled = options.userInteractionEnabled !== undefined;
28
+ options.userInteractionEnabled =
29
+ options.userInteractionEnabled !== undefined;
29
30
  if (!this._popOver) {
30
31
  this._isCreatingPopOver = true;
31
32
  new Promise((resolve) => {
32
33
  this._createPopOver(context, options);
33
34
  this._loadersInstances.push(this._popOver);
34
35
  resolve();
35
- }).then(() => {
36
+ })
37
+ .then(() => {
36
38
  this._isCreatingPopOver = false;
37
- }).catch((error) => {
39
+ })
40
+ .catch((error) => {
38
41
  // Ensure this is left in a clean state.
39
42
  this._isCreatingPopOver = false;
40
43
  const message = error && error.message ? `: ${error.message}` : '';
@@ -111,7 +114,7 @@ export class LoadingIndicator {
111
114
  }
112
115
  }
113
116
  return true;
114
- }
117
+ },
115
118
  }));
116
119
  const defaultBackgroundColor = android.graphics.Color.WHITE;
117
120
  // handle dimming background option
@@ -124,7 +127,7 @@ export class LoadingIndicator {
124
127
  parentView.setOnTouchListener(new android.view.View.OnTouchListener({
125
128
  onTouch(view, event) {
126
129
  return true;
127
- }
130
+ },
128
131
  }));
129
132
  // Use the ViewCompatNamespace to properly map to `ViewCompat` for AndroidX and support lib versions to avoid breaking change
130
133
  ViewCompatNamespace.ViewCompat.setElevation(parentView, 9.0);
@@ -341,7 +344,8 @@ export class LoadingIndicator {
341
344
  * acquired child is the correct class.
342
345
  */
343
346
  let progressView = parentView.getChildAt(0);
344
- if (progressView instanceof android.widget.ProgressBar === false || progressView === undefined) {
347
+ if (progressView instanceof android.widget.ProgressBar === false ||
348
+ progressView === undefined) {
345
349
  progressView = new android.widget.ProgressBar(context);
346
350
  }
347
351
  if (options.color) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nstudio/nativescript-loading-indicator",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "A NativeScript plugin for showing an overlayed loading indicator.",
5
5
  "main": "loading-indicator",
6
6
  "typings": "index.d.ts",
@@ -18,20 +18,20 @@
18
18
  "tsc": "tsc -skipLibCheck",
19
19
  "build": "npm run tsc && npm run build.native",
20
20
  "build.native": "node scripts/build-native.js",
21
- "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
21
+ "postclone": "npm run npm-i && node scripts/postclone.js && cd ../demo && npm run npm-i && npx rimraf -- package-lock.json && cd ../src",
22
+ "npm-i": "npm i --legacy-peer-deps",
22
23
  "test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
23
24
  "test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
24
25
  "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude '**/platforms/**' --exclude \"**/typings/**\"",
25
- "plugin.tscwatch": "npm run tsc -- -w",
26
26
  "demo.ios": "npm run tsc && cd ../demo && tns run ios",
27
27
  "demo.android": "npm run tsc && cd ../demo && tns run android",
28
28
  "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
29
- "demo-angular.ios": "npm i && cd ../demo-angular && tns run ios",
30
- "demo-angular.android": "npm i && cd ../demo-angular && tns run android",
29
+ "demo-angular.ios": "npm run npm-i && cd ../demo-angular && tns run ios",
30
+ "demo-angular.android": "npm run npm-i && cd ../demo-angular && tns run android",
31
31
  "demo-angular.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json",
32
32
  "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-loading-indicator && tns plugin add ../src",
33
- "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",
34
- "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**' --exclude '**/typings/**'",
33
+ "clean": "npm run demo.reset && npx rimraf node_modules package-lock.json && npm run npm-i",
34
+ "ci.tslint": "npm run npm-i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**' --exclude '**/typings/**'",
35
35
  "prepack": "npm run build.native",
36
36
  "generate.typings.ios": "cd ../demo && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" tns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" tns build ios && echo 'Now look for your library typings in demo/typings!'"
37
37
  },
@@ -80,14 +80,14 @@
80
80
  "homepage": "https://github.com/nstudio/nativescript-loading-indicator",
81
81
  "readmeFilename": "README.md",
82
82
  "devDependencies": {
83
- "husky": "^4.2.0",
84
- "lint-staged": "^10.0.2",
85
- "prettier": "^1.19.1",
86
- "@nativescript/core": "rc",
87
- "@nativescript/types": "rc",
88
- "typescript": "~3.9.0",
83
+ "husky": "~4.3.0",
84
+ "lint-staged": "~10.5.0",
85
+ "prettier": "~2.2.1",
86
+ "@nativescript/core": "~8.0.0",
87
+ "@nativescript/types": "~8.0.0",
88
+ "typescript": "~4.1.0",
89
89
  "prompt": "^1.0.0",
90
- "rimraf": "^2.6.3",
90
+ "rimraf": "^3.0.2",
91
91
  "tslint": "^6.1.3",
92
92
  "semver": "^5.6.0"
93
93
  },
package/references.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  /// <reference path="./node_modules/@nativescript/core/global-types.d.ts" />
2
- /// <reference path="./node_modules/@nativescript/types/ios.d.ts" />
3
- /// <reference path="./node_modules/@nativescript/types/android.d.ts" />
2
+ /// <reference path="./node_modules/@nativescript/types/index.d.ts" />
4
3
  /// <reference path="./typings/objc!MBProgressHUD.d.ts" />