Skip to content

Commit e9b5eb9

Browse files
committed
chore: cleanup a11y and add demo page
1 parent f088ddc commit e9b5eb9

17 files changed

Lines changed: 52 additions & 11 deletions

apps/toolbox/src/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,8 @@ components that have the btn class name.
182182
.list-group .list-group-item-heading {
183183
margin-bottom: 5
184184
}
185+
186+
.a11y-item {
187+
margin-bottom: 12;
188+
font-size: 18;
189+
}

apps/toolbox/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<Button text="list-page" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
1010
<Button text="box-shadow" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
1111
<Button text="root-layout" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
12+
<Button text="a11y" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
1213
</StackLayout>
1314
</ScrollView>
1415
</StackLayout>

apps/toolbox/src/main-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Observable, Frame, StackLayout } from '@nativescript/core';
33
export class HelloWorldModel extends Observable {
44
viewDemo(args) {
55
Frame.topmost().navigate({
6-
moduleName: `${args.object.text}`,
6+
moduleName: `pages/${args.object.text}`,
77
});
88
}
99
}

apps/toolbox/src/pages/a11y.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
3+
export function navigatingTo(args: EventData) {
4+
const page = <Page>args.object;
5+
page.bindingContext = new AccessibilityModel();
6+
}
7+
8+
export class AccessibilityModel extends Observable {}

apps/toolbox/src/pages/a11y.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
2+
<Page.actionBar>
3+
<ActionBar title="a11y" icon="" class="action-bar">
4+
</ActionBar>
5+
</Page.actionBar>
6+
7+
<GridLayout padding="20">
8+
<ScrollView>
9+
<StackLayout>
10+
<Label text="Accessible Label" class="a11y-item text-center"></Label>
11+
<Button text="Accessible Button" class="a11y-item"></Button>
12+
<!-- <Label text="Accessible Label" accessible="true" class="a11y-item text-center"></Label>
13+
<Button text="Accessible Button" accessible="true" class="a11y-item"></Button> -->
14+
</StackLayout>
15+
</ScrollView>
16+
</GridLayout>
17+
</Page>

0 commit comments

Comments
 (0)