Skip to content

Commit

Permalink
fix: filter empty texts in search debouncer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaushik Gopal committed Apr 8, 2016
1 parent d15f57c commit e526882
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -72,6 +72,12 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {

_subscription = RxTextView.textChangeEvents(_inputSearchText)//
.debounce(400, TimeUnit.MILLISECONDS)// default Scheduler is Computation
.filter(new Func1<TextViewTextChangeEvent, Boolean>() {
@Override
public Boolean call(TextViewTextChangeEvent changes) {
return CoreNullnessUtils.isNotNullOrEmpty(_inputSearchText.getText().toString());
}
})
.observeOn(AndroidSchedulers.mainThread())//
.subscribe(_getSearchObserver());
}
Expand Down

0 comments on commit e526882

Please sign in to comment.