belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1
ThemedSpinnerAdapter.Helper
public
static
final
class
ThemedSpinnerAdapter.Helper
extends Object
java.lang.Object | |
↳ | android.support.v7.widget.ThemedSpinnerAdapter.Helper |
A helper class which allows easy integration of ThemedSpinnerAdapter
into existing
SpinnerAdapter
s in a backwards compatible way.
An example BaseAdapter
implementation would be:
public class MyAdapter extends BaseAdapter implements ThemedSpinnerAdapter { private final ThemedSpinnerAdapter.Helper mDropDownHelper; public CheeseAdapter(Context context) { mDropDownHelper = new ThemedSpinnerAdapter.Helper(context); // ... } @Override public View getDropDownView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { // Inflate the drop down using the helper's LayoutInflater LayoutInflater inflater = mDropDownHelper.getDropDownViewInflater(); view = inflater.inflate(R.layout.my_dropdown, parent, false); } // ... } @Override public void setDropDownViewTheme(@Nullable Resources.Theme theme) { // Pass the new theme to the helper mDropDownHelper.setDropDownViewTheme(theme); } @Override public Resources.Theme getDropDownViewTheme() { // Return the helper's value return mDropDownHelper.getDropDownViewTheme(); } }
Summary
Public constructors | |
---|---|
ThemedSpinnerAdapter.Helper(Context context)
|
Public methods | |
---|---|
LayoutInflater
|
getDropDownViewInflater()
Returns the |
Resources.Theme
|
getDropDownViewTheme()
Should be called from your adapter's |
void
|
setDropDownViewTheme(Resources.Theme theme)
Should be called from your adapter's
|
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public constructors
ThemedSpinnerAdapter.Helper
ThemedSpinnerAdapter.Helper (Context context)
Parameters | |
---|---|
context |
Context |
Public methods
getDropDownViewInflater
LayoutInflater getDropDownViewInflater ()
Returns the LayoutInflater
which should be used when inflating any layouts
from your getDropDownView(int, View, ViewGroup)
.
The instance returned will have a correct theme, meaning that any inflated views will be created with the same theme.
Returns | |
---|---|
LayoutInflater |
getDropDownViewTheme
Resources.Theme getDropDownViewTheme ()
Should be called from your adapter's getDropDownViewTheme()
,
returning the value returned from this method.
Returns | |
---|---|
Resources.Theme |
setDropDownViewTheme
void setDropDownViewTheme (Resources.Theme theme)
Should be called from your adapter's
setDropDownViewTheme(Theme)
Parameters | |
---|---|
theme |
Resources.Theme : the theme passed in to
setDropDownViewTheme(Theme)
|
Annotations
Interfaces
- ActionMenuView.OnMenuItemClickListener
- PopupMenu.OnDismissListener
- PopupMenu.OnMenuItemClickListener
- RecyclerView.ChildDrawingOrderCallback
- RecyclerView.ItemAnimator.ItemAnimatorFinishedListener
- RecyclerView.LayoutManager.LayoutPrefetchRegistry
- RecyclerView.OnChildAttachStateChangeListener
- RecyclerView.OnItemTouchListener
- RecyclerView.RecyclerListener
- RecyclerView.SmoothScroller.ScrollVectorProvider
- SearchView.OnCloseListener
- SearchView.OnQueryTextListener
- SearchView.OnSuggestionListener
- ShareActionProvider.OnShareTargetSelectedListener
- ThemedSpinnerAdapter
- Toolbar.OnMenuItemClickListener
Classes
- ActionMenuView
- ActionMenuView.LayoutParams
- AppCompatAutoCompleteTextView
- AppCompatButton
- AppCompatCheckBox
- AppCompatCheckedTextView
- AppCompatEditText
- AppCompatImageButton
- AppCompatImageView
- AppCompatMultiAutoCompleteTextView
- AppCompatRadioButton
- AppCompatRatingBar
- AppCompatSeekBar
- AppCompatSpinner
- AppCompatTextView
- CardView
- DefaultItemAnimator
- DividerItemDecoration
- GridLayout
- GridLayout.Alignment
- GridLayout.LayoutParams
- GridLayout.Spec
- GridLayoutManager
- GridLayoutManager.DefaultSpanSizeLookup
- GridLayoutManager.LayoutParams
- GridLayoutManager.SpanSizeLookup
- LinearLayoutCompat
- LinearLayoutCompat.LayoutParams
- LinearLayoutManager
- LinearLayoutManager.LayoutChunkResult
- LinearSmoothScroller
- LinearSnapHelper
- ListPopupWindow
- OrientationHelper
- PagerSnapHelper
- PopupMenu
- RecyclerView
- RecyclerView.Adapter
- RecyclerView.AdapterDataObserver
- RecyclerView.EdgeEffectFactory
- RecyclerView.ItemAnimator
- RecyclerView.ItemAnimator.ItemHolderInfo
- RecyclerView.ItemDecoration
- RecyclerView.LayoutManager
- RecyclerView.LayoutManager.Properties
- RecyclerView.LayoutParams
- RecyclerView.OnFlingListener
- RecyclerView.OnScrollListener
- RecyclerView.RecycledViewPool
- RecyclerView.Recycler
- RecyclerView.SimpleOnItemTouchListener
- RecyclerView.SmoothScroller
- RecyclerView.SmoothScroller.Action
- RecyclerView.State
- RecyclerView.ViewCacheExtension
- RecyclerView.ViewHolder
- RecyclerViewAccessibilityDelegate
- RecyclerViewAccessibilityDelegate.ItemDelegate
- SearchView
- ShareActionProvider
- SimpleItemAnimator
- SnapHelper
- StaggeredGridLayoutManager
- StaggeredGridLayoutManager.LayoutParams
- SwitchCompat
- ThemedSpinnerAdapter.Helper
- Toolbar
- Toolbar.LayoutParams
- Toolbar.SavedState
- TooltipCompat