PassphraseEntryField

fun PassphraseEntryField(constraints: PassphraseConstraints, checkWeakPassphrase: Boolean = false, onChanged: (passphrase: String, meetsRequirements: Boolean, donePressed: Boolean) -> Unit)

A composable for entering a passphrase or PIN.

Three parameters are passed to the onChanged callback, the first is the current passphrase, the second is whether this meets requirements, and they third is a boolean which is set to true only if the user pressed the "Done" button on the virtual keyboard.

Note that onChanged will be fired right after the composable is first shown. This is to enable the calling code to update e.g. a "Next" button based on whether the currently entered passphrase meets requirements.

Parameters

constraints

the constraints for the passphrase.

checkWeakPassphrase

if true, checks and disallows for weak passphrase/PINs and also shows a hint if one is input

onChanged

called when the user is entering text or pressing the "Done" IME action