The buffer observable allows taps to be collected only within a time span. So taps outside the 33 | * 2s limit imposed by buffer will get accumulated in the next log statement. 34 | * 35 | *
If you're looking for a more foolproof solution that accumulates "continuous" taps vs a more 36 | * dumb solution as show below (i.e. number of taps within a timespan) look at {@link 37 | * com.morihacky.android.rxjava.rxbus.RxBusDemo_Bottom3Fragment} where a combo of `publish` and 38 | * `buffer` is used. 39 | * 40 | *
Also http://nerds.weddingpartyapp.com/tech/2015/01/05/debouncedbuffer-used-in-rxbus-example/
41 | * if you're looking for words instead of code
42 | */
43 | public class BufferDemoFragment extends BaseFragment {
44 |
45 | @BindView(R.id.list_threading_log)
46 | ListView _logsList;
47 |
48 | @BindView(R.id.btn_start_operation)
49 | Button _tapBtn;
50 |
51 | private LogAdapter _adapter;
52 | private List 1. onCompleted 2. onError 3. onNext
93 | */
94 | private DisposableObserver>() {
104 |
105 | @Override
106 | public void onComplete() {
107 | // fyi: you'll never reach here
108 | Timber.d("----- onCompleted");
109 | }
110 |
111 | @Override
112 | public void onError(Throwable e) {
113 | Timber.e(e, "--------- Woops on error!");
114 | _log("Dang error! check your logs");
115 | }
116 |
117 | @Override
118 | public void onNext(List