lygttpod / SuperTextView

a super textview for android
3.77k stars 591 forks source link

能否设置防止重复点击?如结合RxBinding #59

Closed caojunJackson closed 7 years ago

lygttpod commented 7 years ago

@caojunJackson RxView.clicks传入的是view对象吗,如果是view对象,那么原则上所有继承自view的都支持

caojunJackson commented 7 years ago

但是 supertextview的点击事件是setOnSuperTextViewClickListener() 而不是 setOnClickListener(); 我怎么让RxView监听OnSuperTextViewClickListener事件呢?

lygttpod commented 7 years ago

我试了使用RxView是可以的,以下例子亲测有效

        RxView.clicks(stv)
                .throttleFirst(1, TimeUnit.SECONDS)
                .subscribe(new Consumer<Object>() {
                    @Override
                    public void accept(@NonNull Object o) throws Exception {
                        Log.e("allen", "accept: ");
                    }
                });