I need to implement a search interface in my Android app that would filter several RecyclerView
inside a ViewPager
.
I have already implemented both EditText
and SearchView
widgets and try to see differences.
The listeners i am interrested in are :
myEditText.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {}
});
And :
mySearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextChange(String newText) {
textView.setText(newText);
return true;
}
@Override
public boolean onQueryTextSubmit(String query) {
textView.setText(query);
return true;
}
Am i missing some important features that
SearchView
would allow & thatEditText
does not ?With both of these widgets, Am i able to search among
RecyclerView
s insideViewPager
with a single "search-view" ?
I don't want an ACTION_SEARCH
or any added dialog view for the search.
Thanks in advance !