ThemedSpinnerAdapter


public interface ThemedSpinnerAdapter extends SpinnerAdapter


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 setDropDownViewTheme when creating views in getDropDownView.

The Helper class is provided to aide implementation in a backwards compatible way.

Summary

Nested types

public final class ThemedSpinnerAdapter.Helper

A helper class which allows easy integration of ThemedSpinnerAdapter into existing SpinnerAdapters in a backwards compatible way.

Public methods

abstract @Nullable Resources.Theme

Returns the value previously set by a call to setDropDownViewTheme.

abstract void

Sets the Resources.Theme against which drop-down views are inflated.

Inherited Constants

From android.widget.Adapter
default static final int
default static final int
NO_SELECTION = -2147483648

Inherited methods

From android.widget.Adapter
default CharSequence[]
abstract int
abstract Object
getItem(int p)
abstract long
getItemId(int p)
abstract int
abstract View
getView(int p, View p1, ViewGroup p2)
abstract int
abstract boolean
abstract boolean
abstract void
abstract void
From android.widget.SpinnerAdapter
abstract View
getDropDownView(int p, View p1, ViewGroup p2)

Public methods

getDropDownViewTheme

Added in 1.1.0
abstract @Nullable Resources.Theme getDropDownViewTheme()

Returns the value previously set by a call to setDropDownViewTheme.

Returns
@Nullable Resources.Theme

the Resources.Theme against which drop-down views are inflated, or null if one has not been explicitly set

setDropDownViewTheme

Added in 1.1.0
abstract void setDropDownViewTheme(@Nullable Resources.Theme theme)

Sets the Resources.Theme against which drop-down views are inflated.

Parameters
@Nullable Resources.Theme theme

the context against which to inflate drop-down views, or null to use the default theme

See also
getDropDownView