Skip to content

Commit 7acf609

Browse files
committed
demo(vue): update
1 parent 9e4e8d9 commit 7acf609

File tree

5 files changed

+32
-384
lines changed

5 files changed

+32
-384
lines changed

demo-vue/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
android:name="com.tns.NativeScriptActivity"
3030
android:label="@string/title_activity_kimera"
3131
android:configChanges="keyboardHidden|orientation|screenSize"
32-
android:theme="@style/LaunchScreenTheme">
32+
android:theme="@style/LaunchScreenTheme"
33+
android:exported="true">
3334

3435
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
3536

@@ -38,6 +39,6 @@
3839
<category android:name="android.intent.category.LAUNCHER" />
3940
</intent-filter>
4041
</activity>
41-
<activity android:name="com.tns.ErrorReportActivity"/>
42+
<activity android:name="com.tns.ErrorReportActivity" android:exported="false"/>
4243
</application>
4344
</manifest>

demo-vue/app/canvastests.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Align, Canvas, Cap, DashPathEffect, LinearGradient, Paint, Path, RadialGradient, Rect, RectF, Style, TileMode, createRect, createRectF } from '@nativescript-community/ui-canvas';
1+
import { Align, Canvas, Cap, DashPathEffect, LinearGradient, Paint, Path, RadialGradient, Rect, RectF, Style, TileMode, createRect, createRectF, ColorMatrixColorFilter } from '@nativescript-community/ui-canvas';
22
import { Label, Utils } from '@nativescript/core';
33
import { Color } from '@nativescript/core/color';
44
import { Folder, knownFolders, path } from '@nativescript/core/file-system';
@@ -120,7 +120,9 @@ export function drawOnImage(scale = 3, canvas?: Canvas) {
120120
canvas.save();
121121
// canvas.translate(10, 600);
122122
// canvas.drawBitmap(iconLocalFile, 0, 0, null);
123-
canvas.drawBitmap(iconLocalFile, null, createRect(0, 0, 200, 300), null);
123+
const bitmapPaint = new Paint();
124+
bitmapPaint.setColorFilter(new ColorMatrixColorFilter([0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0, 0, 0, 1, 0]));
125+
canvas.drawBitmap(iconLocalFile, null, createRect(0, 0, 200, 300), bitmapPaint);
124126
canvas.restore();
125127

126128
// arc path

demo-vue/app/examples/Image.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ export default class Image extends Vue {
2828
Frame.topmost().goBack();
2929
}
3030
onDraw(event: { canvas }) {
31+
try {
32+
3133
const canvas = event.canvas;
3234
3335
// const deviceScale = screen.mainScreen.scale;
3436
// canvas.scale(deviceScale, deviceScale); // always scale to device density to work with dp
3537
console.log('onDraw canvas:', canvas.getWidth(), canvas.getHeight());
3638
3739
canvas.drawBitmap(iconLocalFile, null, createRect(0, 50, 200, 300), null);
40+
} catch (error) {
41+
console.error(error, error.stack)
42+
}
3843
}
3944
}
4045
</script>

demo-vue/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
"license": "SEE LICENSE IN LICENSE.md",
55
"readme": "README.md",
66
"repository": "http://www.github.com/Akylas/@nativescript-community/ui-canvas.git",
7-
"main": "main",
7+
"main": "app/main",
88
"dependencies": {
9-
"@nativescript/core": "7.2.1",
10-
"@nativescript-community/perms": "2.1.5",
9+
"@nativescript/core": "8.3.0",
10+
"@nativescript-community/perms": "2.2.11",
1111
"@nativescript-community/ui-canvas": "file:../plugin",
12-
"@nativescript-community/ui-material-core": "5.2.8",
12+
"@nativescript-community/ui-material-core": "7.0.24",
1313
"@nativescript-community/tween": "0.0.14",
14-
"nativescript-vue": "^2.8.3"
14+
"nativescript-vue": "^2.9.2"
1515
},
1616
"devDependencies": {
17-
"@babel/core": "^7.12.3",
18-
"@nativescript/android": "7.0.1",
19-
"@nativescript/types": "7.2.0",
20-
"@nativescript/webpack": "4.1.0",
21-
"babel-loader": "^8.2.2",
22-
"nativescript-vue-template-compiler": "2.8.3",
23-
"tns-ios": "6.5.4",
24-
"typescript": "^3.9.7",
25-
"vue": "^2.6.12",
17+
"@babel/core": "^7.18.6",
18+
"@nativescript/android": "8.2.4",
19+
"@nativescript/types": "8.2.0",
20+
"@nativescript/webpack": "5.0.7",
21+
"babel-loader": "^8.2.5",
22+
"nativescript-vue-template-compiler": "2.9.2",
23+
"@nativescript/ios": "6.5.5",
24+
"typescript": "^4.7.4",
25+
"vue": "^2.7.5",
2626
"vue-loader": "^15.9.3",
2727
"vue-property-decorator": "^8.5.1"
2828
}

0 commit comments

Comments
 (0)