@objc public protocol EPPickerDelegate { // NOTICE THE @objc
optional func epContactPicker(_: EPContactsPicker, didContactFetchFailed error: NSError)
optional func epContactPicker(_: EPContactsPicker, didCancel error: NSError)
optional func epContactPicker(_: EPContactsPicker, didSelectContact contact: EPContact)
optional func epContactPicker(_: EPContactsPicker, didSelectMultipleContacts contacts: [EPContact])
}
This file contains hidden or 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 * as application from "application" | |
| import {Injectable} from "@angular/core" | |
| function permissionResult(permission: string, type: string): boolean { | |
| if (!android.support || !android.support.v4 || !android.support.v4.content || !android.support.v4.content.ContextCompat || !android.support.v4.content.ContextCompat.checkSelfPermission) { | |
| let result: boolean = (type == 'PERMISSION_GRANTED') ? true : false |
This file contains hidden or 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 PermissionsClass { | |
| private static _contactStore: CNContactStore = CNContactStore.alloc().init() | |
| private _getContactsAuthorization(): CNAuthorizationStatus { | |
| return CNContactStore.authorizationStatusForEntityType(CNEntityType.Contacts) | |
| } | |
| isContactsAuthorized(): boolean { | |
| return this._getContactsAuthorization() == CNAuthorizationStatus.Authorized |
This file contains hidden or 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
| @JavaProxy('com.tns.NativeScriptActivity') | |
| class Activity extends android.app.Activity { | |
| private _callbacks: frame.AndroidActivityCallbacks | |
| onCreate(savedInstanceState: android.os.Bundle): void { | |
| if (!this._callbacks) { | |
| (<any>frame).setActivityCallbacks(this) | |
| } | |
| this._callbacks.onCreate(this, savedInstanceState, super.onCreate) |
This file contains hidden or 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
| declare var EVContactsPickerVersionNumber: number; | |
| declare var EVContactsPickerVersionString: interop.Reference<number>; | |
| declare class EVContactsPickerViewController extends UIViewController implements CNContactViewControllerDelegate, UIScrollViewDelegate, UITableViewDataSource, UITableViewDelegate { | |
| static alloc(): EVContactsPickerViewController; // inherited from NSObject | |
| static new(): EVContactsPickerViewController; // inherited from NSObject |
This file contains hidden or 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 DatabaseClass<T> extends DatabaseClassCommon<T> { | |
| private _sqlite: io.requery.android.database.sqlite.SQLiteDatabase | |
| constructor(opts: DatabaseOpts) { | |
| super(opts) | |
| if (application.android.context) { | |
| this._initTable() | |
| } else { |
This file contains hidden or 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 function pickImage(): Promise<ImageSource> { | |
| return new Promise(function(resolve, reject) { | |
| let reqid: number = Math.floor(Math.random() * 999) | |
| function onActivityResult(args: application.AndroidActivityResultEventData) { | |
| Utils.parseActivityResult(args, reqid, resolve, reject) | |
| } | |
| application.android.addEventListener(application.AndroidApplication.activityResultEvent, onActivityResult) |
This file contains hidden or 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 function pickContacts(): Promise<ContactsPickerItem> { | |
| return new Promise(function(resolve, reject) { | |
| let reqid: number = Math.floor(Math.random() * 999) | |
| function onActivityResult(args: application.AndroidActivityResultEventData) { | |
| Utils.parseActivityResult(args, reqid, resolve, reject) | |
| } | |
| application.android.addEventListener(application.AndroidApplication.activityResultEvent, onActivityResult) | |
| Utils.uiAsync(() => { |
This file contains hidden or 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 * as application from 'application' | |
| import { Color } from 'color' | |
| import { ad } from 'utils/utils' | |
| import * as Utils from '../utils/utils' | |
| import { CoachItem, CoachOpts } from './coach' | |
| import { CoachShape, CoachLabelPosition, CoachLabelAlignment } from './coach.common' | |
This file contains hidden or 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 common = require('./iimage.common') | |
| import * as application from 'application' | |
| import { View } from 'ui/core/view' | |
| import { Property, PropertyMetadataSettings, PropertyChangeData } from 'ui/core/dependency-observable' | |
| import { PropertyMetadata } from 'ui/core/proxy' | |
| import { Stretch } from 'ui/enums' | |
| import { ImageSource } from 'image-source' | |
| import { knownFolders, path } from 'file-system' |