Skip to content
This repository was archived by the owner on Dec 19, 2021. It is now read-only.

Commit 051eea9

Browse files
authored
Merge pull request #46 from nstudio/feat/dep-updates
chore: dep updates for {N} 7
2 parents 86ed640 + 59a504a commit 051eea9

File tree

6 files changed

+34
-35
lines changed

6 files changed

+34
-35
lines changed

src/.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ scripts/*
66
platforms/android/*
77
!platforms/android/include.gradle
88
!platforms/android/*.aar
9-
!platforms/android/*.jar
9+
!platforms/android/*.jar
10+
*.tgz

src/loading-indicator.android.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import * as application from '@nativescript/core/application';
2-
import { Color } from '@nativescript/core/color';
3-
import { ImageSource } from '@nativescript/core/image-source';
4-
import { screen } from '@nativescript/core/platform';
5-
import { Frame } from '@nativescript/core/ui/frame';
6-
import { ad as androidUtils } from '@nativescript/core/utils/utils';
1+
import { Application, Color, ImageSource, Screen, Frame, Utils } from '@nativescript/core';
72
import { Mode, OptionsCommon } from './loading-indicator.common';
83

94
export * from './loading-indicator.common';
@@ -45,7 +40,7 @@ export class LoadingIndicator {
4540
}
4641

4742
show(options?: OptionsCommon) {
48-
const context = androidUtils.getApplicationContext();
43+
const context = Utils.android.getApplicationContext();
4944
if (context) {
5045
options = options || {};
5146
options.android = options.android || {};
@@ -193,7 +188,7 @@ export class LoadingIndicator {
193188
android.view.ViewGroup.LayoutParams.WRAP_CONTENT
194189
);
195190

196-
const defaultPadding = 10 * screen.mainScreen.scale;
191+
const defaultPadding = 10 * Screen.mainScreen.scale;
197192
parentView.setPadding(
198193
defaultPadding,
199194
defaultPadding,
@@ -203,7 +198,7 @@ export class LoadingIndicator {
203198

204199
// handle margin option
205200
if (options.margin !== undefined) {
206-
const margin = options.margin * screen.mainScreen.scale;
201+
const margin = options.margin * Screen.mainScreen.scale;
207202
parentViewParams.setMargins(margin, margin, margin, margin);
208203
}
209204

@@ -317,8 +312,8 @@ export class LoadingIndicator {
317312
progressView.setBackgroundDrawable(this._getBackgroundDrawable());
318313
progressView.setLayoutParams(
319314
new android.widget.LinearLayout.LayoutParams(
320-
60 * screen.mainScreen.scale,
321-
60 * screen.mainScreen.scale
315+
60 * Screen.mainScreen.scale,
316+
60 * Screen.mainScreen.scale
322317
)
323318
);
324319
break;
@@ -330,8 +325,8 @@ export class LoadingIndicator {
330325
progressView.setBackgroundDrawable(this._getBackgroundDrawable());
331326
progressView.setLayoutParams(
332327
new android.widget.LinearLayout.LayoutParams(
333-
60 * screen.mainScreen.scale,
334-
60 * screen.mainScreen.scale
328+
60 * Screen.mainScreen.scale,
329+
60 * Screen.mainScreen.scale
335330
)
336331
);
337332
break;
@@ -388,8 +383,8 @@ export class LoadingIndicator {
388383
0
389384
);
390385
} else {
391-
this._popOver.setWidth(screen.mainScreen.widthPixels);
392-
this._popOver.setHeight(screen.mainScreen.heightPixels);
386+
this._popOver.setWidth(Screen.mainScreen.widthPixels);
387+
this._popOver.setHeight(Screen.mainScreen.heightPixels);
393388
this._popOver.showAtLocation(view, android.view.Gravity.CENTER, 0, 0);
394389
}
395390
}
@@ -643,8 +638,8 @@ export class LoadingIndicator {
643638
progressView.setBackgroundDrawable(this._getBackgroundDrawable());
644639
progressView.setLayoutParams(
645640
new android.widget.LinearLayout.LayoutParams(
646-
60 * screen.mainScreen.scale,
647-
60 * screen.mainScreen.scale
641+
60 * Screen.mainScreen.scale,
642+
60 * Screen.mainScreen.scale
648643
)
649644
);
650645
return progressView;
@@ -699,7 +694,7 @@ export class LoadingIndicator {
699694
}
700695

701696
private _getResources() {
702-
const ctx = application.android.foregroundActivity as android.app.Activity;
697+
const ctx = Application.android.foregroundActivity as android.app.Activity;
703698
return ctx.getResources();
704699
}
705700

src/loading-indicator.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Color } from '@nativescript/core/color';
1+
import { Color } from '@nativescript/core';
22
import { Mode, OptionsCommon } from './loading-indicator.common';
33

44
export * from './loading-indicator.common';

src/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nstudio/nativescript-loading-indicator",
3-
"version": "3.0.4",
3+
"version": "4.0.0",
44
"description": "A NativeScript plugin for showing an overlayed loading indicator.",
55
"main": "loading-indicator",
66
"typings": "index.d.ts",
@@ -83,12 +83,12 @@
8383
"husky": "^4.2.0",
8484
"lint-staged": "^10.0.2",
8585
"prettier": "^1.19.1",
86-
"@nativescript/core": "^6.3.2",
87-
"tns-platform-declarations": "^6.3.2",
88-
"typescript": "~3.7.4",
86+
"@nativescript/core": "rc",
87+
"@nativescript/types": "rc",
88+
"typescript": "~3.9.0",
8989
"prompt": "^1.0.0",
9090
"rimraf": "^2.6.3",
91-
"tslint": "^5.20.1",
91+
"tslint": "^6.1.3",
9292
"semver": "^5.6.0"
9393
},
9494
"dependencies": {}

src/references.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
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" />
34
/// <reference path="./typings/objc!MBProgressHUD.d.ts" />

src/tsconfig.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
3+
"rootDir": ".",
4+
"target": "ES2017",
5+
"module": "esnext",
6+
"sourceMap": true,
57
"declaration": true,
6-
"removeComments": true,
7-
"noLib": false,
8+
"moduleResolution": "node",
89
"emitDecoratorMetadata": true,
910
"experimentalDecorators": true,
11+
"noEmitOnError": true,
12+
"noEmitHelpers": true,
13+
"diagnostics": true,
1014
"skipLibCheck": true,
11-
"lib": ["es6", "dom"],
12-
"sourceMap": true,
15+
"skipDefaultLibCheck": true,
16+
"lib": ["es2017", "dom"],
1317
"pretty": false,
1418
"allowUnreachableCode": false,
1519
"allowUnusedLabels": false,
16-
"noEmitHelpers": true,
17-
"noEmitOnError": false,
1820
"noImplicitAny": false,
1921
"noImplicitReturns": true,
2022
"noImplicitUseStrict": false,

0 commit comments

Comments
 (0)