# InputSignInMethod

# InputSignInMethod

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/model/signin/InputSignInMethod.java+class:androidx.car.app.model.signin.InputSignInMethod)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod "View this page in Java")

<br />

```
@RequiresCarApi(value = 2)
@CarProtocol
class InputSignInMethod : SignInTemplate.SignInMethod
```

<br />

*** ** * ** ***

A[SignInTemplate.SignInMethod](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/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                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[InputSignInMethod.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder) A builder of[InputSignInMethod](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod). |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [INPUT_TYPE_DEFAULT](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT())` = 1` Default input where the text is shown as it is typed. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [INPUT_TYPE_PASSWORD](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD())` = 2` Input where the text is hidden as it is typed.      |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [KEYBOARD_DEFAULT](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_DEFAULT())` = 1` Default (full) keyboard.                                  |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [KEYBOARD_EMAIL](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_EMAIL())` = 2` Keyboard optimized for typing an email address.               |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [KEYBOARD_NUMBER](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_NUMBER())` = 4` Keyboard optimized for typing numbers.                      |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [KEYBOARD_PHONE](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_PHONE())` = 3` Keyboard optimized for typing a phone number.                 |

|                                                 ### Public functions                                                 |
|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                  | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!)`                                                                                                                                                                                                                             |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`                          | [getDefaultValue](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getDefaultValue())`()` Returns the default value for this input box or`null`if no value is provided.                                                                                                                                                                                                                                  |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`                          | [getErrorMessage](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getErrorMessage())`()` Returns an error message associated with the user input.                                                                                                                                                                                                                                                       |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`                          | [getHint](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getHint())`()` Returns the text explaining to the user what should be entered in this input box or`null`if no hint is provided.                                                                                                                                                                                                               |
| [InputCallbackDelegate](https://developer.android.com/reference/kotlin/androidx/car/app/model/InputCallbackDelegate) | [getInputCallbackDelegate](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getInputCallbackDelegate())`()` Returns the[InputCallbackDelegate](https://developer.android.com/reference/kotlin/androidx/car/app/model/InputCallbackDelegate)for input callbacks.                                                                                                                                          |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                          | [getInputType](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getInputType())`()` Returns the input type, one of[INPUT_TYPE_DEFAULT](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT())or[INPUT_TYPE_PASSWORD](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD()) |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                          | [getKeyboardType](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#getKeyboardType())`()` Returns the type of keyboard to be displayed when this input gets focused.                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                          | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#hashCode())`()`                                                                                                                                                                                                                                                                                                                              |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                  | [isShowKeyboardByDefault](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#isShowKeyboardByDefault())`()` Returns whether to show the keyboard by default or not.                                                                                                                                                                                                                                        |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                    | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#toString())`()`                                                                                                                                                                                                                                                                                                                              |

## Constants

### INPUT_TYPE_DEFAULT

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val INPUT_TYPE_DEFAULT = 1: Int
```

Default input where the text is shown as it is typed.  

### INPUT_TYPE_PASSWORD

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val INPUT_TYPE_PASSWORD = 2: Int
```

Input where the text is hidden as it is typed.  

### KEYBOARD_DEFAULT

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val KEYBOARD_DEFAULT = 1: Int
```

Default (full) keyboard.  

### KEYBOARD_EMAIL

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val KEYBOARD_EMAIL = 2: Int
```

Keyboard optimized for typing an email address.  

### KEYBOARD_NUMBER

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val KEYBOARD_NUMBER = 4: Int
```

Keyboard optimized for typing numbers.  

### KEYBOARD_PHONE

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
const val KEYBOARD_PHONE = 3: Int
```

Keyboard optimized for typing a phone number.  

## Public functions

### equals

```
fun equals(other: Any!): Boolean
```  

### getDefaultValue

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getDefaultValue(): CarText?
```

Returns the default value for this input box or`null`if no value is provided.

For the[INPUT_TYPE_PASSWORD](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD())input type, this value will formatted to be hidden to the user as well.  

|                                                                          See also                                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setDefaultValue](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#setDefaultValue(java.lang.String)) |   |

### getErrorMessage

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getErrorMessage(): CarText?
```

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](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#setErrorMessage(java.lang.CharSequence)) |   |

### getHint

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getHint(): CarText?
```

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](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#setHint(java.lang.CharSequence)) |   |

### getInputCallbackDelegate

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getInputCallbackDelegate(): InputCallbackDelegate
```

Returns the[InputCallbackDelegate](https://developer.android.com/reference/kotlin/androidx/car/app/model/InputCallbackDelegate)for input callbacks.  

|                                                                            See also                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#Builder(androidx.car.app.model.InputCallback)) |   |

### getInputType

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getInputType(): Int
```

Returns the input type, one of[INPUT_TYPE_DEFAULT](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT())or[INPUT_TYPE_PASSWORD](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD())  

### getKeyboardType

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getKeyboardType(): Int
```

Returns the type of keyboard to be displayed when this input gets focused.  

|                                                                    See also                                                                    |
|------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setKeyboardType](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#setKeyboardType(int)) |   |

### hashCode

```
fun hashCode(): Int
```  

### isShowKeyboardByDefault

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun isShowKeyboardByDefault(): Boolean
```

Returns whether to show the keyboard by default or not.  

|                                                                               See also                                                                               |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setShowKeyboardByDefault](https://developer.android.com/reference/kotlin/androidx/car/app/model/signin/InputSignInMethod.Builder#setShowKeyboardByDefault(boolean)) |   |

### toString

```
fun toString(): String
```