mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup a11y and add demo page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -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}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
8
apps/toolbox/src/pages/a11y.ts
Normal file
8
apps/toolbox/src/pages/a11y.ts
Normal 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 {}
|
||||
17
apps/toolbox/src/pages/a11y.xml
Normal file
17
apps/toolbox/src/pages/a11y.xml
Normal 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>
|
||||
Reference in New Issue
Block a user