MaterialSearchBar icon indicating copy to clipboard operation
MaterialSearchBar copied to clipboard

click listener of the Suggestion Items.

Open SubhasmithThapa25 opened this issue 6 years ago • 3 comments

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

SubhasmithThapa25 avatar Feb 21 '18 10:02 SubhasmithThapa25

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

tomaculum avatar Mar 05 '18 14:03 tomaculum

Thank You. That Helped.

SubhasmithThapa25 avatar Mar 09 '18 09:03 SubhasmithThapa25

How to close the suggestions list after clicking the one item of suggestion

lisumac avatar Mar 14 '19 02:03 lisumac