RxView.clicks(activityNewsButton) .throttleLast(1000,TimeUnit.MICROSECONDS) .subscribe(new Action1<Void>() { @Override public void call(Void aVoid) { System.out.println("click"); } });
經(jīng)過(guò)調(diào)試,這樣子還是會(huì)輸出很多個(gè)click,好像并沒(méi)有成功防抖動(dòng),為什么
還有compoundbutton也不能實(shí)現(xiàn)這個(gè)功能
RxCompoundButton.checkedChanges(schoolBusSwitchButton) .throttleLast(1000, TimeUnit.MICROSECONDS) .subscribe(new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { System.out.println("switch"); } });