TireTreadScanView

fun TireTreadScanView(config: TireTreadScanViewConfig = TireTreadScanViewConfig(), tireWidth: Int? = null, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes a composable with the configuration that was provided with config.

When the scan starts, events are being emitted through callback. If DefaultUI is disabled these events can be used to provide further information to the user (see ScanEvent)

Once the scan is finished and onScanProcessCompleted is invoked, your application should take back the control of the workflow and possibly continue to a result screen.

If DefaultUI is used and tireWidth is not provided, a separate screen will be shown to the user before the scan starts to provide this information. This behaviour can be adapted by providing the correct configuration. See Documentation for further information.

Parameters

config

configuration used to set up the scan process

tireWidth

optional value for the width of the tire

onScanAborted

a callback that is invoked when the scan process is aborted

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error


fun TireTreadScanView(config: String, tireWidth: Int? = null, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes a composable with the configuration in form of a JSON string that was provided with config.

When the scan starts, events are being emitted through callback. If DefaultUI is disabled these events can be used to provide further information to the user (see ScanEvent)

Once the scan is finished and onScanProcessCompleted is invoked, your application should take back the control of the workflow and possibly continue to a result screen.

If DefaultUI is used and tireWidth is not provided, a separate screen will be shown to the user before the scan starts to provide this information. This behaviour can be adapted by providing the correct configuration. See Documentation for further information.

Parameters

config

configuration used to set up the scan process.

tireWidth

optional value for the width of the tire, in mm.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization

fun TireTreadScanView(context: AppContext, config: TireTreadScanViewConfig = TireTreadScanViewConfig(), tireWidth: Int?, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes the scan view with a config object and a tire width and assigns it to the provided context.

Parameters

context

the application context.

config

the path to a JSON file containing the config or the config itself as string representation.

tireWidth

optional value for the width of the tire, in mm.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization


fun TireTreadScanView(context: AppContext, config: TireTreadScanViewConfig, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes the scan view with a config object and assigns it to the provided context.

Parameters

context

the application context.

config

the path to a JSON file containing the config or the config itself as string representation.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization


fun TireTreadScanView(context: AppContext, config: String, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes the scan view with a JSON config and assigns it to the provided context.

Parameters

context

the application context.

config

the path to a JSON file containing the config or the config itself as string representation.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization


fun TireTreadScanView(context: AppContext, config: String, tireWidth: Int?, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes the scan view with a JSON config and a tire width and assigns it to the provided context.

Parameters

context

the application context.

config

the path to a JSON file containing the config or the config itself as string representation.

tireWidth

optional value for the width of the tire, in mm.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization


fun TireTreadScanView(context: AppContext, onScanAborted: (String?) -> Unit, onScanProcessCompleted: (String) -> Unit, callback: (ScanEvent) -> Unit?, onError: (String?, Exception) -> Unit)

Initializes the scan view with a standard config, and assigns it to the provided context.

Parameters

context

the application context.

onScanAborted

a callback that is invoked when the scan process is aborted.

onScanProcessCompleted

a callback that is invoked once the scan process has finished.

callback

a callback that is invoked when a scan event was emitted

onError

a callback that is invoked when the scan process encountered an error during initialization