當前位置: 首頁>>代碼示例>>Java>>正文


Java Event類代碼示例

本文整理匯總了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();
                }
            });
}
 
開發者ID:Piasy,項目名稱:AndroidPlayground,代碼行數:26,代碼來源:BaseNaviPlugin.java

示例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")));
    }
}
 
開發者ID:Piasy,項目名稱:AndroidPlayground,代碼行數:15,代碼來源:YLQrCodeDecoder.java

示例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);
}
 
開發者ID:ezhome,項目名稱:Android-RxPresenter,代碼行數:9,代碼來源:RxPresenter.java

示例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);
}
 
開發者ID:ezhome,項目名稱:Android-RxPresenter,代碼行數:9,代碼來源:RxPresenter.java

示例5: handlesEvents

import com.trello.navi.Event; //導入依賴的package包/類
@Override
public final boolean handlesEvents(Event... events) {
    return mNaviEmitter.handlesEvents(events);
}
 
開發者ID:Piasy,項目名稱:AndroidPlayground,代碼行數:5,代碼來源:MainActivity.java

示例6: addListener

import com.trello.navi.Event; //導入依賴的package包/類
@Override
public final <T> void addListener(Event<T> event, Listener<T> listener) {
    mNaviEmitter.addListener(event, listener);
}
 
開發者ID:Piasy,項目名稱:AndroidPlayground,代碼行數:5,代碼來源:MainActivity.java


注:本文中的com.trello.navi.Event類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。