@nativescript/core 8.3.0-alpha.2-next-07-09-2022-2641678746 → 8.3.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/fps-meter/fps-native.android.d.ts +2 -0
- package/fps-meter/fps-native.android.js +34 -7
- package/fps-meter/fps-native.android.js.map +1 -1
- package/package.json +5 -3
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +3 -3
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +3 -3
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/utils/mainthread-helper.android.d.ts +1 -1
- package/utils/mainthread-helper.android.js +20 -8
- package/utils/mainthread-helper.android.js.map +1 -1
- package/platforms/android/core.aar +0 -0
|
@@ -3,7 +3,9 @@ export declare class FPSCallback implements definition.FPSCallback {
|
|
|
3
3
|
private impl;
|
|
4
4
|
private onFrame;
|
|
5
5
|
running: boolean;
|
|
6
|
+
sdkVersion: number;
|
|
6
7
|
constructor(onFrame: (currentTimeMillis: number) => void);
|
|
8
|
+
private _isNativeFramesSupported;
|
|
7
9
|
start(): void;
|
|
8
10
|
stop(): void;
|
|
9
11
|
private handleFrame;
|
|
@@ -1,25 +1,47 @@
|
|
|
1
|
+
import { Device } from '../platform';
|
|
1
2
|
export class FPSCallback {
|
|
2
3
|
constructor(onFrame) {
|
|
3
4
|
this.running = false;
|
|
4
5
|
this.onFrame = onFrame;
|
|
5
|
-
this.
|
|
6
|
-
|
|
6
|
+
this.sdkVersion = parseInt(Device.sdkVersion);
|
|
7
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
8
|
+
this.impl = (nanos) => {
|
|
7
9
|
this.handleFrame(nanos);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.impl = new android.view.Choreographer.FrameCallback({
|
|
14
|
+
doFrame: (nanos) => {
|
|
15
|
+
this.handleFrame(nanos);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
_isNativeFramesSupported() {
|
|
21
|
+
return typeof global.__postFrameCallback === 'function' && typeof global.__removeFrameCallback === 'function';
|
|
10
22
|
}
|
|
11
23
|
start() {
|
|
12
24
|
if (this.running) {
|
|
13
25
|
return;
|
|
14
26
|
}
|
|
15
|
-
|
|
27
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
28
|
+
global.__postFrameCallback(this.impl);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
android.view.Choreographer.getInstance().postFrameCallback(this.impl);
|
|
32
|
+
}
|
|
16
33
|
this.running = true;
|
|
17
34
|
}
|
|
18
35
|
stop() {
|
|
19
36
|
if (!this.running) {
|
|
20
37
|
return;
|
|
21
38
|
}
|
|
22
|
-
|
|
39
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
40
|
+
global.__removeFrameCallback(this.impl);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
android.view.Choreographer.getInstance().removeFrameCallback(this.impl);
|
|
44
|
+
}
|
|
23
45
|
this.running = false;
|
|
24
46
|
}
|
|
25
47
|
handleFrame(nanos) {
|
|
@@ -29,7 +51,12 @@ export class FPSCallback {
|
|
|
29
51
|
// divide by 1 000 000 since the parameter is in nanoseconds
|
|
30
52
|
this.onFrame(nanos / 1000000);
|
|
31
53
|
// add the FrameCallback instance again since it is automatically removed from the Choreographer
|
|
32
|
-
|
|
54
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
55
|
+
global.__postFrameCallback(this.impl);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
android.view.Choreographer.getInstance().postFrameCallback(this.impl);
|
|
59
|
+
}
|
|
33
60
|
}
|
|
34
61
|
}
|
|
35
62
|
//# sourceMappingURL=fps-native.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fps-native.android.js","sourceRoot":"","sources":["../../../../packages/core/fps-meter/fps-native.android.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fps-native.android.js","sourceRoot":"","sources":["../../../../packages/core/fps-meter/fps-native.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,WA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U,IAAI,EAAE,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YAC5D,MAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACjD;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAW,CAAC,CAAC;SAC/E;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,WAAW,CAAC,KAAa;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,OAAO;SACP;QAED,4DAA4D;QAC5D,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;QAC9B,gGAAgG;QAEhG,IAAI,IAAI,CAAC,UAAU,IAAI,EAAE,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YAC5D,MAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC/C;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAW,CAAC,CAAC;SAC7E;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript/core",
|
|
3
|
-
"version": "8.3.0
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"**/*.js",
|
|
15
15
|
"**/*.map",
|
|
16
16
|
"**/platforms/ios/**",
|
|
17
|
-
"
|
|
17
|
+
"platforms/android/native-api-usage.json",
|
|
18
|
+
"platforms/android/res/values/ids.xml",
|
|
19
|
+
"platforms/android/widgets-release.aar",
|
|
18
20
|
"**/package.json"
|
|
19
21
|
],
|
|
20
22
|
"keywords": [
|
|
@@ -62,4 +64,4 @@
|
|
|
62
64
|
}
|
|
63
65
|
]
|
|
64
66
|
}
|
|
65
|
-
}
|
|
67
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<key>DTCompiler</key>
|
|
30
30
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
31
31
|
<key>DTPlatformBuild</key>
|
|
32
|
-
<string>
|
|
32
|
+
<string>13F100</string>
|
|
33
33
|
<key>DTPlatformName</key>
|
|
34
34
|
<string>macosx</string>
|
|
35
35
|
<key>DTPlatformVersion</key>
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
<key>DTSDKName</key>
|
|
40
40
|
<string>macosx12.3</string>
|
|
41
41
|
<key>DTXcode</key>
|
|
42
|
-
<string>
|
|
42
|
+
<string>1341</string>
|
|
43
43
|
<key>DTXcodeBuild</key>
|
|
44
|
-
<string>
|
|
44
|
+
<string>13F100</string>
|
|
45
45
|
<key>LSMinimumSystemVersion</key>
|
|
46
46
|
<string>10.15</string>
|
|
47
47
|
<key>UIDeviceFamily</key>
|
|
Binary file
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<key>DTCompiler</key>
|
|
30
30
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
31
31
|
<key>DTPlatformBuild</key>
|
|
32
|
-
<string>
|
|
32
|
+
<string>13F100</string>
|
|
33
33
|
<key>DTPlatformName</key>
|
|
34
34
|
<string>macosx</string>
|
|
35
35
|
<key>DTPlatformVersion</key>
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
<key>DTSDKName</key>
|
|
40
40
|
<string>macosx12.3</string>
|
|
41
41
|
<key>DTXcode</key>
|
|
42
|
-
<string>
|
|
42
|
+
<string>1341</string>
|
|
43
43
|
<key>DTXcodeBuild</key>
|
|
44
|
-
<string>
|
|
44
|
+
<string>13F100</string>
|
|
45
45
|
<key>LSMinimumSystemVersion</key>
|
|
46
46
|
<string>10.15</string>
|
|
47
47
|
<key>UIDeviceFamily</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function dispatchToMainThread(func: () => void): void;
|
|
2
2
|
export declare function isMainThread(): boolean;
|
|
3
|
-
export declare function dispatchToUIThread(func: () => void):
|
|
3
|
+
export declare function dispatchToUIThread(func: () => void): void;
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
+
import { android as ad } from '../application';
|
|
1
2
|
export function dispatchToMainThread(func) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const runOnMainThread = global.__runOnMainThread;
|
|
4
|
+
if (runOnMainThread) {
|
|
5
|
+
runOnMainThread(() => {
|
|
6
|
+
func();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
new android.os.Handler(android.os.Looper.getMainLooper()).post(new java.lang.Runnable({
|
|
11
|
+
run: func,
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
5
14
|
}
|
|
6
15
|
export function isMainThread() {
|
|
7
16
|
return android.os.Looper.myLooper() === android.os.Looper.getMainLooper();
|
|
8
17
|
}
|
|
9
18
|
export function dispatchToUIThread(func) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
const activity = ad.foregroundActivity || ad.startActivity;
|
|
20
|
+
if (activity && func) {
|
|
21
|
+
activity.runOnUiThread(new java.lang.Runnable({
|
|
22
|
+
run() {
|
|
23
|
+
func();
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
28
|
//# sourceMappingURL=mainthread-helper.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainthread-helper.android.js","sourceRoot":"","sources":["../../../../packages/core/utils/mainthread-helper.android.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACpD,IAAI,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,CAC7D,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"mainthread-helper.android.js","sourceRoot":"","sources":["../../../../packages/core/utils/mainthread-helper.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACpD,MAAM,eAAe,GAAI,MAAc,CAAC,iBAAiB,CAAC;IAC1D,IAAI,eAAe,EAAE;QACpB,eAAe,CAAC,GAAG,EAAE;YACpB,IAAI,EAAE,CAAC;QACR,CAAC,CAAC,CAAC;KACH;SAAM;QACN,IAAI,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,CAC7D,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtB,GAAG,EAAE,IAAI;SACT,CAAC,CACF,CAAC;KACF;AACF,CAAC;AAED,MAAM,UAAU,YAAY;IAC3B,OAAO,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAgB;IAClD,MAAM,QAAQ,GAA6C,EAAE,CAAC,kBAAkB,IAAI,EAAE,CAAC,aAAa,CAAC;IACrG,IAAI,QAAQ,IAAI,IAAI,EAAE;QACrB,QAAQ,CAAC,aAAa,CACrB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtB,GAAG;gBACF,IAAI,EAAE,CAAC;YACR,CAAC;SACD,CAAC,CACF,CAAC;KACF;AACF,CAAC"}
|
|
Binary file
|