NfcTravelDocumentReaderFragment

abstract class NfcTravelDocumentReaderFragment @JvmOverloads constructor(@LayoutRes contentLayoutId: Int = NfcTravelDocumentReaderViewLayer.LAYOUT_RESOURCE_ID) : Fragment

UI NFC Travel Document Reader component.

A visual component for reading NFC Travel Documents.

Customization options:

  1. Overwriting resources:

    • You can partially customize the UI by replacing the component's default resources with your own.

    • The following resources are expected by the component:

      Drawables:

      • R.drawable.dot_nfc_nfc_travel_document_reader_searching

      • R.drawable.dot_nfc_nfc_travel_document_reader_reading (must be of type AnimatedVectorDrawable)

      Strings:

      • R.string.dot_nfc_nfc_travel_document_reader_searching_title

      • R.string.dot_nfc_nfc_travel_document_reader_searching_subhead

      • R.string.dot_nfc_nfc_travel_document_reader_reading_title

      • R.string.dot_nfc_nfc_travel_document_reader_reading_subhead

      Styles:

      • R.style.Dot_Title

      • R.style.Dot_Subhead

  2. Providing a custom view:

    • For full customization, you can pass a custom layout via constructor or you can supply a custom view by overriding the onCreateView method.

    • If you choose this option, you must also override the onSearchingStarted and onReadingStarted methods to ensure your UI reflects the appropriate state during the document searching and reading processes.

Constructors

Link copied to clipboard
fun NfcTravelDocumentReaderFragment(@LayoutRes contentLayoutId: Int = NfcTravelDocumentReaderViewLayer.LAYOUT_RESOURCE_ID)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Configuration @JvmOverloads constructor(val password: Password, val authorityCertificatesFilePath: String? = null, val activeAuthenticationChallenge: ByteArray? = null, isDebugInfoEnabled: Boolean = false) : Serializable

Configuration of NFC reading for NfcTravelDocumentReaderFragment.

Functions

Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?

To customize the UI, you can override this method to return your own view. If you do so, must also override the onSearchingStarted and onReadingStarted methods to handle state changes appropriately in your custom view.

Link copied to clipboard
abstract fun onFailed(exception: Exception)

Subclasses must override this function to handle NFC reading failure.

Link copied to clipboard
abstract fun onSucceeded(travelDocument: TravelDocument)

Subclasses must override this function to handle successful NFC document reading.

Link copied to clipboard
open override fun onViewCreated(view: View, savedInstanceState: Bundle?)
Link copied to clipboard

Subclasses should override this method to provide Configuration for the NFC reader.