chore: cleanup a11y and add demo page

This commit is contained in:
Nathan Walker
2021-03-02 19:49:51 -08:00
parent f088ddc3fc
commit e9b5eb934d
17 changed files with 52 additions and 11 deletions

View File

@@ -182,3 +182,8 @@ components that have the btn class name.
.list-group .list-group-item-heading {
margin-bottom: 5
}
.a11y-item {
margin-bottom: 12;
font-size: 18;
}

View File

@@ -9,6 +9,7 @@
<Button text="list-page" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
<Button text="box-shadow" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
<Button text="root-layout" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
<Button text="a11y" tap="{{ viewDemo }}" class="btn btn-primary btn-view-demo"/>
</StackLayout>
</ScrollView>
</StackLayout>

View File

@@ -3,7 +3,7 @@ import { Observable, Frame, StackLayout } from '@nativescript/core';
export class HelloWorldModel extends Observable {
viewDemo(args) {
Frame.topmost().navigate({
moduleName: `${args.object.text}`,
moduleName: `pages/${args.object.text}`,
});
}
}

View File

@@ -0,0 +1,8 @@
import { Observable, EventData, Page } from '@nativescript/core';
export function navigatingTo(args: EventData) {
const page = <Page>args.object;
page.bindingContext = new AccessibilityModel();
}
export class AccessibilityModel extends Observable {}

View File

@@ -0,0 +1,17 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<Page.actionBar>
<ActionBar title="a11y" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>
<GridLayout padding="20">
<ScrollView>
<StackLayout>
<Label text="Accessible Label" class="a11y-item text-center"></Label>
<Button text="Accessible Button" class="a11y-item"></Button>
<!-- <Label text="Accessible Label" accessible="true" class="a11y-item text-center"></Label>
<Button text="Accessible Button" accessible="true" class="a11y-item"></Button> -->
</StackLayout>
</ScrollView>
</GridLayout>
</Page>