RxView.clicks(activityNewsButton) .throttleLast(1000,TimeUnit.MICROSECONDS) .subscribe(new Action1<Void>() { @Override public void call(Void aVoid) { System.out.println("click"); } });
经过调试,这样子还是会输出很多个click,好像并没有成功防抖动,为什么
还有compoundbutton也不能实现这个功能
RxCompoundButton.checkedChanges(schoolBusSwitchButton) .throttleLast(1000, TimeUnit.MICROSECONDS) .subscribe(new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { System.out.println("switch"); } });
throttleFirst
一周热门 更多>