Skip to content

Commit

Permalink
Feat: NS7 Support #38
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Sep 24, 2020
1 parent ceb3f33 commit 2fe477f
Show file tree
Hide file tree
Showing 15 changed files with 353 additions and 411 deletions.
66 changes: 50 additions & 16 deletions .travis.yml
@@ -1,29 +1,63 @@
matrix:
include:
- os: linux
language: android
- stage: "Lint"
language: node_js
os: linux
node_js: "10"
script: cd src && npm run ci.tslint
- stage: "WebPack, Build"
os: osx
env:
- WebPack="iOS"
osx_image: xcode11.2
language: node_js
node_js: "10"
jdk: oraclejdk8
before_script:
- echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
before_install:
- nvm install 6
before_script: pod repo update
script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify
- language: android
os: linux
env:
- WebPack="Android"
jdk: oraclejdk8
dist: trusty
before_install: nvm install 10
script: cd demo && npm run build.plugin && npm i && tns build android --bundle --env.uglify --env.snapshot
- language: android
env:
- BuildAndroid="28"
os: linux
jdk: oraclejdk8
dist: trusty
before_install: nvm install 10
script:
- npm run setup
- npm run tslint
- npm run demo.android
- cd src && npm i && npm run tsc && cd ../demo && tns build android
- os: osx
env:
- BuildiOS="12"
- Xcode="11.0"
osx_image: xcode11.2
language: node_js
node_js: "10"
jdk: oraclejdk8
before_script: pod repo update
script:
- cd src && npm i && npm run tsc && cd ../demo && tns build ios

android:
components:
- tools
- platform-tools
- build-tools-25.0.2
- android-25
- build-tools-28.0.3
- android-28
- extra-android-m2repository
- sys-img-armeabi-v7a-android-21

before_install:
- sudo pip install --upgrade pip
- sudo pip install six

install:
- echo no | npm install -g nativescript
- tns usage-reporting disable
- tns error-reporting disable
- echo no | npm install -g nativescript
- tns usage-reporting disable
- tns error-reporting disable
1 change: 1 addition & 0 deletions demo/app/app-root.xml
@@ -0,0 +1 @@
<Frame defaultPage="main-page"/>
3 changes: 2 additions & 1 deletion demo/app/app.css
@@ -1 +1,2 @@
@import '~nativescript-theme-core/css/core.light.css';
@import "~@nativescript/theme/css/core.css";
@import "~@nativescript/theme/css/default.css";
5 changes: 3 additions & 2 deletions demo/app/app.ts
@@ -1,2 +1,3 @@
import * as application from "tns-core-modules/application";
application.run({ moduleName: "main-page" });
import { Application } from "@nativescript/core";

Application.run({moduleName: "app-root"});
10 changes: 4 additions & 6 deletions demo/app/main-page.ts
@@ -1,10 +1,8 @@
import * as observable from "tns-core-modules/data/observable";
import * as pages from "tns-core-modules/ui/page";
import {HelloWorldModel} from "./main-view-model";
import { NavigatedData, Page } from "@nativescript/core";
import { HelloWorldModel } from "./main-view-model";

// Event handler for Page 'loaded' event attached in main-page.xml
export function pageLoaded(args: observable.EventData) {
export function navigatingTo(args: NavigatedData) {
// Get the event sender
let page = <pages.Page>args.object;
const page = <Page>args.object;
page.bindingContext = new HelloWorldModel();
}
8 changes: 4 additions & 4 deletions demo/app/main-page.xml
@@ -1,11 +1,11 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" class="page">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<StackLayout class="p-20">
<Label text="Speech Recognition" class="t-25 font-weight-bold text-center c-black" textWrap="true"/>
<!--<Label class="header" text="Search accessories not added to a Home, they'll be listed below" textWrap="true"/>-->
<StackLayout orientation="horizontal" horizontalAlignment="center">
<Button text="default" class="p-20" tap="{{ startListeningDefault }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="nl-NL" class="p-20" tap="{{ startListeningNL }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="en-US" class="p-20" tap="{{ startListeningEN }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="default" class="p-15" tap="{{ startListeningDefault }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="nl-NL" class="p-15" tap="{{ startListeningNL }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="en-US" class="p-15" tap="{{ startListeningEN }}" visibility="{{ listening ? 'collapse' : 'visible' }}"/>
<Button text="Stop" class="p-20" tap="{{ stopListening }}" visibility="{{ listening ? 'visible' : 'collapse' }}"/>
</StackLayout>
<Label style="border-radius: 8" class="m-10 p-15 t-15 text-center c-bg-charcoal c-white" text="{{ feedback }}" textWrap="true"/>
Expand Down
3 changes: 1 addition & 2 deletions demo/app/main-view-model.ts
@@ -1,5 +1,4 @@
import { Observable } from "tns-core-modules/data/observable";
import { isAndroid } from "tns-core-modules/platform";
import { Observable, isAndroid } from "@nativescript/core";
import { SpeechRecognition, SpeechRecognitionTranscription } from "nativescript-speech-recognition";

export class HelloWorldModel extends Observable {
Expand Down
105 changes: 0 additions & 105 deletions demo/app/package.json

This file was deleted.

10 changes: 10 additions & 0 deletions demo/nativescript.config.ts
@@ -0,0 +1,10 @@
import { NativeScriptConfig } from '@nativescript/core';

export default {
id: 'org.nativescript.plugin.speechrecognition',
appResourcesPath: 'app/App_Resources',
android: {
v8Flags: '--expose_gc',
markingMode: 'none',
}
} as NativeScriptConfig;
25 changes: 11 additions & 14 deletions demo/package.json
@@ -1,26 +1,23 @@
{
"nativescript": {
"id": "org.nativescript.plugin.speechrecognition",
"tns-ios": {
"version": "6.0.0-rc-2019-06-28-105002-01"
},
"tns-android": {
"version": "6.0.0-rc-2019-06-27-172817-03"
}
},
"dependencies": {
"nativescript-speech-recognition": "../src",
"nativescript-theme-core": "~1.0.6",
"@nativescript/theme": "~2.3.3",
"nativescript-unit-test-runner": "~0.6.4",
"tns-core-modules": "6.0.0-rc-2019-06-28-175837-02"
"@nativescript/core": "~7.0.5"
},
"devDependencies": {
"@nativescript/android": "7.0.0",
"@nativescript/ios": "7.0.0",
"@nativescript/types": "~7.0.4",
"@nativescript/webpack": "~3.0.4",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-webpack": "1.0.0-rc-2019-07-02-161545-02",
"tns-platform-declarations": "6.0.0-rc-2019-06-28-175837-02",
"typescript": "3.4.1"
"typescript": "~3.9.7"
},
"main": "app.js",
"scripts": {
"build.plugin": "cd ../src && npm run build"
}
}
13 changes: 8 additions & 5 deletions demo/tsconfig.json
@@ -1,17 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"target": "es2017",
"module": "esnext",
"moduleResolution": "node",
"declaration": false,
"removeComments": true,
"removeComments": false,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"lib": [
"es6",
"dom",
"es2015.iterable"
"es2015.iterable",
"es2017"
],
"pretty": true,
"allowUnreachableCode": false,
Expand All @@ -36,7 +38,8 @@
"~/*": [
"app/*"
]
}
},
"moduleResolution": "node"
},
"exclude": [
"node_modules",
Expand Down
7 changes: 0 additions & 7 deletions demo/tsconfig.tns.json

This file was deleted.

24 changes: 12 additions & 12 deletions publish/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2fe477f

Please sign in to comment.