Skip to content

Commit 5d4edc4

Browse files
committed
feat: Added missing support and demo for NativeScript Core.
1 parent 242bc26 commit 5d4edc4

File tree

87 files changed

+1267
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1267
-11
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ hooks
66
package-lock.json
77
.DS_Store
88
npm-debug.log.*
9-
demo*/app/**/*.js
109
demo*/typings
1110
*.framework
1211
**/*.js.map
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<resources>
2-
<string name="app_name">OpenCV - Demo</string>
3-
<string name="title_activity_kimera">OpenCV - Demo</string>
4-
</resources>
2+
<string name="app_name">Canvas Demo-Vue</string>
3+
<string name="title_activity_kimera">Canvas Demo-Vue</string>
4+
</resources>

Diff for: demo-vue/app/App_Resources/iOS/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
77
<key>CFBundleDisplayName</key>
8-
<string>Canvas - Demo</string>
8+
<string>Canvas Demo-Vue</string>
99
<key>CFBundleExecutable</key>
1010
<string>${EXECUTABLE_NAME}</string>
1111
<key>CFBundleInfoDictionaryVersion</key>

Diff for: demo-vue/app/canvastests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function drawOnImage(scale = 3, canvas?: Canvas) {
6969
bgPaint.setStyle(Style.STROKE);
7070
bgPaint.setShadowLayer(4, 0, 2, 'blue');
7171
bgPaint.setPathEffect(new DashPathEffect([6, 4], 0));
72-
canvas.drawRoundRect(0, hH / 2 + 2 * padding, hW, hH / 2 + hH / 2 + 2 * padding, 30, 30, bgPaint);
72+
canvas.drawRoundRect(createRectF(0, hH / 2 + 2 * padding, hW, hH / 2 + hH / 2 + 2 * padding), 30, 30, bgPaint);
7373
bgPaint.clearShadowLayer();
7474
bgPaint.setPathEffect(null);
7575

Diff for: demo-vue/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2+
"name": "demovuecanvas",
23
"description": "NativeScript canvas Demo for Vue",
34
"license": "SEE LICENSE IN LICENSE.md",
45
"readme": "README.md",
56
"repository": "http://www.github.com/Akylas/@nativescript-community/ui-canvas.git",
6-
"main": "main.js",
7+
"main": "main",
78
"dependencies": {
89
"@nativescript/core": "7.0.3",
910
"@nativescript-community/perms": "2.1.1",
@@ -24,4 +25,4 @@
2425
"vue-loader": "^15.9.3",
2526
"vue-property-decorator": "^8.5.1"
2627
}
27-
}
28+
}

Diff for: demo/.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# NativeScript
2+
hooks/
3+
node_modules/
4+
platforms/
5+
6+
# NativeScript Template
7+
*.js.map
8+
*.js
9+
!webpack.config.js
10+
11+
# Logs
12+
logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# General
19+
.DS_Store
20+
.AppleDouble
21+
.LSOverride
22+
.idea
23+
.cloud
24+
.project
25+
tmp/
26+
typings/
27+
28+
# Visual Studio Code
29+
.vscode/*
30+
!.vscode/settings.json
31+
!.vscode/tasks.json
32+
!.vscode/launch.json
33+
!.vscode/extensions.json

Diff for: demo/app/App_Resources/Android/app.gradle

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Add your native dependencies here:
2+
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// implementation 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
// If you want to add something to be applied before applying plugins' include.gradle files
9+
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10+
// create a file named before-plugins.gradle in the current directory and place it there
11+
12+
android {
13+
defaultConfig {
14+
minSdkVersion 17
15+
generatedDensities = []
16+
}
17+
aaptOptions {
18+
additionalParameters "--no-version-vectors"
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
14+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
15+
<uses-permission android:name="android.permission.INTERNET"/>
16+
17+
<application
18+
android:name="com.tns.NativeScriptApplication"
19+
android:allowBackup="true"
20+
android:icon="@drawable/icon"
21+
android:label="@string/app_name"
22+
android:theme="@style/AppTheme">
23+
24+
<activity
25+
android:name="com.tns.NativeScriptActivity"
26+
android:label="@string/title_activity_kimera"
27+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
28+
android:theme="@style/LaunchScreenTheme">
29+
30+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
31+
32+
<intent-filter>
33+
<action android:name="android.intent.action.MAIN" />
34+
<category android:name="android.intent.category.LAUNCHER" />
35+
</intent-filter>
36+
</activity>
37+
<activity android:name="com.tns.ErrorReportActivity"/>
38+
</application>
39+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
2+
<item>
3+
<bitmap android:gravity="fill" android:src="@drawable/background" />
4+
</item>
5+
<item>
6+
<bitmap android:gravity="center" android:src="@drawable/logo" />
7+
</item>
8+
</layer-list>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_accent">#3d5afe</color>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- Application theme -->
5+
<style name="AppThemeBase21" parent="AppThemeBase">
6+
<item name="android:windowTranslucentStatus">true</item>
7+
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
8+
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
9+
</style>
10+
11+
<style name="AppTheme" parent="AppThemeBase21">
12+
</style>
13+
14+
<!-- Default style for DatePicker - in spinner mode -->
15+
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
16+
<item name="android:datePickerMode">spinner</item>
17+
</style>
18+
19+
<!-- Default style for TimePicker - in spinner mode -->
20+
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
21+
<item name="android:timePickerMode">spinner</item>
22+
</style>
23+
24+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
25+
<item name="android:elevation">4dp</item>
26+
<item name="android:paddingTop">24dp</item>
27+
</style>
28+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- Application theme -->
5+
<style name="AppThemeBase29" parent="AppThemeBase21">
6+
<item name="android:forceDarkAllowed">true</item>
7+
</style>
8+
9+
<style name="AppTheme" parent="AppThemeBase29">
10+
</style>
11+
12+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_primary">#F5F5F5</color>
4+
<color name="ns_primaryDark">#757575</color>
5+
<color name="ns_accent">#33B5E5</color>
6+
<color name="ns_blue">#272734</color>
7+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<string name="app_name">Canvas Demo</string>
3+
<string name="title_activity_kimera">Canvas Demo</string>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- theme to use FOR launch screen-->
5+
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
6+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7+
8+
<item name="colorPrimary">@color/ns_primary</item>
9+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
10+
<item name="colorAccent">@color/ns_accent</item>
11+
12+
<item name="android:windowBackground">@drawable/splash_screen</item>
13+
14+
<item name="android:windowActionBarOverlay">true</item>
15+
<item name="android:windowTranslucentStatus">true</item>
16+
17+
</style>
18+
19+
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
20+
</style>
21+
22+
<!-- theme to use AFTER launch screen is loaded-->
23+
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
24+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
25+
26+
<item name="colorPrimary">@color/ns_primary</item>
27+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
28+
<item name="colorAccent">@color/ns_accent</item>
29+
30+
</style>
31+
32+
<style name="AppTheme" parent="AppThemeBase">
33+
</style>
34+
35+
<!-- theme for action-bar -->
36+
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
37+
<item name="android:background">@color/ns_primary</item>
38+
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
39+
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
40+
41+
</style>
42+
43+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
44+
</style>
45+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "20x20",
5+
"idiom" : "iphone",
6+
"filename" : "[email protected]",
7+
"scale" : "2x"
8+
},
9+
{
10+
"size" : "20x20",
11+
"idiom" : "iphone",
12+
"filename" : "[email protected]",
13+
"scale" : "3x"
14+
},
15+
{
16+
"size" : "29x29",
17+
"idiom" : "iphone",
18+
"filename" : "icon-29.png",
19+
"scale" : "1x"
20+
},
21+
{
22+
"size" : "29x29",
23+
"idiom" : "iphone",
24+
"filename" : "[email protected]",
25+
"scale" : "2x"
26+
},
27+
{
28+
"size" : "29x29",
29+
"idiom" : "iphone",
30+
"filename" : "[email protected]",
31+
"scale" : "3x"
32+
},
33+
{
34+
"size" : "40x40",
35+
"idiom" : "iphone",
36+
"filename" : "[email protected]",
37+
"scale" : "2x"
38+
},
39+
{
40+
"size" : "40x40",
41+
"idiom" : "iphone",
42+
"filename" : "[email protected]",
43+
"scale" : "3x"
44+
},
45+
{
46+
"size" : "60x60",
47+
"idiom" : "iphone",
48+
"filename" : "[email protected]",
49+
"scale" : "2x"
50+
},
51+
{
52+
"size" : "60x60",
53+
"idiom" : "iphone",
54+
"filename" : "[email protected]",
55+
"scale" : "3x"
56+
},
57+
{
58+
"size" : "20x20",
59+
"idiom" : "ipad",
60+
"filename" : "icon-20.png",
61+
"scale" : "1x"
62+
},
63+
{
64+
"size" : "20x20",
65+
"idiom" : "ipad",
66+
"filename" : "[email protected]",
67+
"scale" : "2x"
68+
},
69+
{
70+
"size" : "29x29",
71+
"idiom" : "ipad",
72+
"filename" : "icon-29.png",
73+
"scale" : "1x"
74+
},
75+
{
76+
"size" : "29x29",
77+
"idiom" : "ipad",
78+
"filename" : "[email protected]",
79+
"scale" : "2x"
80+
},
81+
{
82+
"size" : "40x40",
83+
"idiom" : "ipad",
84+
"filename" : "icon-40.png",
85+
"scale" : "1x"
86+
},
87+
{
88+
"size" : "40x40",
89+
"idiom" : "ipad",
90+
"filename" : "[email protected]",
91+
"scale" : "2x"
92+
},
93+
{
94+
"size" : "76x76",
95+
"idiom" : "ipad",
96+
"filename" : "icon-76.png",
97+
"scale" : "1x"
98+
},
99+
{
100+
"size" : "76x76",
101+
"idiom" : "ipad",
102+
"filename" : "[email protected]",
103+
"scale" : "2x"
104+
},
105+
{
106+
"size" : "83.5x83.5",
107+
"idiom" : "ipad",
108+
"filename" : "[email protected]",
109+
"scale" : "2x"
110+
},
111+
{
112+
"size" : "1024x1024",
113+
"idiom" : "ios-marketing",
114+
"filename" : "icon-1024.png",
115+
"scale" : "1x"
116+
}
117+
],
118+
"info" : {
119+
"version" : 1,
120+
"author" : "xcode"
121+
}
122+
}

0 commit comments

Comments
 (0)