Class ElectronicSignatureFragment
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
public class ElectronicSignatureFragment extends Fragment
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 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 com.pspdfkit.signatures.SigningManager class from PSPDFKit’s Digital Signatures component.
Check out signature guide for more general information about signatures.
-
-
Constructor Summary
Constructors Constructor Description ElectronicSignatureFragment()
-
Method Summary
Modifier and Type Method Description static void
show(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener)
Shows the ElectronicSignatureFragment. static void
show(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener, @Nullable() ElectronicSignatureOptions signatureOptions, @Nullable() SignatureStorage signatureStorage)
Shows the ElectronicSignatureFragment. static void
restore(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener)
Restores any previously shown ElectronicSignatureFragment by re-attaching a . static void
restore(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener, @Nullable() SignatureStorage signatureStorage)
Restores any previously shown ElectronicSignatureFragment by re-attaching a . static void
dismiss(@NonNull() FragmentManager fragmentManager)
Dismisses any previously shown signature picker fragment. void
onCreate(@Nullable() Bundle savedInstanceState)
void
onSaveInstanceState(@NonNull() Bundle outState)
void
setOnSignaturePickedListener(@Nullable() OnSignaturePickedListener listener)
Sets listener for picked signatures. void
finish()
Dismiss fragment removing it from its owning activity. void
onDestroy()
-
-
Method Detail
-
show
static void show(@NonNull() FragmentManager fragmentManager, @Nullable() 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.
-
show
static void show(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener, @Nullable() ElectronicSignatureOptions signatureOptions, @Nullable() 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.
-
restore
static void restore(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener)
Restores any previously shown ElectronicSignatureFragment by re-attaching a . Use this inside your activity's onCreate 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.
-
restore
static void restore(@NonNull() FragmentManager fragmentManager, @Nullable() OnSignaturePickedListener listener, @Nullable() SignatureStorage signatureStorage)
Restores any previously shown ElectronicSignatureFragment by re-attaching a . Use this inside your activity's onCreate 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, ornull
to use the default one.
-
dismiss
static void dismiss(@NonNull() FragmentManager fragmentManager)
Dismisses any previously shown signature picker fragment.
- Parameters:
fragmentManager
- Fragment manager used to display this fragment in the first place.
-
onSaveInstanceState
void onSaveInstanceState(@NonNull() Bundle outState)
-
setOnSignaturePickedListener
void setOnSignaturePickedListener(@Nullable() 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, ornull
to clear the listener.
-
finish
void finish()
Dismiss fragment removing it from its owning activity.
-
onDestroy
void onDestroy()
-
-
-
-