public class

ElectronicSignatureFragment

extends Fragment
java.lang.Object
   ↳ androidx.fragment.app.Fragment
     ↳ com.pspdfkit.ui.signatures.ElectronicSignatureFragment

Class Overview

A dialog for adding a signature to a document by drawing, selecting an image, or typing. an electronic signature. The dialog also provides a list of stored signatures. This class requires the Electronic Signatures feature to be enabled in your license. To show the dialog, use show(FragmentManager, OnSignaturePickedListener, ElectronicSignatureOptions, SignatureStorage) providing the fragment manager of the current activity, and a callback for receiving the user's selection. To cryptographically sign a document with a certificate, please use the Signer class from PSPDFKit’s Digital Signatures component. Check out https://pspdfkit.com/guides/android/signatures/ for more general information about signatures.

Summary

Public Constructors
ElectronicSignatureFragment()
Public Methods
static void dismiss(FragmentManager fragmentManager)
Dismisses any previously shown signature picker fragment.
void finish()
Dismiss fragment removing it from its owning activity.
void onCreate(Bundle savedInstanceState)
void onDestroy()
void onSaveInstanceState(Bundle outState)
static void restore(FragmentManager fragmentManager, OnSignaturePickedListener listener)
Restores any previously shown ElectronicSignatureFragment by re-attaching a OnSignaturePickedListener.
static void restore(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureStorage signatureStorage)
Restores any previously shown ElectronicSignatureFragment by re-attaching a OnSignaturePickedListener.
void setOnSignaturePickedListener(OnSignaturePickedListener listener)
Sets listener for picked signatures.
static void show(FragmentManager fragmentManager, OnSignaturePickedListener listener)
static void show(FragmentManager fragmentManager, OnSignaturePickedListener listener, ElectronicSignatureOptions signatureOptions, SignatureStorage signatureStorage)
[Expand]
Inherited Methods
From class androidx.fragment.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener
From interface androidx.activity.result.ActivityResultCaller
From interface androidx.lifecycle.HasDefaultViewModelProviderFactory
From interface androidx.lifecycle.LifecycleOwner
From interface androidx.lifecycle.ViewModelStoreOwner
From interface androidx.savedstate.SavedStateRegistryOwner

Public Constructors

public ElectronicSignatureFragment ()

Public Methods

public static void dismiss (FragmentManager fragmentManager)

Dismisses any previously shown signature picker fragment.

Parameters
fragmentManager Fragment manager used to display this fragment in the first place.

public void finish ()

Dismiss fragment removing it from its owning activity.

public void onCreate (Bundle savedInstanceState)

public void onDestroy ()

public void onSaveInstanceState (Bundle outState)

public static void restore (FragmentManager fragmentManager, OnSignaturePickedListener listener)

Restores any previously shown ElectronicSignatureFragment by re-attaching a OnSignaturePickedListener. Use this inside your activity's onCreate(Bundle) method to reattach any listener if necessary (for example after a configuration change). If no fragment was shown, calling this method will be a no-op.

Parameters
fragmentManager The current activity's fragment manager.
listener A listener for receiving the user's selection.

public static void restore (FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureStorage signatureStorage)

Restores any previously shown ElectronicSignatureFragment by re-attaching a OnSignaturePickedListener. Use this inside your activity's onCreate(Bundle) method to reattach any listener and signature storage if necessary (for example after a configuration change). If no fragment was shown, calling this method will be a no-op.

Parameters
fragmentManager The current activity's fragment manager.
listener A listener for receiving the user's selection.
signatureStorage Signature storage to be used for saving selected signatures, or null to use the default one.

public void setOnSignaturePickedListener (OnSignaturePickedListener listener)

Sets listener for picked signatures. Calling this method will replace any previously set listener. You may provide null to clear the listener.

Parameters
listener OnSignaturePickedListener that should be notified, or null to clear the listener.

public static void show (FragmentManager fragmentManager, OnSignaturePickedListener listener)

Shows the ElectronicSignatureFragment. The fragment will be presented to the user as a dialog.

Parameters
fragmentManager The current activity's fragment manager.
listener A listener for receiving the user's selection.

public static void show (FragmentManager fragmentManager, OnSignaturePickedListener listener, ElectronicSignatureOptions signatureOptions, SignatureStorage signatureStorage)

Shows the ElectronicSignatureFragment. The fragment will be presented to the user as a dialog.

Parameters
fragmentManager The current activity's fragment manager.
listener A listener for receiving the user's selection.
signatureOptions UI options to use when displaying signatures.
signatureStorage Signature storage to be used for saving selected signatures.