Skip to content

Instantly share code, notes, and snippets.

@husaynhakeem
Created September 10, 2020 04:31
Show Gist options
  • Save husaynhakeem/69dee3cdf607e8d82a10aaff4b35451c to your computer and use it in GitHub Desktop.
Save husaynhakeem/69dee3cdf607e8d82a10aaff4b35451c to your computer and use it in GitHub Desktop.
val builder = PromptInfo.Builder()
.setTitle(/* Title */)
.setSubtitle(/* Subtitle */)
.setDescription(/* Description */)
// Set a negative button. It would typically display "Cancel"
builder.setNegativeButtonText(/* Negative button label. E.g. "Cancel" */)
// Show a confirmation button after authentication succeeds
// Useful for certain operations, e.g. Ones that involve payment
builder.setConfirmationRequired(/* True/False */)
// Allow authentication with a password, pin or pattern
builder.setDeviceCredentialAllowed(/* True/False */)
val promptInfo = try {
builder.build()
} catch (exception: IllegalArgumentException) {
// Failed to build a prompt info instance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment