Skip to main content

Scan Tips

The SDK provides an optional toolbar item within the scanning screen, that when clicked, will open some tips on how to get the best scan result. By default it is activated for photo payment and disabled for document scan and shows some default items. You can customize it according to your needs or disable it completely.

scanTips

Disable

To disable the scan tips, set the scanTips property to null. For Document Scan, the scan tips are disabled by default.

import de.docutain.sdk.ui.PhotoPaymentResult

val photoPaymentResult = registerForActivityResult(PhotoPaymentResult()) { result -> }

...

myButton.setOnClickListener {
val scanConfig = PhotoPaymentConfiguration()
scanConfig.scanTips = null
photoPaymentResult.launch(scanConfig)
}

Customize

If you want to provide your own items instead of the default items, you can do that by providing your own list of DocutainListItem. Each item consists of an image, a title and a message.

import de.docutain.sdk.ui.ScanResult

val documentScanResult = registerForActivityResult(ScanResult()) { result -> }

...

myButton.setOnClickListener {
val scanConfig = DocumentScannerConfiguration()
scanConfig.scanTips = ScanTips().apply {
items = listOf(
ScanTips.defaultItems[1],
ScanTips.defaultItems[3],
DocutainListItem(R.drawable.image, R.string.title, R.string.message)
)
}
documentScanResult.launch(scanConfig)
}

The following provides an overview of the currently available options to alter the scanTips:

PropertyTypeDescription
itemsList<DocutainListItem>?The items you want to show within the scan tips. If you don't provide any items, some default items will be displayed.
toolbarItemDocutainButtonThe toolbar item that will be shown allowing the user to open the scan tips.
info

You can get the default items used by the SDK to use them for your own list.

val scanTipsDefaultItems = ScanTips.defaultItems

The following sample alters the toolbarItem icon.

import de.docutain.sdk.ui.ScanResult

val documentScanResult = registerForActivityResult(ScanResult()) { result -> }

...

myButton.setOnClickListener {
val scanConfig = DocumentScannerConfiguration()
scanConfig.scanTips = ScanTips().apply {
toolbarItem.icon = R.drawable.icon
}
documentScanResult.launch(scanConfig)
}