Skip to content

Instantly share code, notes, and snippets.

@matdziu
Last active November 17, 2016 11:50
Show Gist options
  • Select an option

  • Save matdziu/6858b60f9b322c94e4d90feb27c010a8 to your computer and use it in GitHub Desktop.

Select an option

Save matdziu/6858b60f9b322c94e4d90feb27c010a8 to your computer and use it in GitHub Desktop.
RxSearch.fromSearchView(searchView)
.debounce(300, TimeUnit.MILLISECONDS)
.filter(item -> item.length() > 1)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(query -> {
adapter.setNamesList(namesAPI.searchForName(query));
adapter.notifyDataSetChanged();
apiCallsTextView.setText("API CALLS: " + apiCalls++);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment