本文整理匯總了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);
}