├── .editorconfig ├── .eslintrc ├── .github └── issue_template.md ├── .gitignore ├── .npsrc ├── .prettierignore ├── .prettierrc ├── .prettierrc.json ├── .travis.yml ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── Notes.md ├── README.md ├── apps ├── demo-angular │ ├── .gitignore │ ├── nativescript.config.ts │ ├── package.json │ ├── references.d.ts │ ├── src │ │ ├── app-routing.module.ts │ │ ├── app.component.ts │ │ ├── app.css │ │ ├── app.module.ts │ │ ├── home.component.html │ │ ├── home.component.ts │ │ ├── main.ts │ │ └── plugin-demos │ │ │ ├── .gitkeep │ │ │ ├── nativescript-accessibility-ext.component.html │ │ │ ├── nativescript-accessibility-ext.component.ts │ │ │ └── nativescript-accessibility-ext.module.ts │ ├── tsconfig.json │ └── webpack.config.js └── demo │ ├── .gitignore │ ├── nativescript.config.ts │ ├── package.json │ ├── references.d.ts │ ├── src │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ └── plugin-demos │ │ ├── .gitkeep │ │ ├── nativescript-accessibility-ext.ts │ │ └── nativescript-accessibility-ext.xml │ └── tsconfig.json ├── jest.config.js ├── nx.json ├── package-lock.json ├── package.json ├── packages ├── .gitkeep └── nativescript-accessibility-ext │ ├── Angular.md │ ├── FontScaling.md │ ├── Notes.md │ ├── README.md │ ├── angular │ ├── data │ │ ├── a11y-font-scaling.ts │ │ └── a11y-service-enabled.ts │ ├── directives │ │ └── a11y-grid-layout.directive.ts │ ├── index.ts │ ├── package.json │ ├── pipes │ │ └── a11y-font-scaling.pipe.ts │ ├── services │ │ └── base.service.ts │ └── tsconfig.angular.json │ ├── index.ts │ ├── package.json │ ├── references.d.ts │ ├── scss │ ├── _fontscales.scss │ ├── a11y-helpers.scss │ ├── a11y.compat.scss │ ├── a11y.scss │ └── core │ │ ├── _controls.scss │ │ ├── _headings.scss │ │ ├── _index.scss │ │ ├── _utilities.scss │ │ └── utilities │ │ ├── _index.scss │ │ └── _text.scss │ ├── trace.ts │ ├── tsconfig.json │ ├── ui │ ├── action-bar │ │ ├── action-bar.android.ts │ │ ├── action-bar.d.ts │ │ └── action-bar.ios.ts │ ├── core │ │ ├── view-common.ts │ │ ├── view.android.ts │ │ ├── view.d.ts │ │ └── view.ios.ts │ ├── css-classes-helper.ts │ ├── index.ts │ ├── page │ │ ├── page-common.ts │ │ ├── page.android.ts │ │ ├── page.d.ts │ │ └── page.ios.ts │ └── slider │ │ ├── slider-common.ts │ │ ├── slider.android.ts │ │ ├── slider.d.ts │ │ └── slider.ios.ts │ └── utils │ ├── accessibility-helper.android.ts │ ├── accessibility-helper.d.ts │ ├── accessibility-helper.ios.ts │ ├── fontscale-observable.android.ts │ ├── fontscale-observable.d.ts │ ├── fontscale-observable.ios.ts │ ├── global-events.ts │ ├── helpers.ts │ ├── index.ts │ ├── utils-common.ts │ ├── utils.android.ts │ ├── utils.d.ts │ └── utils.ios.ts ├── references.d.ts ├── tools ├── assets │ ├── App_Resources │ │ ├── Android │ │ │ ├── app.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-1024.png │ │ │ │ ├── icon-20.png │ │ │ │ ├── icon-20@2x.png │ │ │ │ ├── icon-20@3x.png │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ └── LaunchScreen-AspectFill@3x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ └── LaunchScreen-Center@3x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ ├── build.xcconfig │ │ │ ├── icon.png │ │ │ └── icon@2x.png │ ├── README.md │ └── publishing │ │ └── .npmignore ├── demo │ ├── index.ts │ ├── nativescript-accessibility-ext │ │ └── index.ts │ ├── references.d.ts │ ├── tsconfig.json │ └── utils │ │ ├── demo-base.ts │ │ └── index.ts ├── schematics │ └── .gitkeep ├── scripts │ └── build-finish.ts ├── tsconfig.tools.json └── workspace-scripts.js ├── tsconfig.base.json └── workspace.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 2018, 6 | "sourceType": "module", 7 | "project": "./tsconfig.base.json" 8 | }, 9 | "ignorePatterns": ["**/*"], 10 | "plugins": ["@typescript-eslint", "@nrwl/nx"], 11 | "extends": [ 12 | "eslint:recommended", 13 | "plugin:@typescript-eslint/eslint-recommended", 14 | "plugin:@typescript-eslint/recommended", 15 | "prettier", 16 | "prettier/@typescript-eslint" 17 | ], 18 | "rules": { 19 | "@typescript-eslint/explicit-member-accessibility": "off", 20 | "@typescript-eslint/explicit-function-return-type": "off", 21 | "@typescript-eslint/no-parameter-properties": "off", 22 | "@nrwl/nx/enforce-module-boundaries": [ 23 | "error", 24 | { 25 | "enforceBuildableLibDependency": true, 26 | "allow": [], 27 | "depConstraints": [ 28 | { "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] } 29 | ] 30 | } 31 | ] 32 | }, 33 | "overrides": [ 34 | { 35 | "files": ["*.tsx"], 36 | "rules": { 37 | "@typescript-eslint/no-unused-vars": "off" 38 | } 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Make sure to check the demo app(s) for sample usage 2 | 3 | ### Make sure to check the existing issues in this repository 4 | 5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it 6 | Please, ensure your title is less than 63 characters long and starts with a capital 7 | letter. 8 | 9 | ### Which platform(s) does your issue occur on? 10 | - iOS/Android/Both 11 | - iOS/Android versions 12 | - emulator or device. What type of device? 13 | 14 | ### Please, provide the following version numbers that your issue occurs with: 15 | 16 | - CLI: (run `tns --version` to fetch it) 17 | - Cross-platform modules: (check the 'version' attribute in the 18 | `node_modules/tns-core-modules/package.json` file in your project) 19 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project) 20 | - Plugin(s): (look for the version numbers in the `package.json` file of your 21 | project and paste your dependencies and devDependencies here) 22 | 23 | ### Please, tell us how to recreate the issue in as much detail as possible. 24 | Describe the steps to reproduce it. 25 | 26 | ### Is there any code involved? 27 | - provide a code example to recreate the problem 28 | - (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible. 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | node_modules 10 | package-lock.json 11 | yarn.lock 12 | 13 | # IDEs and editors 14 | /.idea 15 | .project 16 | .classpath 17 | .c9/ 18 | *.launch 19 | .settings/ 20 | *.sublime-workspace 21 | 22 | # IDE - VSCode 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | 29 | # misc 30 | /.sass-cache 31 | /connect.lock 32 | /coverage 33 | /libpeerconnection.log 34 | npm-debug.log 35 | yarn-error.log 36 | testem.log 37 | /typings 38 | 39 | # System Files 40 | .DS_Store 41 | Thumbs.db 42 | 43 | *.tgz 44 | packages/**/angular/dist 45 | -------------------------------------------------------------------------------- /.npsrc: -------------------------------------------------------------------------------- 1 | { 2 | "config": "./tools/workspace-scripts.js" 3 | } -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | native-src 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSpacing": true, 4 | "printWidth": 160, 5 | "semi": true, 6 | "singleQuote": true, 7 | "tabWidth": 2, 8 | "trailingComma": "all" 9 | } 10 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSpacing": true, 4 | "printWidth": 160, 5 | "semi": true, 6 | "singleQuote": true, 7 | "tabWidth": 2, 8 | "trailingComma": "all" 9 | } 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" 4 | script: 5 | - npm run setup 6 | - npm start @nota.build-all 7 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch on iOS", 9 | "type": "nativescript", 10 | "request": "launch", 11 | "platform": "ios", 12 | "appRoot": "${workspaceRoot}/demo", 13 | "sourceMaps": true, 14 | "watch": true 15 | }, 16 | { 17 | "name": "Test on iOS", 18 | "type": "nativescript", 19 | "request": "launch", 20 | "platform": "ios", 21 | "appRoot": "${workspaceRoot}/demo", 22 | "sourceMaps": true, 23 | "watch": false, 24 | "stopOnEntry": true, 25 | "launchTests": true, 26 | "tnsArgs": [ 27 | "--justlaunch" 28 | ] 29 | }, 30 | { 31 | "name": "Attach on iOS", 32 | "type": "nativescript", 33 | "request": "attach", 34 | "platform": "ios", 35 | "appRoot": "${workspaceRoot}/demo", 36 | "sourceMaps": true, 37 | "watch": false 38 | }, 39 | { 40 | "name": "Launch on Android", 41 | "type": "nativescript", 42 | "request": "launch", 43 | "platform": "android", 44 | "appRoot": "${workspaceRoot}/demo", 45 | "sourceMaps": true, 46 | "watch": true 47 | }, 48 | { 49 | "name": "Test on Android", 50 | "type": "nativescript", 51 | "request": "launch", 52 | "platform": "android", 53 | "appRoot": "${workspaceRoot}/demo", 54 | "sourceMaps": true, 55 | "watch": false, 56 | "stopOnEntry": true, 57 | "launchTests": true, 58 | "tnsArgs": [ 59 | "--justlaunch" 60 | ] 61 | }, 62 | { 63 | "name": "Attach on Android", 64 | "type": "nativescript", 65 | "request": "attach", 66 | "platform": "android", 67 | "appRoot": "${workspaceRoot}/demo", 68 | "sourceMaps": true, 69 | "watch": false 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]":{ 3 | "editor.formatOnSave": true 4 | }, 5 | "files.exclude": { 6 | "**/platforms": true, 7 | "**/node_modules": true, 8 | "**/.git": true, 9 | "**/.svn": true, 10 | "**/.hg": true, 11 | "**/CVS": true, 12 | "**/.DS_Store": true, 13 | "**/*.js": { 14 | "when": "$(basename).ts" 15 | }, 16 | "**/*.css": { 17 | "when": "$(basename).scss" 18 | }, 19 | "src/css": true 20 | }, 21 | "search.exclude": { 22 | "{demo-ng,demo}/platforms/**": true, 23 | "{demo-ng,demo}/platforms/**/*": true, 24 | "**/node_modules": true, 25 | "**/bower_components": true 26 | }, 27 | "files.watcherExclude": { 28 | "**/.git/objects/**": true, 29 | "**/.git/subtree-cache/**": true, 30 | "{demo-ng,demo}/platforms/**": true, 31 | "{demo-ng,demo}/platforms/**/*": true, 32 | "**/node_modules/**": true, 33 | "**/node_modules/**/*": true 34 | }, 35 | "cSpell.words": [ 36 | "Alcácer", 37 | "Aleix", 38 | "Arda", 39 | "Bitmask", 40 | "Cillessen", 41 | "Codegen", 42 | "Combobox", 43 | "Digne", 44 | "Flexbox", 45 | "Focusable", 46 | "Freiling", 47 | "Gomes", 48 | "Iniesta", 49 | "Jordi", 50 | "Mascherano", 51 | "Masip", 52 | "Mathieu", 53 | "Messi", 54 | "Morten", 55 | "Newable", 56 | "Neymar", 57 | "Paco", 58 | "Rafinha", 59 | "Rakitic", 60 | "Recycler", 61 | "Sergi", 62 | "Sjøgren", 63 | "Stegen", 64 | "Umtiti", 65 | "Unscoped", 66 | "androidview", 67 | "androidx", 68 | "appcompat", 69 | "armeabi", 70 | "assistive", 71 | "ayfs", 72 | "bootstrapper", 73 | "codelyzer", 74 | "compat", 75 | "ddfreiling", 76 | "devkit", 77 | "devtool", 78 | "downlevel", 79 | "fontscale", 80 | "fontscales", 81 | "globalevents", 82 | "gmail", 83 | "inputmethodservice", 84 | "mabs", 85 | "moduleid", 86 | "nativescript", 87 | "ngfactory", 88 | "ngmodule", 89 | "ngstyle", 90 | "ngtools", 91 | "nospace", 92 | "nsconfig", 93 | "oraclejdk", 94 | "pathinfo", 95 | "prettierrc", 96 | "quotemark", 97 | "radiobtn", 98 | "radiobutton", 99 | "ruleset", 100 | "sasswatch", 101 | "selectable", 102 | "sidedrawer", 103 | "softnav", 104 | "toplevel", 105 | "tscwatch", 106 | "uglifyjs", 107 | "weblink", 108 | "xcode", 109 | "ydemo" 110 | ] 111 | } 112 | -------------------------------------------------------------------------------- /Notes.md: -------------------------------------------------------------------------------- 1 | # Implementing iOS accessibility features 2 | 3 | On iOS certain accessibility features requires us to define functions to the Native-objects. 4 | 5 | ## Functions: 6 | 7 | ### accessibilityActivate() 8 | Tells the element to activate itself and report the success or failure of the operation. 9 | 10 | ### accessibilityIncrement() 11 | Tells the accessibility element to increment the value of its content. 12 | 13 | User action: A one-finger swipe up that increments a value in an element. 14 | 15 | ### accessibilityDecrement() 16 | Tells the accessibility element to decrement the value of its content. 17 | 18 | User action: A one-finger swipe down that decrements a value in an element. 19 | 20 | ### accessibilityScroll(UIAccessibilityScrollDirection) 21 | Scrolls screen content in an application-specific way and returns the success or failure of the action. 22 | 23 | User action: A three-finger swipe that scrolls content vertically or horizontally. 24 | 25 | ### accessibilityPerformEscape() 26 | Dismisses a modal view and returns the success or failure of the action. 27 | 28 | User action: A two-finger Z-shaped gesture that dismisses a modal dialog, or goes back one level in a navigation hierarchy. 29 | Returns true, if we're handling the escape. 30 | Dev note: Unlike **accessibilityPerformMagicTap()** this cannot be added to the AppDelegate in NativeScript. 31 | 32 | ### accessibilityPerformMagicTap() 33 | Performs a salient action. 34 | 35 | User action: A two-finger double-tap that performs the most-intended action. 36 | This could be play/pause in an audio-player or pick/hang up in a phone-app. 37 | Dev note: Can be added to the AppDelegate in NativeScript. 38 | 39 | ## Links 40 | https://developer.apple.com/documentation/uikit/accessibility/uiaccessibilityaction 41 | https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/SupportingAccessibility.html 42 | -------------------------------------------------------------------------------- /apps/demo-angular/.gitignore: -------------------------------------------------------------------------------- 1 | hooks 2 | platforms -------------------------------------------------------------------------------- /apps/demo-angular/nativescript.config.ts: -------------------------------------------------------------------------------- 1 | import { NativeScriptConfig } from '@nativescript/core'; 2 | 3 | export default { 4 | id: 'org.nativescript.plugindemoangular', 5 | appResourcesPath: '../../tools/assets/App_Resources', 6 | android: { 7 | v8Flags: '--expose_gc', 8 | markingMode: 'none', 9 | }, 10 | appPath: 'src', 11 | } as NativeScriptConfig; 12 | -------------------------------------------------------------------------------- /apps/demo-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "main.js", 3 | "dependencies": { 4 | "@angular/animations": "file:../../node_modules/@angular/animations", 5 | "@angular/common": "file:../../node_modules/@angular/common", 6 | "@angular/compiler": "file:../../node_modules/@angular/compiler", 7 | "@angular/core": "file:../../node_modules/@angular/core", 8 | "@angular/forms": "file:../../node_modules/@angular/forms", 9 | "@angular/platform-browser": "file:../../node_modules/@angular/platform-browser", 10 | "@angular/platform-browser-dynamic": "file:../../node_modules/@angular/platform-browser-dynamic", 11 | "@angular/router": "file:../../node_modules/@angular/router", 12 | "@nativescript/angular": "file:../../node_modules/@nativescript/angular", 13 | "@nativescript/core": "file:../../node_modules/@nativescript/core", 14 | "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core", 15 | "reflect-metadata": "file:../../node_modules/reflect-metadata", 16 | "rxjs": "file:../../node_modules/rxjs", 17 | "zone.js": "file:../../node_modules/zone.js", 18 | "@nota/nativescript-accessibility-ext": "file:../../dist/packages/nativescript-accessibility-ext" 19 | }, 20 | "devDependencies": { 21 | "@angular/compiler-cli": "file:../../node_modules/@angular/compiler-cli", 22 | "@nativescript/android": "~7.0.0", 23 | "@nativescript/ios": "7.2.0", 24 | "@nativescript/webpack": "~4.1.0", 25 | "@ngtools/webpack": "file:../../node_modules/@ngtools/webpack", 26 | "typescript": "file:../../node_modules/typescript" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /apps/demo-angular/references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /apps/demo-angular/src/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes } from '@angular/router'; 3 | import { NativeScriptRouterModule } from '@nativescript/angular'; 4 | 5 | import { HomeComponent } from './home.component'; 6 | 7 | const routes: Routes = [ 8 | { path: '', redirectTo: '/home', pathMatch: 'full' }, 9 | { path: 'home', component: HomeComponent }, 10 | { 11 | path: 'nativescript-accessibility-ext', 12 | loadChildren: () => import('./plugin-demos/nativescript-accessibility-ext.module').then((m) => m.NativescriptAccessibilityExtModule), 13 | }, 14 | ]; 15 | 16 | @NgModule({ 17 | imports: [NativeScriptRouterModule.forRoot(routes)], 18 | exports: [NativeScriptRouterModule], 19 | }) 20 | export class AppRoutingModule {} 21 | -------------------------------------------------------------------------------- /apps/demo-angular/src/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-app', 5 | template: ` 6 | 7 | `, 8 | }) 9 | export class AppComponent {} 10 | -------------------------------------------------------------------------------- /apps/demo-angular/src/app.css: -------------------------------------------------------------------------------- 1 | @import '~nativescript-theme-core/css/core.light.css'; 2 | @import url('~@nota/nativescript-accessibility-ext/css/a11y.css'); 3 | 4 | button, 5 | label, 6 | stack-layout { 7 | horizontal-align: center; 8 | } 9 | 10 | button { 11 | font-size: 36; 12 | } 13 | 14 | .title { 15 | font-size: 30; 16 | margin: 20; 17 | } 18 | 19 | .message { 20 | font-size: 20; 21 | color: #284848; 22 | text-align: center; 23 | margin: 0 20; 24 | } 25 | -------------------------------------------------------------------------------- /apps/demo-angular/src/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; 2 | import { Trace } from '@nativescript/core'; 3 | import { NativeScriptModule } from '@nativescript/angular'; 4 | import { NotaAccessibilityExtModule } from '@nota/nativescript-accessibility-ext/angular'; 5 | import { categories } from '@nota/nativescript-accessibility-ext/trace'; 6 | 7 | import { AppComponent } from './app.component'; 8 | import { AppRoutingModule } from './app-routing.module'; 9 | import { HomeComponent } from './home.component'; 10 | 11 | Trace.setCategories(categories.FontScale); 12 | Trace.enable(); 13 | 14 | @NgModule({ 15 | schemas: [NO_ERRORS_SCHEMA], 16 | declarations: [AppComponent, HomeComponent], 17 | bootstrap: [AppComponent], 18 | imports: [NativeScriptModule, AppRoutingModule, NotaAccessibilityExtModule], 19 | }) 20 | export class AppModule {} 21 | -------------------------------------------------------------------------------- /apps/demo-angular/src/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /apps/demo-angular/src/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-home', 5 | templateUrl: 'home.component.html', 6 | }) 7 | export class HomeComponent { 8 | demos = [ 9 | { 10 | name: 'nativescript-accessibility-ext', 11 | }, 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /apps/demo-angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformNativeScriptDynamic } from '@nativescript/angular'; 2 | import { AppModule } from './app.module'; 3 | 4 | platformNativeScriptDynamic().bootstrapModule(AppModule); 5 | -------------------------------------------------------------------------------- /apps/demo-angular/src/plugin-demos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-accessibility-ext/889a90c4b6295f13c594b949f4357e38a385dfdb/apps/demo-angular/src/plugin-demos/.gitkeep -------------------------------------------------------------------------------- /apps/demo-angular/src/plugin-demos/nativescript-accessibility-ext.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /apps/demo-angular/src/plugin-demos/nativescript-accessibility-ext.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgZone } from '@angular/core'; 2 | import { DemoSharedNativescriptAccessibilityExt } from '@demo/shared'; 3 | import {} from '@nota/nativescript-accessibility-ext'; 4 | 5 | @Component({ 6 | selector: 'demo-nativescript-accessibility-ext', 7 | templateUrl: 'nativescript-accessibility-ext.component.html', 8 | styles: [ 9 | ` 10 | .screen-reader { 11 | border-width: 1; 12 | border-radius: 10; 13 | padding: 10; 14 | margin: 0 10; 15 | 16 | Label { 17 | a11y-role: header; 18 | } 19 | } 20 | 21 | ListView { 22 | .list-view-item { 23 | orientation: horizontal; 24 | a11y-enabled: true; 25 | a11y-role: button; 26 | 27 | &.odd { 28 | a11y-role: switch; 29 | a11y-state: checked; 30 | } 31 | } 32 | } 33 | `, 34 | ], 35 | }) 36 | export class NativescriptAccessibilityExtComponent { 37 | demoShared: DemoSharedNativescriptAccessibilityExt; 38 | 39 | constructor(private _ngZone: NgZone) { 40 | this.demoShared = new DemoSharedNativescriptAccessibilityExt(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /apps/demo-angular/src/plugin-demos/nativescript-accessibility-ext.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; 2 | import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular'; 3 | import { NativescriptAccessibilityExtComponent } from './nativescript-accessibility-ext.component'; 4 | 5 | @NgModule({ 6 | imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptAccessibilityExtComponent }])], 7 | declarations: [NativescriptAccessibilityExtComponent], 8 | schemas: [NO_ERRORS_SCHEMA], 9 | }) 10 | export class NativescriptAccessibilityExtModule {} 11 | -------------------------------------------------------------------------------- /apps/demo-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "rootDirs": [".", "../.."], 5 | "baseUrl": ".", 6 | "paths": { 7 | "~/*": ["src/*"], 8 | "@nota/*": ["../../dist/packages/*"], 9 | "@demo/shared": ["../../tools/demo/index.ts"] 10 | } 11 | }, 12 | "files": ["./references.d.ts", "./src/main.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /apps/demo/.gitignore: -------------------------------------------------------------------------------- 1 | # NativeScript 2 | hooks/ 3 | node_modules/ 4 | platforms/ 5 | 6 | # NativeScript Template 7 | *.js.map 8 | *.js 9 | 10 | # Logs 11 | logs 12 | *.log 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # General 18 | .DS_Store 19 | .AppleDouble 20 | .LSOverride 21 | .idea 22 | .cloud 23 | .project 24 | tmp/ 25 | typings/ 26 | 27 | # misc 28 | npm-debug.log 29 | 30 | # app 31 | !*.d.ts 32 | !src/assets/fontawesome.min.css 33 | /report/ 34 | .nsbuildinfo 35 | /temp/ 36 | /src/tns_modules/ 37 | 38 | # app uses platform specific scss which can inadvertently get renamed which will cause problems 39 | app/app.scss 40 | 41 | package-lock.json 42 | -------------------------------------------------------------------------------- /apps/demo/nativescript.config.ts: -------------------------------------------------------------------------------- 1 | import { NativeScriptConfig } from '@nativescript/core'; 2 | 3 | export default { 4 | id: 'org.nativescript.plugindemo', 5 | appResourcesPath: '../../tools/assets/App_Resources', 6 | android: { 7 | v8Flags: '--expose_gc', 8 | markingMode: 'none', 9 | }, 10 | appPath: 'src', 11 | } as NativeScriptConfig; 12 | -------------------------------------------------------------------------------- /apps/demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "app.js", 3 | "description": "NativeScript Application", 4 | "license": "SEE LICENSE IN ", 5 | "repository": "", 6 | "dependencies": { 7 | "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core", 8 | "@nativescript/core": "file:../../node_modules/@nativescript/core", 9 | "@nota/nativescript-accessibility-ext": "file:../../packages/nativescript-accessibility-ext" 10 | }, 11 | "devDependencies": { 12 | "@nativescript/android": "~7.0.0", 13 | "@nativescript/ios": "7.2.0", 14 | "@nativescript/webpack": "~4.1.0", 15 | "typescript": "file:../../node_modules/typescript" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apps/demo/references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /apps/demo/src/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /apps/demo/src/app.css: -------------------------------------------------------------------------------- 1 | @import '~nativescript-theme-core/css/core.light.css'; 2 | -------------------------------------------------------------------------------- /apps/demo/src/app.ts: -------------------------------------------------------------------------------- 1 | import { Application } from '@nativescript/core'; 2 | 3 | Application.run({ moduleName: 'app-root' }); 4 | -------------------------------------------------------------------------------- /apps/demo/src/main-page.ts: -------------------------------------------------------------------------------- 1 | import { EventData, Page } from '@nativescript/core'; 2 | import { MainViewModel } from './main-view-model'; 3 | 4 | export function navigatingTo(args: EventData) { 5 | const page = args.object; 6 | page.bindingContext = new MainViewModel(); 7 | } 8 | -------------------------------------------------------------------------------- /apps/demo/src/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |