arimorty / floatingsearchview

A search view that implements a floating search bar also known as persistent search
https://github.com/arimorty/floatingsearchview/blob/master/README.md
Apache License 2.0
3.54k stars 668 forks source link

Search touched event #297

Closed ghost closed 6 years ago

ghost commented 6 years ago

I was trying to find the event for when user clicks on search text to write something but trying some of events wasn't successful. is there any event for this? (I want to use this event to open Google places selection activity.)

jasontrask commented 6 years ago

Setting the onFocusChangeListener should help you here...

mFloatingSearchView.setOnFocusChangeListener(new FloatingSearchView.OnFocusChangeListener() {
  @Override
  public void onFocus() {
    System.out.println(" >>> Focus...");
  }

  @Override
  public void onFocusCleared() {
    System.out.println(" >>> Focus cleared...");
  }
});
ghost commented 6 years ago

@jasontrask Thanks. it seems there were two FocusEvent listeners and i have tried the other one and it wasn't working.