本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例13: onClickFab
import org.simple.eventbus.ThreadMode; //导入依赖的package包/类
@Subscriber(tag = "onFabClick", mode = ThreadMode.POST)
private void onClickFab(View view) {
generateList();
KeyboardUtils.hideSoftInput(getActivity());
}
示例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();
}