Skip to content

Commit ce8d1ed

Browse files
committed
chore: demo
1 parent d8a2699 commit ce8d1ed

File tree

4 files changed

+115
-9
lines changed

4 files changed

+115
-9
lines changed

demo-snippets/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@nativescript-community/ui-collectionview-alignedflowlayout": "*",
88
"@nativescript-community/ui-collectionview-swipemenu": "*",
99
"@nativescript-community/ui-collectionview-waterfall": "*",
10+
"@nativescript-community/ui-label": "1.3.33",
1011
"@nativescript-community/ui-pulltorefresh": "*"
1112
}
1213
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<template>
2+
<Page>
3+
<ActionBar>
4+
<Label text="Font Size Change Test" />
5+
</ActionBar>
6+
7+
<GridLayout>
8+
<CollectionView ref="collectionView" :items="itemList" itemIdGenerator="color" @loaded="onCollectionViewLoaded">
9+
<v-template>
10+
<StackLayout row="1" class="item" :backgroundColor="item.color">
11+
<Label :iosAccessibilityAdjustsFontSize="true" row="1" :text="item.name" class="title" />
12+
<Label :iosAccessibilityAdjustsFontSize="true" row="1" :text="item.color" class="subtitle" />
13+
</StackLayout>
14+
</v-template>
15+
</CollectionView>
16+
</GridLayout>
17+
</Page>
18+
</template>
19+
20+
<script lang="ts">
21+
import { Application, ContentView, ObservableArray } from '@nativescript/core';
22+
import { CollectionView } from '@nativescript-community/ui-collectionview';
23+
export default {
24+
data() {
25+
const items = new ObservableArray([
26+
{ type: 'item', name: 'TURQUOISE', color: '#1abc9c' },
27+
{ type: 'item', name: 'EMERALD', color: '#2ecc71' },
28+
{ type: 'item', name: 'PETER RIVER', color: '#3498db' },
29+
{ type: 'item', name: 'AMETHYST', color: '#9b59b6' },
30+
{ type: 'item', name: 'GREEN SEA', color: '#16a085' },
31+
{ type: 'item', name: 'NEPHRITIS', color: '#27ae60' },
32+
{ type: 'item', name: 'BELIZE HOLE', color: '#2980b9' },
33+
{ type: 'item', name: 'ASBESTOS', color: '#7f8c8d' },
34+
{ type: 'item', name: 'MIDNIGHT BLUE', color: '#2c3e50' },
35+
{ type: 'item', name: 'SUN FLOWER', color: '#f1c40f' },
36+
{ type: 'item', name: 'CARROT', color: '#e67e22' },
37+
{ type: 'item', name: 'POMEGRANATE', color: '#c0392b' },
38+
{ type: 'item', name: 'CLOUDS', color: '#ecf0f1' },
39+
{ type: 'item', name: 'CONCRETE', color: '#95a5a6' },
40+
{ type: 'item', name: 'ORANGE', color: '#f39c12' },
41+
{ type: 'item', name: 'PUMPKIN', color: '#d35400' }
42+
]);
43+
return {
44+
itemList: items
45+
};
46+
},
47+
methods: {
48+
logEvent(e) {
49+
console.log('logEvent', e.eventName, e.extraData);
50+
},
51+
onCollectionViewLoaded(e) {
52+
const collectionView = e.object as CollectionView;
53+
Application.on('fontScaleChanged', () => {
54+
// console.error('fontScaleChanged', collectionView);
55+
56+
// Application.once('resume', () => {
57+
// console.error('resume', collectionView);
58+
// setTimeout(() => {
59+
// console.error('refreshVisibleItems', collectionView);
60+
collectionView.refreshVisibleItems();
61+
// },1000);
62+
// });
63+
});
64+
}
65+
}
66+
};
67+
</script>
68+
69+
<style scoped lang="scss">
70+
ActionBar {
71+
background-color: #42b883;
72+
}
73+
.item {
74+
padding: 10;
75+
color: white;
76+
.title {
77+
font-size: 17;
78+
font-weight: bold;
79+
}
80+
.subtitle {
81+
font-size: 14;
82+
}
83+
}
84+
</style>

demo-snippets/vue/install.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ import Reorder from './Reorder.vue';
1515
import SwipeMenu from './SwipeMenu.vue';
1616
import ResizeCell from './ResizeCell.vue';
1717
import AlignedGrid from './AlignedGrid.vue';
18+
import FontSizeChangeTest from './FontSizeChangeTest.vue';
1819

1920
export function installPlugin() {
2021
Vue.use(CollectionView);
2122
Vue.use(SwipeMenuPlugin);
23+
2224
installWaterfall();
2325
installAlignedLayout();
2426
}
2527

26-
Trace.addCategories(CollectionViewTraceCategory)
27-
Trace.enable()
28+
// Trace.addCategories(CollectionViewTraceCategory)
29+
// Trace.enable()
2830

2931
export const demos = [
3032
{ name: 'Simple Grid', path: 'simple-grid', component: SimpleGrid },
@@ -34,5 +36,6 @@ export const demos = [
3436
{ name: 'Reorder', path: 'reorder', component: Reorder },
3537
{ name: 'SwipeMenu', path: 'swipe-menu', component: SwipeMenu },
3638
{ name: 'ResizeCell', path: 'resize-cell', component: ResizeCell },
37-
{ name: 'AlignedGrid', path: 'AlignedGrid', component: AlignedGrid }
39+
{ name: 'AlignedGrid', path: 'AlignedGrid', component: AlignedGrid },
40+
{ name: 'FontSizeChangeTest', path: 'FontSizeChangeTest', component: FontSizeChangeTest }
3841
];

yarn.lock

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,14 +3413,15 @@ __metadata:
34133413

34143414
"@nativescript-community/template-snippet@file:demo-snippets::locator=root-workspace-0b6124%40workspace%3A.":
34153415
version: 0.0.1
3416-
resolution: "@nativescript-community/template-snippet@file:demo-snippets#demo-snippets::hash=00eb30&locator=root-workspace-0b6124%40workspace%3A."
3416+
resolution: "@nativescript-community/template-snippet@file:demo-snippets#demo-snippets::hash=6b91a2&locator=root-workspace-0b6124%40workspace%3A."
34173417
dependencies:
34183418
"@nativescript-community/ui-collectionview": "npm:*"
34193419
"@nativescript-community/ui-collectionview-alignedflowlayout": "npm:*"
34203420
"@nativescript-community/ui-collectionview-swipemenu": "npm:*"
34213421
"@nativescript-community/ui-collectionview-waterfall": "npm:*"
3422+
"@nativescript-community/ui-label": "npm:1.3.33"
34223423
"@nativescript-community/ui-pulltorefresh": "npm:*"
3423-
checksum: a972ae94d2a09dca2cc2988f5b65a0b22faba3540093efea88216ce31cd77303c96a273cae66f66e3ddbe5bf2dccdcf7e2fa941ce4db1b94812fa5368e7048d5
3424+
checksum: 34b5f66dde0a50598d515c921833d1ecc3520d5a6603f42a76295bbbdba77cc0c44507a8c1dc292b62cea0977a65eea4541324209e1ffe277f966e70b0aca0c0
34243425
languageName: node
34253426
linkType: hard
34263427

@@ -3432,15 +3433,23 @@ __metadata:
34323433
"@nativescript-community/ui-collectionview-alignedflowlayout": "npm:*"
34333434
"@nativescript-community/ui-collectionview-swipemenu": "npm:*"
34343435
"@nativescript-community/ui-collectionview-waterfall": "npm:*"
3436+
"@nativescript-community/ui-label": "npm:1.3.33"
34353437
"@nativescript-community/ui-pulltorefresh": "npm:*"
34363438
languageName: unknown
34373439
linkType: soft
34383440

3441+
"@nativescript-community/text@npm:^1.6.6":
3442+
version: 1.6.7
3443+
resolution: "@nativescript-community/text@npm:1.6.7"
3444+
checksum: 49fd2ee8ddadd010c4db40e75e6bbca26274131694f711e991ce4f9124fffe19cabb9dda5452bc911b8558575f220f18b30783cd85a54a47197e4718165dd45e
3445+
languageName: node
3446+
linkType: hard
3447+
34393448
"@nativescript-community/ui-collectionview-alignedflowlayout@npm:*, @nativescript-community/ui-collectionview-alignedflowlayout@workspace:packages/alignedflowlayout":
34403449
version: 0.0.0-use.local
34413450
resolution: "@nativescript-community/ui-collectionview-alignedflowlayout@workspace:packages/alignedflowlayout"
34423451
dependencies:
3443-
"@nativescript-community/ui-collectionview": "npm:^6.0.2"
3452+
"@nativescript-community/ui-collectionview": "npm:^6.0.3"
34443453
languageName: unknown
34453454
linkType: soft
34463455

@@ -3449,7 +3458,7 @@ __metadata:
34493458
resolution: "@nativescript-community/ui-collectionview-swipemenu@workspace:packages/swipemenu"
34503459
dependencies:
34513460
"@nativescript-community/class-mixins": "npm:^1.0.0"
3452-
"@nativescript-community/ui-collectionview": "npm:^6.0.2"
3461+
"@nativescript-community/ui-collectionview": "npm:^6.0.3"
34533462
"@nativescript-community/ui-drawer": "npm:^0.1.27"
34543463
languageName: unknown
34553464
linkType: soft
@@ -3458,11 +3467,11 @@ __metadata:
34583467
version: 0.0.0-use.local
34593468
resolution: "@nativescript-community/ui-collectionview-waterfall@workspace:packages/waterfall"
34603469
dependencies:
3461-
"@nativescript-community/ui-collectionview": "npm:^6.0.2"
3470+
"@nativescript-community/ui-collectionview": "npm:^6.0.3"
34623471
languageName: unknown
34633472
linkType: soft
34643473

3465-
"@nativescript-community/ui-collectionview@npm:*, @nativescript-community/ui-collectionview@npm:^6.0.2, @nativescript-community/ui-collectionview@workspace:packages/collectionview":
3474+
"@nativescript-community/ui-collectionview@npm:*, @nativescript-community/ui-collectionview@npm:^6.0.3, @nativescript-community/ui-collectionview@workspace:packages/collectionview":
34663475
version: 0.0.0-use.local
34673476
resolution: "@nativescript-community/ui-collectionview@workspace:packages/collectionview"
34683477
dependencies:
@@ -3479,6 +3488,15 @@ __metadata:
34793488
languageName: node
34803489
linkType: hard
34813490

3491+
"@nativescript-community/ui-label@npm:1.3.33":
3492+
version: 1.3.33
3493+
resolution: "@nativescript-community/ui-label@npm:1.3.33"
3494+
dependencies:
3495+
"@nativescript-community/text": "npm:^1.6.6"
3496+
checksum: 59b81896e6ca3bbb43b4429e6fe9b2ea1abd0850e9e43247dfea8da47658ec1654ff6d22e1b58a575be2e2e974aee23f8551bcb97112cbe02c94eb3d25645da1
3497+
languageName: node
3498+
linkType: hard
3499+
34823500
"@nativescript-community/ui-pulltorefresh@npm:*":
34833501
version: 2.5.3
34843502
resolution: "@nativescript-community/ui-pulltorefresh@npm:2.5.3"

0 commit comments

Comments
 (0)