0.0.2 • Published 10 months ago

capacitor-onyx v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

capacitor-onyx

Provides an interface to the Onyx SDK for the Boox series of tablets

Install

npm install capacitor-onyx
npx cap sync

Configure Gradle

Add the following to your app's build.gradle repositories block (it will also have the flatDirs config from default capacitor).

repositories {
    maven {
        url "http://repo.boox.com/repository/maven-public"
        allowInsecureProtocol = true
    }
}

And in the android block in your build.gradle:

android {
    //..namespace, defaultConfig, buildTypes, etc
    packagingOptions {
        jniLibs {
            pickFirsts += [
                    'lib/arm64-v8a/libc++_shared.so',
                    'lib/armeabi-v7a/libc++_shared.so',
                    'lib/x86/libc++_shared.so',
                    'lib/x86_64/libc++_shared.so'
            ]
        }
    }
}

Last, add the following line to your gradle.properties file

android.enableJetifier=true

API

start(...)

start(options: DrawAreaOptions) => Promise<void>
ParamType
optionsDrawAreaOptions

stop()

stop() => Promise<void>

configureStroke(...)

configureStroke(options: StrokeOptions) => Promise<void>
ParamType
optionsStrokeOptions

addListener('onDrawingStart', ...)

addListener(name: 'onDrawingStart', callback: (point: Point) => void) => PluginListenerHandle
ParamType
name'onDrawingStart'
callback(point: Point) => void

Returns: PluginListenerHandle


addListener('onDrawingEnd', ...)

addListener(name: 'onDrawingEnd', callback: () => void) => PluginListenerHandle
ParamType
name'onDrawingEnd'
callback() => void

Returns: PluginListenerHandle


addListener('onStroke', ...)

addListener(name: 'onStroke', callback: (stroke: Stroke) => void) => PluginListenerHandle
ParamType
name'onStroke'
callback(stroke: Stroke) => void

Returns: PluginListenerHandle


addListener('onErasingStart', ...)

addListener(name: 'onErasingStart', callback: (point: Point) => void) => PluginListenerHandle
ParamType
name'onErasingStart'
callback(point: Point) => void

Returns: PluginListenerHandle


addListener('onErasingEnd', ...)

addListener(name: 'onErasingEnd', callback: () => void) => PluginListenerHandle
ParamType
name'onErasingEnd'
callback() => void

Returns: PluginListenerHandle


addListener('onErase', ...)

addListener(name: 'onErase', callback: (stroke: Stroke) => void) => PluginListenerHandle
ParamType
name'onErase'
callback(stroke: Stroke) => void

Returns: PluginListenerHandle


removeAllListeners()

removeAllListeners() => void

Interfaces

DrawAreaOptions

PropType
xnumber
ynumber
heightnumber
widthnumber

StrokeOptions

PropType
widthnumber
style'pencil' | 'fountain' | 'marker' | 'neo-brush' | 'charcoal' | 'dash' | 'charcoal-v2'

PluginListenerHandle

PropType
remove() => Promise<void>

Point

PropType
xnumber
ynumber
sizenumber
pressurenumber
timestampnumber

Stroke

PropType
pointsPoint[]
0.0.2

10 months ago

0.0.1

10 months ago