本文整理汇总了Java中com.trello.navi.Event类的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于com.trello.navi包,在下文中一共展示了Event类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BaseNaviPlugin
import com.trello.navi.Event; //导入依赖的package包/类
public BaseNaviPlugin(NaviComponent naviComponent) {
mNaviComponent = naviComponent;
mSubscriptionUtilDestroy = new CompositeSubscription();
// 注意!!! 下面的几个 action 不要改成 lambda 表达式,retrolambda 已经踩到坑了,会乱套
// 但其他地方呢?细思极恐。。。
RxNavi.observe(mNaviComponent, Event.DESTROY)
.subscribe(aVoid -> {
Log.d("YLQrCodeDecoder", "DESTROY");
mSubscriptionUtilDestroy.unsubscribe();
});
RxNavi.observe(mNaviComponent, Event.START)
.subscribe(aVoid -> {
if (mSubscriptionUtilStop != null && !mSubscriptionUtilStop.isUnsubscribed()) {
mSubscriptionUtilStop.unsubscribe();
}
mSubscriptionUtilStop = new CompositeSubscription();
});
RxNavi.observe(mNaviComponent, Event.STOP)
.subscribe(aVoid -> {
if (mSubscriptionUtilStop != null && !mSubscriptionUtilStop.isUnsubscribed()) {
mSubscriptionUtilStop.unsubscribe();
}
});
}
示例2: YLQrCodeDecoder
import com.trello.navi.Event; //导入依赖的package包/类
public YLQrCodeDecoder(NaviComponent naviComponent, boolean scanFromCamera) {
super(naviComponent);
if (scanFromCamera) {
// 注意!!! 下面的几个 action 不要改成 lambda 表达式,retrolambda 已经踩到坑了,会乱套
// 但其他地方呢?细思极恐。。。
addUtilDestroy(Observable.just(true)
.subscribe(mScanResult));
addUtilDestroy(RxNavi.observe(mNaviComponent, Event.RESUME)
.subscribe(aVoid -> Log.d("YLQrCodeDecoder", "RESUME")));
addUtilDestroy(RxNavi.observe(mNaviComponent, Event.PAUSE)
.subscribe(aVoid -> Log.d("YLQrCodeDecoder", "PAUSE")));
}
}
示例3: initFragment
import com.trello.navi.Event; //导入依赖的package包/类
/**
* Used to follow the lifecycle and bind the view
*/
@SuppressWarnings("unchecked") private void initFragment() {
this.mvpView = (MvpView) naviComponent;
this.lifecycleProvider = NaviLifecycle.createFragmentLifecycleProvider(naviComponent);
this.initCommon(Event.VIEW_CREATED);
}
示例4: initActivity
import com.trello.navi.Event; //导入依赖的package包/类
/**
* Used to follow the lifecycle and bind the view
*/
@SuppressWarnings("unchecked") private void initActivity() {
this.mvpView = (MvpView) naviComponent;
this.lifecycleProvider = NaviLifecycle.createActivityLifecycleProvider(naviComponent);
this.initCommon(Event.START);
}
示例5: handlesEvents
import com.trello.navi.Event; //导入依赖的package包/类
@Override
public final boolean handlesEvents(Event... events) {
return mNaviEmitter.handlesEvents(events);
}
示例6: addListener
import com.trello.navi.Event; //导入依赖的package包/类
@Override
public final <T> void addListener(Event<T> event, Listener<T> listener) {
mNaviEmitter.addListener(event, listener);
}