Barcode Pick View
Defined in package com.scandit.datacapture.barcode.pick.ui
- BarcodePickViewUiListener
interface BarcodePickViewUiListenerAdded in version 6.20.0
- onFinishButtonTapped(view)
fun onFinishButtonTapped(view: BarcodePickView)
Added in version 6.20.0
Callback method that can be used to define an action that should be performed when the finish button is tapped from the view. Called from the main thread.
- BarcodePickView
class BarcodePickView : RelativeLayout
Added in version 6.19.0
BarcodePickView.
The lifecycle functions onResume(), onPause() and onDestroy() should be bound to the corresponding fragment or activity lifecycle methods for the scanner to work correctly. This will allow the BarcodePickView to automatically pause and resume scanning.
Note
Scanning is only possible when in resumed state. Which means that start() won’t start the scanning flow if onResume() isn’t called before or afterwards.
- newInstance(parentView, dataCaptureContext, mode, settings)
fun BarcodePickView.newInstance(parentView: ViewGroup, dataCaptureContext: DataCaptureContext, mode: BarcodePick, settings: BarcodePickViewSettings): BarcodePickView
Added in version 6.19.0
Initializes a BarcodePickView
- newInstance(parentView, dataCaptureContext, mode, settings, cameraSettings)
fun BarcodePickView.newInstance(parentView: ViewGroup, dataCaptureContext: DataCaptureContext, mode: BarcodePick, settings: BarcodePickViewSettings, cameraSettings: CameraSettings): BarcodePickView
Added in version 6.19.0
Initializes a BarcodePickView
- start()
fun start()Added in version 6.19.0
Starts the camera and the scanning process. Can be stopped by calling stop().
For instance, it can be called when creating the BarcodePickView, so that as soon as the fragment or activity is resumed, the scan flow will start.
Note
Scanning will pause and resume automatically when onPause() and onResume() respectively are called.
- stop()
fun stop()Added in version 6.19.0
Pauses the camera and the scanning process. It can be started again using start().
- freeze()
fun freeze()Added in version 6.20.0
Freezes the camera and the highlights position to make the selection easier. The scanning can be started again using start().
- reset()
fun reset()Added in version 7.0.0
Reset the picking flow. This will clear all picked items and restore the initial state.
- addActionListener(listener)
fun addActionListener(listener: BarcodePickActionListener)
Added in version 6.19.0
Add a BarcodePickActionListener to the mode. User actions will be notified to the listener.
- onResume()
fun onResume()Added in version 6.24.0
Notifies the barcode pick view that the container has resumed.
This method should be called in a Fragment or Activity’s onResume method to allow starting the scanning process or to restore a state previously paused by onPause().
- onPause()
fun onPause()Added in version 6.24.0
Notifies the barcode pick view that the container has paused.
This method should be called in a Fragment or Activity’s onPause method to pause the scanning flow. The scan state will then be restored when onResume() in called.
- onDestroy()
fun onDestroy()Added in version 6.19.0
Stops the camera and the scanning process. After this call the view should not be used anymore.
This method should be called in a Fragment’s onDestroyView or an Activity’s onDestroy methods to release the scanning objects.
- removeActionListener(listener)
fun removeActionListener(listener: BarcodePickActionListener)
Added in version 6.19.0
Removes a BarcodePickActionListener.
- uiListener
var uiListener: BarcodePickViewUiListener?
Added in version 6.20.0
Sets the listener which is called whenever the finish button is tapped from the view.
- listener
var listener: BarcodePickViewListener?
Added in version 6.20.0
Sets a BarcodePickViewListener to the mode. User actions will be notified to the listener.
- hardwareTriggerSupported
val BarcodePickView.hardwareTriggerSupported:
BooleanAdded in version 6.23.0
Returns whether the device supports listening for hardware button events. This is true for devices with api >= 28.