# TelephoneKeypadTemplate

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/dialer/TelephoneKeypadTemplate.java+class:androidx.car.app.dialer.TelephoneKeypadTemplate) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

*** ** * ** ***


```
@ExperimentalCarApi
@CarProtocol
public class TelephoneKeypadTemplate implements Template
```

<br />

*** ** * ** ***

A template that allows a user to dial a phone number which includes a keypad, a primary button, and a place for the user to see their dialed number.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate.Builder` A builder for `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate`. |
| `public interface https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate.PhoneNumberChangeListener` An interface for clients to receive events about the phone number changing. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_EIGHT() = 8` The \`8\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_FIVE() = 5` The \`5\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_FOUR() = 4` The \`4\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_NINE() = 9` The \`9\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_ONE() = 1` The \`1\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_POUND() = 11` The \`#\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_SEVEN() = 7` The \`7\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_SIX() = 6` The \`6\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_STAR() = 10` The \`\*\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_THREE() = 3` The \`3\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_TWO() = 2` The \`2\` key in the keypad. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#KEY_ZERO() = 0` The \`0\` key in the keypad. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/annotation/VisibleForTesting https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#TelephoneKeypadTemplate()()` Default empty constructor for the serializer. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Header` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getHeader()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Header` to show in this template. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/Integer.html, https://developer.android.com/reference/androidx/car/app/model/CarText>` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getKeySecondaryTexts()()` Returns the mapping of key -\> text for the keypad button's secondary text. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getPhoneNumber()()` Gets the phone number to show in the "dialed number" field which can be edited before calling. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/InputCallbackDelegate` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getPhoneNumberChangedDelegate()()` Returns the delegate that is used to fire dialed number change events back to the client app. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Action` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getPrimaryAction()()` Returns the primary action button. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadCallbackDelegate` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#getTelephoneKeypadCallbackDelegate()()` Returns the delegate that is used to fire key events back to the client app. |
| `int` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate#toString()()` |

## Constants

### KEY_EIGHT

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

```
public static final int KEY_EIGHT = 8
```

The \`8\` key in the keypad.

### KEY_FIVE

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

```
public static final int KEY_FIVE = 5
```

The \`5\` key in the keypad.

### KEY_FOUR

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

```
public static final int KEY_FOUR = 4
```

The \`4\` key in the keypad.

### KEY_NINE

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

```
public static final int KEY_NINE = 9
```

The \`9\` key in the keypad.

### KEY_ONE

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

```
public static final int KEY_ONE = 1
```

The \`1\` key in the keypad.

### KEY_POUND

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

```
public static final int KEY_POUND = 11
```

The \`#\` key in the keypad.

### KEY_SEVEN

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

```
public static final int KEY_SEVEN = 7
```

The \`7\` key in the keypad.

### KEY_SIX

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

```
public static final int KEY_SIX = 6
```

The \`6\` key in the keypad.

### KEY_STAR

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

```
public static final int KEY_STAR = 10
```

The \`\*\` key in the keypad.

### KEY_THREE

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

```
public static final int KEY_THREE = 3
```

The \`3\` key in the keypad.

### KEY_TWO

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

```
public static final int KEY_TWO = 2
```

The \`2\` key in the keypad.

### KEY_ZERO

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

```
public static final int KEY_ZERO = 0
```

The \`0\` key in the keypad.

## Public constructors

### TelephoneKeypadTemplate

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

```
@VisibleForTesting
public TelephoneKeypadTemplate()
```

Default empty constructor for the serializer.

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getHeader

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

```
public @Nullable Header getHeader()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Header` to show in this template.

### getKeySecondaryTexts

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

```
public @NonNull Map<Integer, CarText> getKeySecondaryTexts()
```

Returns the mapping of key -\> text for the keypad button's secondary text.

### getPhoneNumber

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

```
public @Nullable String getPhoneNumber()
```

Gets the phone number to show in the "dialed number" field which can be edited before calling.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate.Builder#setPhoneNumber(java.lang.String)` |   |

### getPhoneNumberChangedDelegate

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

```
public @Nullable InputCallbackDelegate getPhoneNumberChangedDelegate()
```

Returns the delegate that is used to fire dialed number change events back to the client app.

### getPrimaryAction

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

```
public @Nullable Action getPrimaryAction()
```

Returns the primary action button. This is usually the call button, but the app can set this arbitrarily.

### getTelephoneKeypadCallbackDelegate

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

```
public @Nullable TelephoneKeypadCallbackDelegate getTelephoneKeypadCallbackDelegate()
```

Returns the delegate that is used to fire key events back to the client app.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```