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


Java Subscriber类代码示例

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


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

示例1: onReceive

import org.simple.eventbus.Subscriber; //导入依赖的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.Subscriber; //导入依赖的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.Subscriber; //导入依赖的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.Subscriber; //导入依赖的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.Subscriber; //导入依赖的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: refrshData

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.REFRESH_HOME_DATA)
public void refrshData(String s){
    if (mSwipeRefresh.isRefreshing()){
        return;
    }
    mSwipeRefresh.setRefreshing(true);
    mPresenter.getIndexVideoList(lastStartId,true,page);
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:9,代码来源:HomeFragment.java

示例7: downloadPending

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.CACHE_DOWNLOAD_PENDING)
private void downloadPending(String id) {
    for (int i = 0; i < data.size(); i++) {
        if (data.get(i).getId().toString().equals(id)) {
            data.get(i).setPending(true);
            adapter.notifyItemChanged(i);
        }
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:10,代码来源:CacheFragment.java

示例8: downloadProgress

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.CACHE_DOWNLOAD_PROGRESS)
private void downloadProgress(DownloadProgressInfo progressInfo) {
    VideoDownLoadInfo item = data.get(currentPosition);
    item.setDownLoading(true);
    item.setPending(false);
    item.setCurrentBytes((long)progressInfo.getCurrentBytes());
    item.setContentLength((long)progressInfo.getContentLength());
    for (int i = 0; i < data.size(); i++) {
        if (data.get(i).getId().toString().equals(progressInfo.getId())) {
            currentPosition = i;
            changePosition = i;
            showDownload(i);
        }
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:CacheFragment.java

示例9: downloadCancel

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.CACHE_DOWNLOAD_CACNCEL)
    private void downloadCancel(Long id) {
//        if (id.equals(-1L)){
        int position = -1;
        for (int i = 0; i < data.size(); i++) {
            if (data.get(i).getId().equals(id)) {
                position = i;
            }
        }
        if (position >= 0) {
            if (data.get(position).getDownLoading()) {
                hideDownload(position);
            } else {
                showDownload(position);
                Intent intent = new Intent(getActivity(), DownLoadService.class);
                intent.putExtra(DownLoadService.VIDEOS_INFO, data.get(position));
                intent.putExtra(DownLoadService.VIDEOS_INSERT, false);
                getActivity().startService(intent);
            }
        }

//        }else {
//            for (int i=0;i<data.size();i++){
//                if (data.get(i).getId().equals(id)){
//                    currentPosition = i;
//                    changePosition = i;
//                    data.get(i).setLineUp(false);
//                }
//            }
//            showDownload();
//        }

    }
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:34,代码来源:CacheFragment.java

示例10: downloadBegin

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.CACHE_DOWNLOAD_BEGIN)
private void downloadBegin(VideoDownLoadInfo info) {
    Timber.e("-------------getSticky");
    for (int i = 0; i < data.size(); i++) {
        if (data.get(i).getId().equals(info.getId())) {
            currentPosition = i;
            changePosition = i;
            data.get(i).setLineUp(true);
            adapter.notifyItemChanged(i);
        }
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:13,代码来源:CacheFragment.java

示例11: setUserInfo

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.SET_USER_INFO)
public void setUserInfo(User user) {
    mTvName.setText(User.getCurrentUser().getUsername());
    if (user.getIcon() != null){
        BmobFile file = user.getIcon();
        appComponent.imageLoader().loadImage(getActivity(), ImageConfigImpl
                .builder()
                .url(file.getFileUrl())
                .imageView(mCivFace)
                .dontAnimate(true)
                .placeholder(R.drawable.ic_noface)
                .errorPic(R.drawable.ic_noface)
                .build());
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:MineFragment.java

示例12: setUserInfo

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.SET_USER_INFO)
public void setUserInfo(User user) {
    if (!"all".equals(type) && user != null) {
        mPresenter.getMyAttentionList(user.getObjectId());
        mSwipeRefresh.setEnabled(true);
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:8,代码来源:AttentionFragment.java

示例13: startAnimate

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.HIDE_RECYCLERVIEW)
public void startAnimate(View view,boolean isShow) {
    if (isShow) {
        AnimationUtils.startTranslate(view, 0, dragBottomView.getHeight()
                , 0, 0, 200, true);
        setSwipeBackEnable(false);

    } else {
        AnimationUtils.startTranslate(view, 0, 0
                , 0, dragBottomView.getHeight(), 200, false);
        setSwipeBackEnable(true);
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:14,代码来源:VideoDetailActivity.java

示例14: goToHomePage

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.JUMP_TO_HOME)
    public void goToHomePage(String s) {
        if (isAnimated){
            Intent intent = new Intent(this, MainActivity.class);
            startActivity(intent);
//            TRouter.go(Constants.MAIN);
            finish();
        }
    }
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:10,代码来源:SplashActivity.java

示例15: setUserInfo

import org.simple.eventbus.Subscriber; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.SET_USER_INFO)
public void setUserInfo(User user) {
    CircleImageView img = (CircleImageView) mNvMainNavigation.getHeaderView(0).findViewById(R.id.im_face);
    TextView name = (TextView) mNvMainNavigation.getHeaderView(0).findViewById(R.id.tv_name);
    name.setText(User.getCurrentUser().getUsername());
    if (user.getIcon() != null) {
        appComponent.imageLoader().loadImage(this,
                ImageConfigImpl
                        .builder()
                        .transformation(new GlideCircleTransform())
                        .url(user.getIcon().getFileUrl())
                        .errorPic(R.drawable.ic_noface)
                        .dontAnimate(true)
                        .imageView(img)
                        .build());
    }
    BmobQuery<MyAttentionEntity> query = new BmobQuery<MyAttentionEntity>();
    query.addWhereEqualTo("userId", BmobUser.getCurrentUser().getObjectId());
    query.order("-createdAt");
    query.findObjects(new FindListener<MyAttentionEntity>() {
        @Override
        public void done(List<MyAttentionEntity> list, BmobException e) {
            appComponent.extras().put(Constants.CACHE_FOLLOWED_INFO,list);
        }
    });

}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:28,代码来源:MainActivity.java


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