Class SignaturePickerFragment
-
- 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
@Deprecated(message = "v2024.4: Will be removed in 2025.", replaceWith = @ReplaceWith(imports = {}, expression = "ElectronicSignatureFragment")) public final class SignaturePickerFragment extends Fragment
The
SignaturePickerFragment
can be used to create ink signatures to add to a document. The dialog provides a list of stored signatures, and a user interface for adding new signatures. To show the dialog, use .show providing the fragment manager of the current activity, and a callback for receiving the user's selection.This class constitutes PSPDFKit’s older signatures functionality from before the introduction of Electronic Signatures. As such, using this class requires that your license includes the Annotations feature and was originally purchased in October 2021 or earlier. If you purchased your license after this time, then you should use ElectronicSignatureFragment from Electronic Signatures instead.
This older signatures functionality will continue to be maintained and supported. However, we recommend using Electronic Signatures for new PSPDFKit integrations. If you’re interested in upgrading, please see our migration guide: https://pspdfkit.com/guides/android/migration-guides/migrating-to-electronic-signatures/
-
-
Constructor Summary
Constructors Constructor Description SignaturePickerFragment()
-
Method Summary
Modifier and Type Method Description Unit
onCreate(Bundle savedInstanceState)
Unit
onSaveInstanceState(Bundle outState)
final Unit
setOnSignaturePickedListener(OnSignaturePickedListener listener)
Sets listener for picked signatures. final Unit
finish()
Dismiss fragment removing it from its owning activity. final static Unit
show(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureOptions signatureOptions, SignatureStorage signatureStorage)
Shows the SignaturePickerFragment. final static Unit
show(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureOptions signatureOptions)
Shows the SignaturePickerFragment. final static Unit
show(FragmentManager fragmentManager, OnSignaturePickedListener listener)
Shows the SignaturePickerFragment. final static Unit
restore(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureStorage signatureStorage)
Restores any previously shown SignaturePickerFragment by re-attaching a [ ]. final static Unit
restore(FragmentManager fragmentManager, OnSignaturePickedListener listener)
Restores any previously shown SignaturePickerFragment by re-attaching a [ ]. final static Unit
dismiss(FragmentManager fragmentManager)
Dismisses any previously shown signature picker fragment. -
-
Method Detail
-
onSaveInstanceState
Unit onSaveInstanceState(Bundle outState)
-
setOnSignaturePickedListener
final Unit 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, ornull
to clear the listener.
-
show
@JvmOverloads() final static Unit show(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureOptions signatureOptions, SignatureStorage signatureStorage)
Shows the SignaturePickerFragment. 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.
-
show
@JvmOverloads() final static Unit show(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureOptions signatureOptions)
Shows the SignaturePickerFragment. 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.
-
show
@JvmOverloads() final static Unit show(FragmentManager fragmentManager, OnSignaturePickedListener listener)
Shows the SignaturePickerFragment. 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.
-
restore
@JvmOverloads() final static Unit restore(FragmentManager fragmentManager, OnSignaturePickedListener listener, SignatureStorage signatureStorage)
Restores any previously shown SignaturePickerFragment by re-attaching a [ ]. Use this inside your activity's 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.
-
restore
@JvmOverloads() final static Unit restore(FragmentManager fragmentManager, OnSignaturePickedListener listener)
Restores any previously shown SignaturePickerFragment by re-attaching a [ ]. Use this inside your activity's 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.
-
dismiss
final static Unit dismiss(FragmentManager fragmentManager)
Dismisses any previously shown signature picker fragment.
- Parameters:
fragmentManager
- Fragment manager used to display this fragment in the first place.
-
-
-
-