rx-java - 当我们使用 RxJava 限制视图点击时,限制方法调用
问题描述
有没有办法限制方法调用,即只在某个窗口持续时间内接受第一个事件。我见过 RxBinding 的例子,比如
RxView.clicks(mButton)
.throttleFirst(300, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
.subscribe(...);
我怎样才能对方法进行上述操作?
解决方案
在 RxJava2 中有这样的运算符 - http://reactivex.io/documentation/operators/sample.html
推荐阅读
- filesystems - 是否可以从 Service Worker 使用 webkitRequestFileSystem?
- matlab - 为什么我的 GUI 中的 uitable 元素偶尔会在 MATLAB 中丢失?
- pyspark - 如何像在 SAS 中一样在 PySpark 中创建多列添加 if then do 语句(没有别的)?
- javascript - 来自 C# 的 Highcharts 范围选择器日期格式
- html - 无法在网页上获得等间距的边距
- linux - Android Studio 看不到 Chrome 设备
- java - 从将为参数类型调用的 Java 类获取构造函数,不需要精确的参数和参数类型匹配
- c++ - C++:遍历字符串向量并使用 putenv 的索引
- python - 将 TensorFlow 1x 迁移到 TensorFlow 2x
- triggers - Odoo如何从制造订单触发套件采购订单