Collection of useful RecyclerView functionality for D-pad environments.
- DpadAwareRecyclerView — D-pad friendly extension of
RecyclerView
- Many bugfixes and workarounds for common RecyclerView issues in D-pad environment
- Floating
Drawable
selectors with tunable velocity - Classic
OnItemClickListener
andOnItemSelectedListener
emulations - Classic
setSelection()
andgetSelectedItemPosition()
emulations - Classic
setEnabled()
emulation - Choose between remembering focus and focus natural flow via
setRememberLastFocus()
method
- ExtGridLayoutManager — extension of
GridLayoutManager
- Has
Builder
implementation for construction - Camera offset for selection. E.g. for
0.5
selected view will be centered - Circular navigation (jump from last to first element and vice versa)
AUTO_FIT
support similar to GridView- 'Arrow' views (any views really) indicating begin or end is reached
- It supports
wrap_content
in axis different from specified as orientation. Calculations are based on item's specified width and length
- Has
foregroundSelector
(reference) - drawable resource for foreground floating selectorbackgroundSelector
(reference) - drawable resource for background floating selectorselectorVelocity
(integer) - selector transition velocity in px/sec. When less or equals to 0, transition duration will always be immediate. Default: 0 px/secsmoothScrolling
(boolean) - sets smooth scrolling on or off
Note: you can leave any of these attributes unspecified if you don't want this functionality. Without any of these you should get vanilla RecyclerView behavior (almost).
<net.ganin.darv.DpadAwareRecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:foregroundSelector="@drawable/selector_item_foreground"
app:backgroundSelector="@drawable/selector_item_background"
app:selectorVelocity="1000"
app:smoothScrolling="true">
Feel free to propose additional functionality, bugfixes, documentation enhancements, etc. through pull requests or issues.
General long-term purpose of this library is to become the largest collection of useful functionality and workarounds for TV and other D-pad related devices. So it is appreciated to contribute not only to existing components but to add a new ones that are highly demanded in D-pad environments.