UI Components

UI Components

Your app's user interface and everything that users can see and interact with.

VGSTextView

A user interface element that displays any revealed text to the user.

** Check the Text field guide**

<com.verygoodsecurity.vgsshow.widget.VGSTextView
    android:id="@+id/infoField"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:contentPath="<CONTENT_PATH>" />

VGSPDFView

User interface element to display a PDF content. VGSPDFView depends on open source Android PdfViewer library and can be used only with it.

** Check the PDF field guide**

<com.verygoodsecurity.vgsshow.widget.VGSPDFView
    android:id="@+id/pdfField"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:contentPath="<CONTENT_PATH>" />

VGSImageView

User interface element that is designed to display a revealed images to the user.

** Check the Image field guide**

<com.verygoodsecurity.vgsshow.widget.VGSImageView
    android:id="@+id/imageField"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:contentPath="<CONTENT_PATH>" />

Advanced Settings

Getting content from Nested JSON Structure

When you need to show revealed data from a specific json structure you may do it by adding . notation to contentPath-string. Each . in a contentPath represents a new level of nesting. New content path string could be set into app:contentPath or setContentPath method.

<com.verygoodsecurity.vgsshow.widget.VGSTextView
    android:id="@+id/infoField"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:contentPath="card_data.card_number" />

Copy text to clipboard

VGS Show SDK provides an option for your end-users to copy revealed text to clipboard after request is completed. You can optionally enable or disable this feature for end-users. Also, you may choose format of data that will be copied to clipboard before you give users the option to paste it.

With CopyTextFormat class a you can change the format of a text which might be copied:

  • RAW: A text string without any formatting.

  • FORMATTED: A text string which is equal to the text from a field. Usually, VGS input fields applies text formatting for better visual inspection.

Use copyToClipboard for VGSTextView to copy revealed text.

infoField.copyToClipboard(VGSTextView.CopyTextFormat.RAW)

With OnTextCopyListener a developer can detect when a user copies text.

infoField?.addOnCopyTextListener(object : VGSTextView.OnTextCopyListener {
    override fun onTextCopied(view: VGSTextView, format: VGSTextView.CopyTextFormat) {\n
    }
})
    

Last updated