当前位置: 首页>>代码示例>>Java>>正文


Java ThreadMode类代码示例

本文整理汇总了Java中org.simple.eventbus.ThreadMode的典型用法代码示例。如果您正苦于以下问题:Java ThreadMode类的具体用法?Java ThreadMode怎么用?Java ThreadMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ThreadMode类属于org.simple.eventbus包,在下文中一共展示了ThreadMode类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过eventbus post事件,远程遥控执行对应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            AppExit();
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:AppManager.java

示例2: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过eventbus post事件,远程遥控执行对应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
}
 
开发者ID:yangxp108,项目名称:MVPArms_Fragment-fragment,代码行数:28,代码来源:AppManager.java

示例3: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过eventbus post事件,远程遥控执行对应方法
 * tag 区分事件类型
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            AppExit();
            break;
    }
}
 
开发者ID:Wan7451,项目名称:mvparms,代码行数:26,代码来源:AppManager.java

示例4: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过 eventbus post 事件,远程遥控执行对应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
    if (mHandleListener != null) {
        mHandleListener.handleMessage(this, message);
    }
}
 
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:31,代码来源:AppManager.java

示例5: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过 {@link EventBus#post(Object)} 事件, 远程遥控执行对应方法
 * 可通过 {@link #setHandleListener(HandleListener)}, 让外部可扩展新的事件
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
    if (mHandleListener != null) {
        mHandleListener.handleMessage(this, message);
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:32,代码来源:AppManager.java

示例6: onMainRefreshButtonClicked

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.HOME_TAB_REFRESH, mode = ThreadMode.MAIN)
public void onMainRefreshButtonClicked(String str) {
    if (this.getUserVisibleHint()) {
        Timber.d("刷新页面 - " + homeTabBean.getName());
        mPresenter.getData(homeTabBean, lastTime, true, 30, false, false);
    }
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:8,代码来源:HomeObjectTabFragment.java

示例7: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * Through the eventbus post event, the remote control performs the corresponding method
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null) {
                break;
            }
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null) {
                break;
            }
            showSnackbar((String) message.obj, message.arg1 != 0);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
    if (mHandleListener != null) {
        mHandleListener.handleMessage(this, message);
    }
}
 
开发者ID:goutham106,项目名称:GmArchMvvm,代码行数:33,代码来源:AppManager.java

示例8: changeAdapterAnimation

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(mode = ThreadMode.MAIN, tag = EventConstant.EVENT_KEY_CHANGE_ADAPTER_ANIMATION)
public void changeAdapterAnimation(int index) {
    if (mAdapter != null) {
        animationIndex = (int) SPUtil.get(mContext, SPConstant.SP_KEY_ACTIVITY_ANIMATION_INDEX, animationIndex - 1) + 1;
        mAdapter.openLoadAnimation(animationIndex);
    }
}
 
开发者ID:AriesHoo,项目名称:FastLib,代码行数:8,代码来源:MovieBaseFragment.java

示例9: changeAdapterAnimationAlways

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(mode = ThreadMode.MAIN, tag = EventConstant.EVENT_KEY_CHANGE_ADAPTER_ANIMATION_ALWAYS)
public void changeAdapterAnimationAlways(boolean always) {
    if (mAdapter != null) {
        animationAlways = (Boolean) SPUtil.get(mContext, SPConstant.SP_KEY_ACTIVITY_ANIMATION_ALWAYS, true);
        mAdapter.isFirstOnly(!animationAlways);
    }
}
 
开发者ID:AriesHoo,项目名称:FastLib,代码行数:8,代码来源:MovieBaseFragment.java

示例10: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过 eventbus post 事件,远程遥控执行对应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null) {
                break;
            }
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null) {
                break;
            }
            showSnackbar((String) message.obj, message.arg1 != 0);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
    if (mHandleListener != null) {
        mHandleListener.handleMessage(this, message);
    }
}
 
开发者ID:xiaobailong24,项目名称:MVVMArms,代码行数:33,代码来源:AppManager.java

示例11: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过EventBus,远程执行相应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null) {
                break;
            }

            if (message.obj instanceof Intent) {
                startActivity((Intent) message.obj);
            } else if (message.obj instanceof Class) {
                startActivity((Class) message.obj);
            }
            break;
        case SNACKER:
            if (message.obj == null) {
                break;
            }

            this.snacker((String) message.obj);
            break;
        case TOASTER:
            if (message.obj == null) {
                break;
            }

            this.toaster((String) message.obj);
            break;
        case KILL:
            kill();
            break;
        case EXIT:
            AppExit();
            break;
        default:
            break;
    }
}
 
开发者ID:RockyQu,项目名称:MVPFrames,代码行数:42,代码来源:AppManager.java

示例12: onReceive

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
/**
 * 通过eventbus post事件,远程遥控执行对应方法
 */
@Subscriber(tag = APPMANAGER_MESSAGE, mode = ThreadMode.MAIN)
public void onReceive(Message message) {
    switch (message.what) {
        case START_ACTIVITY:
            if (message.obj == null)
                break;
            dispatchStart(message);
            break;
        case SHOW_SNACKBAR:
            if (message.obj == null)
                break;
            showSnackbar((String) message.obj, message.arg1 == 0 ? false : true);
            break;
        case KILL_ALL:
            killAll();
            break;
        case APP_EXIT:
            appExit();
            break;
        case SHOW_ALERTVIEW_CENTER:
            Bundle bundle_c = message.getData();
            if (bundle_c == null) return;
            showAlertCenterDialog(bundle_c.getString("title"), bundle_c.getString("msg"), bundle_c.getBoolean("isAccentSureButton"), ((OnClickListener) message.obj));
            break;
        case SHOW_ALERTVIEW_BOTTOM:
            Bundle bundle_b = message.getData();
            if (bundle_b == null) return;
            showAlertBottomDialog(bundle_b.getString("title"), bundle_b.getString("msg")
                    , bundle_b.getStringArray("accentStrs"), bundle_b.getStringArray("strs"), ((OnItemClickListener) message.obj));
            break;
        case SHOW_LOADING:
            Bundle bundle_l = message.getData();
            if (bundle_l == null) return;
            showLoading(bundle_l.getString("msg"),
                    bundle_l.getBoolean("cancleable"), (OnCancelListener) message.obj);
            break;
        case DISSMISSLOADING:
            dissMissLoadingDialog();
            break;
        case SHOW_TOAST:
            if (message.obj == null)
                break;
            showToast((String) message.obj, message.arg1 == 2 ? true : false);
            break;
        default:
            Timber.tag(TAG).w("The message.what not match");
            break;
    }
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:53,代码来源:AppManager.java

示例13: onClickFab

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(tag = "onFabClick", mode = ThreadMode.POST)
private void onClickFab(View view) {
    generateList();
    KeyboardUtils.hideSoftInput(getActivity());
}
 
开发者ID:goutham106,项目名称:GmArchMvvm,代码行数:6,代码来源:RtoFragment.java

示例14: refreshActivityTab

import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(mode = ThreadMode.MAIN, tag = EventConstant.EVENT_KEY_REFRESH_ACTIVITY_TAB)
public void refreshActivityTab(boolean isSliding) {
    mIsFirstShow = true;
    setTitleBar(mTitleBar);
    setTab();
}
 
开发者ID:AriesHoo,项目名称:FastLib,代码行数:7,代码来源:ActivityFragment.java


注:本文中的org.simple.eventbus.ThreadMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。