ngajay
12/8/2017 - 5:23 AM

Detect DoubleClick using RxView

RxView Double Click

Observable<Object> clicks = RxView.clicks(view);
Observable<List<Object>> clickAggregate = clicks.buffer(300, TimeUnit.MILLISECONDS);
Observable<List<Object>> doubleClicks = clickAggregate.filter(list -> list.size() >= 2);

doubleClicks.subscribe(o -> {
  Log.d("Clicks","Received double click")
})