Skip to content

Commit a604838

Browse files
committed
demo: update
1 parent 01c9f81 commit a604838

File tree

12 files changed

+117
-33
lines changed

12 files changed

+117
-33
lines changed

demo-vue/app/App_Resources/Android/app.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
//}
77

88
android {
9+
compileSdkVersion 33
910
defaultConfig {
1011
generatedDensities = []
12+
targetSdkVersion 33
1113

1214
//override supported platforms
1315
// ndk {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
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" android:exported="true">
3333

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

@@ -38,6 +38,6 @@
3838
<category android:name="android.intent.category.LAUNCHER" />
3939
</intent-filter>
4040
</activity>
41-
<activity android:name="com.tns.ErrorReportActivity"/>
41+
<activity android:name="com.tns.ErrorReportActivity" android:exported="false"/>
4242
</application>
4343
</manifest>

demo-vue/app/App_Resources/Android/src/main/res/values/styles.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<resources xmlns:android="http://schemas.android.com/apk/res/android">
33

44
<!-- theme to use FOR launch screen-->
5-
<style name="LaunchScreenThemeBase" parent="Theme.MaterialComponents.Light.NoActionBar">
5+
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
66
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
77

88
<item name="colorPrimary">@color/ns_primary</item>
@@ -20,7 +20,7 @@
2020
</style>
2121

2222
<!-- theme to use AFTER launch screen is loaded-->
23-
<style name="AppThemeBase" parent="Theme.MaterialComponents.Light.NoActionBar">
23+
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
2424
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
2525

2626
<item name="colorPrimary">@color/ns_primary</item>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
platform :ios, '12.0'
2+
post_install do |installer|
3+
installer.pods_project.targets.each do |target|
4+
target.build_configurations.each do |config|
5+
config.build_settings[ 'IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
6+
end
7+
end
8+
end

demo-vue/app/App_Resources/iOS/build.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
66
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
77
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8+
IPHONEOS_DEPLOYMENT_TARGET = 12.0

demo-vue/app/examples/AutoSize.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</template>
2424

2525
<script lang="ts">
26-
import * as frameModule from '@nativescript/core/ui/frame';
26+
import { Frame } from '@nativescript/core';
2727
import Vue from 'vue';
2828
2929
export const title = 'verticalAlignment sample';
@@ -36,7 +36,7 @@ export default Vue.extend({
3636
},
3737
methods: {
3838
onNavigationButtonTap() {
39-
frameModule.topmost().goBack();
39+
Frame.topmost().goBack();
4040
},
4141
resize(event) {
4242
event.object.width = 100;

demo-vue/app/examples/LinkTap.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<Page>
3+
<ActionBar :title="title">
4+
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap"></NavigationButton>
5+
</ActionBar>
6+
<ScrollView>
7+
<StackLayout>
8+
<!-- Label with text align left (right will also do) -->
9+
<!-- Set full width or height to test tap outside bounds -->
10+
<HTMLLabel textAlignment="left" width="100%" marginBottom="50">
11+
<Span text="Click to open link" @linkTap="openLink">
12+
</Span>
13+
</HTMLLabel>
14+
15+
<!-- Centered label with multiple lines -->
16+
<HTMLLabel textAlignment="center" textWrap="true">
17+
<Span text="I am a paragraph with looots of words that wastes your time reading because I'm a humble little sample. If you are brave enough to lose more time, click this">
18+
</Span>
19+
<Span text=" link" @linkTap="openLink">
20+
</Span>
21+
</HTMLLabel>
22+
23+
</StackLayout>
24+
</ScrollView>
25+
26+
27+
</Page>
28+
</template>
29+
30+
<script lang="ts">
31+
import { Frame } from '@nativescript/core';
32+
import Vue from 'vue';
33+
34+
export const title = 'LinkTap sample';
35+
36+
export default Vue.extend({
37+
data() {
38+
return {
39+
title: title
40+
};
41+
},
42+
methods: {
43+
onNavigationButtonTap() {
44+
Frame.topmost().goBack();
45+
},
46+
openLink() {
47+
console.log('openLink')
48+
}
49+
}
50+
});
51+
</script>

demo-vue/app/examples/VerticalAlignment.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</template>
2525

2626
<script lang="ts">
27-
import * as frameModule from '@nativescript/core/ui/frame';
27+
import { Frame } from '@nativescript/core';
2828
import Vue from 'vue';
2929
3030
export const title = 'verticalAlignment sample';
@@ -37,7 +37,7 @@ export default Vue.extend({
3737
},
3838
methods: {
3939
onNavigationButtonTap() {
40-
frameModule.topmost().goBack();
40+
Frame.topmost().goBack();
4141
}
4242
}
4343
});

demo-vue/app/examples/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
import BaseDemo, { title as BaseDemoTitle } from './Base.vue';
22
import VerticalAlignment, { title as VerticalAlignmentTitle } from './VerticalAlignment.vue';
33
import AutoSize from './AutoSize.vue';
4+
import LinkTap from './LinkTap.vue';
45

56
export const getExamples = () => [
67
{
78
title: BaseDemoTitle,
89
component: BaseDemo
9-
},{
10+
},
11+
{
1012
title: VerticalAlignmentTitle,
1113
component: VerticalAlignment
12-
},{
14+
},
15+
{
1316
title: 'autoSize',
1417
component: AutoSize
18+
},
19+
{
20+
title: 'linkTap',
21+
component: LinkTap
1522
}
1623
];

demo-vue/app/main.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import Vue from 'nativescript-vue';
2-
import { overrideSpanAndFormattedString } from '@nativescript-community/text';
3-
overrideSpanAndFormattedString();
2+
// import { overrideSpanAndFormattedString } from '@nativescript-community/text';
3+
// overrideSpanAndFormattedString();
44
Vue.registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
5-
import * as views from './views/index';
5+
// import * as views from './views/index';
66

7-
Vue.component('Home', views.Home);
7+
// Vue.component('Home', views.Home);
8+
9+
// Vue.config.silent = true;
10+
// new Vue({
11+
// template: `
12+
// <Frame>
13+
// <Home />
14+
// </Frame>
15+
// `
16+
// }).$start();
17+
import Test from '~/views/Test.vue';
818

9-
Vue.config.silent = true;
1019
new Vue({
11-
template: `
12-
<Frame>
13-
<Home />
14-
</Frame>
15-
`
20+
render: (h) => h(Test)
1621
}).$start();

demo-vue/app/views/Home.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ export default Vue.extend({
5252
}
5353
},
5454
methods: {
55-
goToExample({ item }) {
55+
async goToExample({ item }) {
56+
console.log('goToExample', !!item.component)
57+
try {
5658
this.$navigateTo(item.component);
59+
60+
} catch (error) {
61+
console.error(error)
62+
}
5763
}
5864
}
5965
});

demo-vue/package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,30 @@
44
"readme": "README.md",
55
"main": "app/main",
66
"dependencies": {
7-
"@nativescript-community/text": "^1.4.28",
7+
"@akylas/nativescript": "8.3.6",
8+
"@nativescript-community/text": "^1.5.9",
89
"@nativescript-community/ui-label": "../plugin",
9-
"@nativescript/core": "8.0.8",
10-
"nativescript-vue": "~2.8.4"
10+
"@nativescript/core": "8.3.5",
11+
"nativescript-vue": "~2.9.3"
1112
},
1213
"devDependencies": {
1314
"@babel/core": "^7.13.10",
14-
"@nativescript/android": "7.0.1",
15-
"@nativescript/ios": "7.2.0",
15+
"@nativescript/android": "8.4.0-alpha.6",
16+
"@nativescript/ios": "6.5.5",
1617
"@nativescript/types": "7.3.0",
17-
"@nativescript/webpack": "5.0.4",
18-
"babel-loader": "^8.2.2",
19-
"nativescript-vue-template-compiler": "~2.8.4",
20-
"typescript": "^4.2.3",
21-
"vue": "^2.6.12",
18+
"@nativescript/webpack": "5.0.9",
19+
"babel-loader": "^8.2.5",
20+
"merge-options":"3.0.4",
21+
"nativescript-vue-template-compiler": "~2.9.3",
22+
"typescript": "4.7.4",
23+
"vue": "^2.7.13",
2224
"vue-i18n": "^8.22.2",
2325
"vue-loader": "~15.9.8",
24-
"vue-property-decorator": "^8.5.1"
26+
"vue-property-decorator": "^9.1.2"
2527
},
2628
"scripts": {
27-
"tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'"
29+
"tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'",
30+
"run.android.production": "devns run android --release --clean --key-store-path ./certs/upload.keystore --key-store-password nativescript --key-store-alias nativescript --key-store-alias-password nativescript",
31+
"run.android.timeline": "devns run android --config=nativescript.config.timeline.js --release --clean --key-store-path ./certs/upload.keystore --key-store-password nativescript --key-store-alias nativescript --key-store-alias-password nativescript --env.timeline"
2832
}
2933
}

0 commit comments

Comments
 (0)