This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 'master' view --> | |
<ActionBar></ActionBar> | |
<GridLayout [columns]="isTablet ? '*, *' : '*'"> | |
<StackLayout> | |
<!-- 'master' ListView --> | |
</StackLayout> | |
<StackLayout col="1" *ngIf="isTablet"> | |
<!-- 'detail-contents' component, only for tablets --> | |
<detail-contents></detail-contents> | |
</StackLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// required imports: | |
import { DeviceType } from "ui/enums"; | |
import { device } from "platform"; | |
// then wherever you need it: | |
const isTablet: boolean = device.deviceType === DeviceType.Tablet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Color } from "tns-core-modules/color"; | |
declare const UIControlStateSelected: any; | |
export class CheckoutComponent implements OnInit { | |
// this assumes you have this in your html: <SegmentedBar #paymentOptionsBar ..> | |
@ViewChild("paymentOptionsBar") paymentOptionsBar: ElementRef; | |
ngOnInit(): void { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class MyComponent implements AfterViewInit { | |
// assuming your view has this: <TextField #myTextField text="I have a red caret"></TextField> | |
@ViewChild("myTextField") myTextField: ElementRef; | |
ngAfterViewInit(): void { | |
// note that if you don't have iOS typings you can change 'UITextField' to 'any' | |
let textField: UITextField = (<TextField>this.myTextField.nativeElement).ios; | |
textField.tintColor = new Color("red").ios; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In case of Angular, this is the component that contains a view with a <RadSideDrawer> | |
export class MenuComponent implements AfterViewInit { | |
@ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent; | |
private _drawer: SideDrawerType; | |
ngAfterViewInit(): void { | |
this._drawer = this.drawerComponent.sideDrawer; | |
this._changeDetectionRef.detectChanges(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: <Label maxLines="3" .. /> | |
import { Directive, ElementRef, Input, OnInit, OnChanges } from '@angular/core'; | |
import { Label } from 'tns-core-modules/ui/label'; | |
declare const android, NSLineBreakMode: any; | |
@Directive({ | |
selector: 'Label[maxLines]', | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Speech recognition usage consent --> | |
<key>NSSpeechRecognitionUsageDescription</key> | |
<string>My custom recognition usage description. Overriding the default empty one in the plugin.</string> | |
<!-- Microphone usage constent --> | |
<key>NSMicrophoneUsageDescription</key> | |
<string>My custom microphone usage description. Overriding the default empty one in the plugin.</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import the plugin | |
import { SpeechRecognition } from "nativescript-speech-recognition"; | |
class SpeechRecognition { | |
// instantiate the plugin | |
private speechRecognition = new SpeechRecognition(); | |
public checkAvailability(): void { | |
this.speechRecognition.available().then( | |
(available: boolean) => console.log(available ? "YES!" : "NO"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import the plugin | |
import { SpeechRecognition } from "nativescript-speech-recognition"; | |
class SpeechRecognition { | |
// instantiate the plugin | |
private speechRecognition = new SpeechRecognition(); | |
public checkAvailability(): void { | |
this.speechRecognition.available().then( | |
(available: boolean) => console.log(available ? "YES!" : "NO"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"dependencies": { | |
"buffer": "4.9.1", | |
"querystring": "0.2.0", | |
"sax": "1.1.5", | |
"uuid": "3.0.0", | |
"xml2js": "0.4.15", | |
}, | |
"main": "lib/aws.js", | |
"browser": { | |
"lib/aws.js": "./lib/browser.js", |