Class SimpleQueryBinderAdapter<T,Q,VB extends DynamicRecyclerViewBinder<?>>
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<VH>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicRecyclerViewAdapter<RecyclerView.ViewHolder>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicBinderAdapter<VB>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicSimpleBinderAdapter<VB>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.factory.SimpleDataBinderAdapter<T,VB>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.factory.SimpleQueryBinderAdapter<T,Q,VB>
- Type Parameters:
T
- The type of the data this adapter will receive.Q
- The type of the query this adapter will receive.VB
- The type of the dynamic recycler view binder.
- All Implemented Interfaces:
Filterable
public abstract class SimpleQueryBinderAdapter<T,Q,VB extends DynamicRecyclerViewBinder<?>>
extends SimpleDataBinderAdapter<T,VB>
implements Filterable
A
SimpleDataBinderAdapter
to handle the generic data with query that can be used
with the DynamicQueryBinder
.-
Nested Class Summary
Nested classes/interfaces inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicRecyclerViewAdapter
DynamicRecyclerViewAdapter.DynamicRecyclerViewItem, DynamicRecyclerViewAdapter.ItemType
-
Field Summary
Fields inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicRecyclerViewAdapter
TYPE_EMPTY_VIEW, TYPE_ITEM, TYPE_SECTION_DIVIDER, TYPE_SECTION_HEADER, TYPE_SETTING, TYPE_UNKNOWN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetQuery()
Get the query used by this binder adapter.Get the raw data used by this binder adapter.boolean
Checks whether this adapter has raw data.protected abstract T
Ths method will be called on filtering the data.protected void
onPublishResults
(T data, Q query) Ths method will be called on publishing the results.protected abstract Q
onQuery
(CharSequence constraint) Ths method will be called on building the query for the filter.void
Set the data for this binder adapter.void
Set the data for this binder adapter.void
Set the data and query for this binder adapter.void
Set the data and query for this binder adapter.void
Set the query for this binder adapter.Methods inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.factory.SimpleDataBinderAdapter
getData, getItemCount
Methods inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicSimpleBinderAdapter
addDataBinder, addDataBinders, addDataBinders, getBinderList, getBinderPosition, getDataBinder, getItemViewType, getPosition, notifyBinderItemRangeChanged, notifyBinderItemRangeInserted, notifyBinderItemRangeRemoved
Methods inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicBinderAdapter
notifyBinderDataSetChanged, notifyBinderItemChanged, notifyBinderItemInserted, notifyBinderItemMoved, notifyBinderItemRemoved, onBindViewHolder, onCreateViewHolder
Methods inherited from class com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicRecyclerViewAdapter
getContext, getLayoutManager, getRecyclerView, isComputingLayout, onAttachedToRecyclerView
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemId, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
-
Constructor Details
-
SimpleQueryBinderAdapter
public SimpleQueryBinderAdapter()
-
-
Method Details
-
getRawData
Get the raw data used by this binder adapter.- Returns:
- The raw data used by this binder adapter.
-
isRawData
public boolean isRawData()Checks whether this adapter has raw data.- Returns:
true
if this adapter has raw data.
-
setData
Set the data and query for this binder adapter.- Parameters:
data
- The data to be set.query
- The query to be set.filtered
-true
if the filtered data.
-
setData
Set the data and query for this binder adapter.- Parameters:
data
- The data to be set.query
- The query to be set.- See Also:
-
setData
Description copied from class:SimpleDataBinderAdapter
Set the data for this binder adapter.- Overrides:
setData
in classSimpleDataBinderAdapter<T,
VB extends DynamicRecyclerViewBinder<?>> - Parameters:
data
- The data to be set.
-
setData
Description copied from class:SimpleDataBinderAdapter
Set the data for this binder adapter.- Overrides:
setData
in classSimpleDataBinderAdapter<T,
VB extends DynamicRecyclerViewBinder<?>> - Parameters:
data
- The data to be set.position
- The binder position to be notified.
-
getQuery
Get the query used by this binder adapter.- Returns:
- The query used by this binder adapter.
-
setQuery
Set the query for this binder adapter.- Parameters:
query
- The query to be set.
-
onQuery
Ths method will be called on building the query for the filter.- Parameters:
constraint
- The constraint returned by the filter.- Returns:
- The query according to the constraint returned by the filter.
-
onFilter
Ths method will be called on filtering the data.- Parameters:
data
- The data to be filtered.query
- The query returned by the filter.- Returns:
- The filtered data according to the supplied query,
-
onPublishResults
Ths method will be called on publishing the results.- Parameters:
data
- The data returned by the filter.query
- The query returned by the filter.
-
getFilter
- Specified by:
getFilter
in interfaceFilterable
-