android-searchbox  v0.0.1
A multi-purpose search widget which works both with offline and online databases(Appbase or ElasticSearch cluster). The search widget contains multiple functionalities like Voice Search, Smart Search, Analytics, etc.
All Classes Functions
com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter Class Reference
Inheritance diagram for com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter:

Classes

interface  OnItemViewClickListener
 
interface  RecyclerItemClickListener
 
interface  RedirectClickListener
 

Public Member Functions

 DefaultClientSuggestionsAdapter (ArrayList< ClientSuggestionsModel > suggestions, String queryText, boolean shouldHighlight, boolean showHits, boolean searchResultImage, boolean redirectIcon)
 
 DefaultClientSuggestionsAdapter (ArrayList< ClientSuggestionsModel > suggestions, String queryText, boolean shouldHighlight, boolean showHits, boolean searchResultImage, boolean redirectIcon, int topEntries)
 
 DefaultClientSuggestionsAdapter (ArrayList< ClientSuggestionsModel > suggestions, int customCategoriesCount, String queryText, boolean shouldHighlight, boolean showHits, boolean searchResultImage, boolean redirectIcon)
 
ClientSuggestionsViewHolder onCreateViewHolder (ViewGroup parent, int viewType)
 
void onBindViewHolder (@NonNull ClientSuggestionsViewHolder holder, final int position)
 
int getItemCount ()
 
void onAttachedToRecyclerView (RecyclerView recyclerView)
 
void insert (int position, ClientSuggestionsModel data)
 
void remove (ClientSuggestionsModel data)
 
void clear ()
 
ClientSuggestionsModel getItem (int position)
 
void setOnRedirectClickListener (RedirectClickListener redirectClickListener)
 
void setRecyclerItemClickListener (RecyclerItemClickListener recyclerItemClickListener)
 

Constructor & Destructor Documentation

◆ DefaultClientSuggestionsAdapter() [1/3]

com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.DefaultClientSuggestionsAdapter ( ArrayList< ClientSuggestionsModel suggestions,
String  queryText,
boolean  shouldHighlight,
boolean  showHits,
boolean  searchResultImage,
boolean  redirectIcon 
)

Initiates DefaultClientSuggestionsAdapter with default topEntries parameter Using this constructor, no categories for any search results will be shown

Parameters
suggestionsList of suggestions to be added
queryTextThe text which is queried/written in the search bar
shouldHighlightShould highlight the queried text or not
showHitsShould show number of hits or not
searchResultImageWhether to show search image/icon before search results/suggestions
redirectIconWhether to show redirect icon for every search result entry

◆ DefaultClientSuggestionsAdapter() [2/3]

com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.DefaultClientSuggestionsAdapter ( ArrayList< ClientSuggestionsModel suggestions,
String  queryText,
boolean  shouldHighlight,
boolean  showHits,
boolean  searchResultImage,
boolean  redirectIcon,
int  topEntries 
)

Initiates DefaultClientSuggestionsAdapter

Parameters
suggestionsList of suggestions to be added
queryTextThe text which is queried/written in the search bar
shouldHighlightShould highlight the queried text or not
showHitsShould show number of hits or not
searchResultImageWhether to show search image/icon before search results/suggestions
redirectIconWhether to show redirect icon for every search result entry
topEntriesNumber of entries for which categories needs to be shown under search result

◆ DefaultClientSuggestionsAdapter() [3/3]

com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.DefaultClientSuggestionsAdapter ( ArrayList< ClientSuggestionsModel suggestions,
int  customCategoriesCount,
String  queryText,
boolean  shouldHighlight,
boolean  showHits,
boolean  searchResultImage,
boolean  redirectIcon 
)

Initiates DefaultClientSuggestionsAdapter with separate results for categories

Parameters
suggestionsList of suggestions to be added
customCategoriesCountNumber of extra search results to be added on top for categorical search
queryTextThe text which is queried/written in the search bar
shouldHighlightShould highlight the queried text or not
showHitsShould show number of hits or not
searchResultImageWhether to show search image/icon before search results/suggestions
redirectIconWhether to show redirect icon for every search result entry

Member Function Documentation

◆ clear()

void com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.clear ( )

Clears all items in adapter

◆ getItem()

ClientSuggestionsModel com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.getItem ( int  position)

Get search result at given position

Parameters
positionPosition of the search item to be returned
Returns
Search item in form ClientSuggestionsModel

◆ getItemCount()

int com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.getItemCount ( )

Returns the number of elements the RecyclerView will display

◆ insert()

void com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.insert ( int  position,
ClientSuggestionsModel  data 
)

Inserts an item in DefaultClientSuggestionsAdapter

Parameters
positionPosition where the item needs to be added
dataItem that needs to be added

◆ onAttachedToRecyclerView()

void com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.onAttachedToRecyclerView ( RecyclerView  recyclerView)

Attaches recycler view to parent view

◆ remove()

void com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.remove ( ClientSuggestionsModel  data)

Deletes an item from DefaultClientSuggestionsAdapter

Parameters
dataItem that needs to be deleted

◆ setOnRedirectClickListener()

void com.harsh.searchwidget.Adapter.DefaultClientSuggestionsAdapter.setOnRedirectClickListener ( RedirectClickListener  redirectClickListener)

Registers listener for redirect icon click callbacks

Parameters
redirectClickListenerRedirect icon click callbacks

The documentation for this class was generated from the following file: