MaterialSearchBar
MaterialSearchBar copied to clipboard
click listener of the Suggestion Items.
How to implement the click listener of the Suggestion Items. ? I made an interface to implement the click listener of the suggested items. But on narrowing down to some search. And clicking on it causes to still take the position from the original list. Please let me know
Most likely this is a unnecessary complicated workaround but I have implemented it with a additional public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener
like this one in section 6 step 12.
After adding this RecyclerTouchListener
class to your project, set the on touch listener:
RecyclerView searchrv = findViewById(R.id.mt_recycler);
searchrv.addOnItemTouchListener(new RecyclerTouchListener(getApplicationContext(), searchrv, new RecyclerTouchListener.ClickListener() {
@Override
public void onClick(View view, int position) {
}
@Override
public void onLongClick(View view, int position) {
}
}));
Edit: Similar closed Issues: #33 #23
Thank You. That Helped.
How to close the suggestions list after clicking the one item of suggestion