InputSignInMethod
@RequiresCarApi(value = 2)
@CarProtocol
public final class InputSignInMethod implements SignInTemplate.SignInMethod
A SignInTemplate.SignInMethod that presents an input box for the user to enter their credentials.
For example, this can be used to request a username, a password or an activation code.
Summary
Nested types |
|---|
public final class InputSignInMethod.BuilderA builder of |
Constants |
|
|---|---|
static final int |
Default input where the text is shown as it is typed. |
static final int |
Input where the text is hidden as it is typed. |
static final int |
KEYBOARD_DEFAULT = 1Default (full) keyboard. |
static final int |
KEYBOARD_EMAIL = 2Keyboard optimized for typing an email address. |
static final int |
KEYBOARD_NUMBER = 4Keyboard optimized for typing numbers. |
static final int |
KEYBOARD_PHONE = 3Keyboard optimized for typing a phone number. |
Public methods |
|
|---|---|
boolean |
|
@Nullable CarText |
Returns the default value for this input box or |
@Nullable CarText |
Returns an error message associated with the user input. |
@Nullable CarText |
getHint()Returns the text explaining to the user what should be entered in this input box or |
@NonNull InputCallbackDelegate |
Returns the |
int |
Returns the input type, one of |
int |
Returns the type of keyboard to be displayed when this input gets focused. |
int |
hashCode() |
boolean |
Returns whether to show the keyboard by default or not. |
@NonNull String |
toString() |
Constants
INPUT_TYPE_DEFAULT
public static final int INPUT_TYPE_DEFAULT = 1
Default input where the text is shown as it is typed.
INPUT_TYPE_PASSWORD
public static final int INPUT_TYPE_PASSWORD = 2
Input where the text is hidden as it is typed.
KEYBOARD_DEFAULT
public static final int KEYBOARD_DEFAULT = 1
Default (full) keyboard.
KEYBOARD_EMAIL
public static final int KEYBOARD_EMAIL = 2
Keyboard optimized for typing an email address.
KEYBOARD_NUMBER
public static final int KEYBOARD_NUMBER = 4
Keyboard optimized for typing numbers.
KEYBOARD_PHONE
public static final int KEYBOARD_PHONE = 3
Keyboard optimized for typing a phone number.
Public methods
getDefaultValue
public @Nullable CarText getDefaultValue()
Returns the default value for this input box or null if no value is provided.
For the INPUT_TYPE_PASSWORD input type, this value will formatted to be hidden to the user as well.
| See also | |
|---|---|
setDefaultValue |
getErrorMessage
public @Nullable CarText getErrorMessage()
Returns an error message associated with the user input.
For example, this can be used to indicate formatting errors, wrong username or password, or any other problem related to the user input.
| See also | |
|---|---|
setErrorMessage |
getHint
public @Nullable CarText getHint()
Returns the text explaining to the user what should be entered in this input box or null if no hint is provided.
| See also | |
|---|---|
setHint |
getInputCallbackDelegate
public @NonNull InputCallbackDelegate getInputCallbackDelegate()
Returns the InputCallbackDelegate for input callbacks.
| See also | |
|---|---|
Builder |
getInputType
public int getInputType()
Returns the input type, one of INPUT_TYPE_DEFAULT or INPUT_TYPE_PASSWORD
getKeyboardType
public int getKeyboardType()
Returns the type of keyboard to be displayed when this input gets focused.
| See also | |
|---|---|
setKeyboardType |
isShowKeyboardByDefault
public boolean isShowKeyboardByDefault()
Returns whether to show the keyboard by default or not.
| See also | |
|---|---|
setShowKeyboardByDefault |