本文整理汇总了Java中com.example.jingbin.cloudreader.http.rx.RxBus类的典型用法代码示例。如果您正苦于以下问题:Java RxBus类的具体用法?Java RxBus怎么用?Java RxBus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RxBus类属于com.example.jingbin.cloudreader.http.rx包,在下文中一共展示了RxBus类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRxBus
import com.example.jingbin.cloudreader.http.rx.RxBus; //导入依赖的package包/类
/**
* 每日推荐点击"更多"跳转
*/
private void initRxBus() {
Subscription subscription = RxBus.getDefault().toObservable(RxCodeConstants.JUMP_TYPE, Integer.class)
.subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
if (integer == 0) {
bindingView.vpGank.setCurrentItem(3);
} else if (integer == 1) {
bindingView.vpGank.setCurrentItem(1);
} else if (integer == 2) {
bindingView.vpGank.setCurrentItem(2);
}
}
});
addSubscription(subscription);
}
示例2: initRxBus
import com.example.jingbin.cloudreader.http.rx.RxBus; //导入依赖的package包/类
/**
* 每日推荐点击"新电影热映榜"跳转
*/
private void initRxBus() {
RxBus.getDefault().toObservable(RxCodeConstants.JUMP_TYPE_TO_ONE, RxBusBaseMessage.class)
.subscribe(new Action1<RxBusBaseMessage>() {
@Override
public void call(RxBusBaseMessage integer) {
mBinding.include.vpContent.setCurrentItem(1);
}
});
}
示例3: onBindViewHolder
import com.example.jingbin.cloudreader.http.rx.RxBus; //导入依赖的package包/类
@Override
public void onBindViewHolder(List<AndroidBean> object, final int position) {
int index = 0;
String title = object.get(0).getType_title();
binding.tvTitleType.setText(title);
if ("Android".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_android));
index = 0;
} else if ("福利".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_meizi));
index = 1;
} else if ("IOS".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_ios));
index = 2;
} else if ("休息视频".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_movie));
index = 2;
} else if ("拓展资源".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_source));
index = 2;
} else if ("瞎推荐".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_xia));
index = 2;
} else if ("前端".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_qian));
index = 2;
} else if ("App".equals(title)) {
binding.ivTitleType.setImageDrawable(CommonUtils.getDrawable(R.drawable.home_title_app));
index = 2;
}
if (position != 0) {
binding.viewLine.setVisibility(View.VISIBLE);
} else {
binding.viewLine.setVisibility(View.GONE);
}
final int finalIndex = index;
binding.llTitleMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RxBus.getDefault().post(RxCodeConstants.JUMP_TYPE, finalIndex);
}
});
}
示例4: initRxBus
import com.example.jingbin.cloudreader.http.rx.RxBus; //导入依赖的package包/类
/**
* 每日推荐点击"新电影热映榜"跳转
*/
private void initRxBus() {
Subscription subscribe = RxBus.getDefault().toObservable(RxCodeConstants.JUMP_TYPE_TO_ONE, RxBusBaseMessage.class)
.subscribe(integer -> mBinding.include.vpContent.setCurrentItem(1));
addSubscription(subscribe);
}