# ThemedSpinnerAdapter

Artifact: [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat) [View Source](https://cs.android.com/search?q=file:androidx/appcompat/widget/ThemedSpinnerAdapter.java+class:androidx.appcompat.widget.ThemedSpinnerAdapter) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
interface ThemedSpinnerAdapter : SpinnerAdapter
```

<br />

*** ** * ** ***

An extension of SpinnerAdapter that is capable of inflating drop-down views against a different theme than normal views.

Classes that implement this interface should use the theme provided to `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)` when creating views in `https://developer.android.com/reference/android/widget/SpinnerAdapter.html#getDropDownView(int, android.view.View, android.view.ViewGroup)`.

The `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter.Helper` class is provided to aide implementation in a backwards compatible way.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter.Helper` A helper class which allows easy integration of `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter` into existing `https://developer.android.com/reference/android/widget/SpinnerAdapter.html`s in a backwards compatible way. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.Theme.html?` | `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter#getDropDownViewTheme()()` Returns the value previously set by a call to `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)(theme: https://developer.android.com/reference/android/content/res/Resources.Theme.html?)` Sets the `https://developer.android.com/reference/android/content/res/Resources.Theme.html` against which drop-down views are inflated. |

| ### Inherited Constants |
|---|
| From [android.widget.Adapter](https://developer.android.com/reference/android/widget/Adapter.html) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#IGNORE_ITEM_VIEW_TYPE = -1` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#NO_SELECTION = -2147483648` | |

| ### Inherited functions |
|---|
| From [android.widget.Adapter](https://developer.android.com/reference/android/widget/Adapter.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!>!` | `https://developer.android.com/reference/android/widget/Adapter.html#getAutofillOptions()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#getCount()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/android/widget/Adapter.html#getItem(int)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#getItemId(int)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#getItemViewType(int)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://developer.android.com/reference/android/view/View.html!` | `https://developer.android.com/reference/android/widget/Adapter.html#getView(int, android.view.View, android.view.ViewGroup)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, p1: https://developer.android.com/reference/android/view/View.html!, p2: https://developer.android.com/reference/android/view/ViewGroup.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#getViewTypeCount()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#hasStableIds()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#isEmpty()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#registerDataSetObserver(android.database.DataSetObserver)(p: https://developer.android.com/reference/android/database/DataSetObserver.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/widget/Adapter.html#unregisterDataSetObserver(android.database.DataSetObserver)(p: https://developer.android.com/reference/android/database/DataSetObserver.html!)` | |
| From [android.widget.SpinnerAdapter](https://developer.android.com/reference/android/widget/SpinnerAdapter.html) |---|---| | `https://developer.android.com/reference/android/view/View.html!` | `https://developer.android.com/reference/android/widget/SpinnerAdapter.html#getDropDownView(int, android.view.View, android.view.ViewGroup)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, p1: https://developer.android.com/reference/android/view/View.html!, p2: https://developer.android.com/reference/android/view/ViewGroup.html!)` | |

## Public functions

### getDropDownViewTheme

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

```
fun getDropDownViewTheme(): Resources.Theme?
```

Returns the value previously set by a call to `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/ThemedSpinnerAdapter#setDropDownViewTheme(android.content.res.Resources.Theme)`.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.Theme.html?` | the `https://developer.android.com/reference/android/content/res/Resources.Theme.html` against which drop-down views are inflated, or `null` if one has not been explicitly set |

### setDropDownViewTheme

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

```
fun setDropDownViewTheme(theme: Resources.Theme?): Unit
```

Sets the `https://developer.android.com/reference/android/content/res/Resources.Theme.html` against which drop-down views are inflated.

| Parameters |
|---|---|
| `theme: https://developer.android.com/reference/android/content/res/Resources.Theme.html?` | the context against which to inflate drop-down views, or `null` to use the default theme |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/SpinnerAdapter.html#getDropDownView(int, android.view.View, android.view.ViewGroup)` |   |