• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Subscribe类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCategoryDeleteEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onCategoryDeleteEvent(CategoryDeleteEvent categoryDeleteEvent) {
    mRxCategory.getAllCategories()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(categories -> {
                int beforeCategoryId = mCategoryId;
                for (Category category : categories) {
                    if (category.isCheck()) {
                        mCategoryId = category.getId();
                        break;
                    }
                }
                mHomeView.updateCategoryList(categories);
                if (mCategoryId != beforeCategoryId) {
                    mHomeView.changePhotos4Category(mCategoryId);
                }
            });

}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:20,代码来源:HomePresenterImpl.java


示例2: onDrawerItemClick

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onDrawerItemClick(DrawerItemClick clickEvent) {
    if (drawerLayout != null)
        drawerLayout.closeDrawer(recyclerView);

    if (clickEvent.getPosition() == DrawerItemClick.MOVIE_POSITION) {
        if (currentFragment != MOVIES_FRAGMENT)
            resetSearchView();

        currentFragment = MOVIES_FRAGMENT;
        setupFragment();
    } else if (clickEvent.getPosition() == DrawerItemClick.PEOPLE_POSITION) {
        if (currentFragment != PEOPLE_FRAGMENT)
            resetSearchView();

        currentFragment = PEOPLE_FRAGMENT;
        setupFragment();
    }
}
 
开发者ID:JohnnyZhou,项目名称:MovieMe,代码行数:20,代码来源:MainActivity.java


示例3: onEventMainThread

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
/**
 * 收到收藏状态发生变化事件时
 *
 * @param event
 */
@Subscribe
public void onEventMainThread(final FavoriteChangeEvent event) {
    if (event != null && event.getFavoritePlate() != null) {
        List<Plate> favoritePlate = event.getFavoritePlate();
        int index = favoritePlate.indexOf(mPlate);
        if (index != -1) {
            Plate plate = favoritePlate.get(index);
            this.mPlate.setFavoriteId(plate.getFavoriteId());
            this.mPlateHeadView.setFavorite(plate.isFavorite());
        } else {
            this.mPlate.setFavoriteId(null);
            this.mPlateHeadView.setFavorite(false);
        }
    }
}
 
开发者ID:fei-ke,项目名称:ChipHellClient,代码行数:21,代码来源:ThreadListFragment.java


示例4: onEventMainThread

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe //在ui线程执行
public void onEventMainThread(SendEvent event) {
    if (event != null) {
        CircleVO circleVO = event.getMsg();
        mArrayList.add(0,circleVO);
        mAdapter.notifyDataSetChanged();

    }
}
 
开发者ID:Alex-Jerry,项目名称:LLApp,代码行数:10,代码来源:CirleFragment.java


示例5: onPhotoNoteCreateEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onPhotoNoteCreateEvent(PhotoNoteCreateEvent photoNoteCreateEvent) {
    mRxPhotoNote.findByCategoryId(mCategoryId, ComparatorFactory.FACTORY_NOT_SORT)
            .subscribe(photoNoteList -> {
                mRxCategory.findByCategoryId(mCategoryId)
                        .subscribe(category -> {
                            category.setPhotosNumber(photoNoteList.size());
                            mRxCategory.updateCategory(category)
                                    .observeOn(AndroidSchedulers.mainThread())
                                    .subscribe(categories -> {
                                        mHomeView.updateCategoryList(categories);
                                    });
                        });
            });
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:16,代码来源:HomePresenterImpl.java


示例6: onPhotoNoteDeleteEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onPhotoNoteDeleteEvent(PhotoNoteDeleteEvent photoNoteDeleteEvent) {
    mRxPhotoNote.findByCategoryId(mCategoryId, ComparatorFactory.FACTORY_NOT_SORT)
            .subscribe(photoNoteList -> {
                mRxCategory.findByCategoryId(mCategoryId)
                        .subscribe(category -> {
                            category.setPhotosNumber(photoNoteList.size());
                            mRxCategory.updateCategory(category)
                                    .observeOn(AndroidSchedulers.mainThread())
                                    .subscribe(categories -> {
                                        mHomeView.updateCategoryList(categories);
                                    });
                        });
            });
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:16,代码来源:HomePresenterImpl.java


示例7: finishEventBus

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void finishEventBus(String string){
	if(string.equals("finishRun")){
		if(connection != null){
			unbindService(connection);
		}
		
		Intent intent2 = new Intent(RunningActivity.this,RunQueryHistoryActivity.class);
		startActivity(intent2);
		//停止计时器
		takeTimeHandler.removeCallbacks(takeTimeRunnable);
		RunQueryHistoryActivity.finishRunTime = getCurrentTime();
		onDestroy();
	}
}
 
开发者ID:huazifoothole,项目名称:NikiRun,代码行数:16,代码来源:RunningActivity.java


示例8: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void onEvent(TopStoriesEvent event) {
    if (event.stories != null) {
        topStories.addAll(event.stories);
        topStoryAdapter.notifyDataSetChanged();
        collapsingToolbar.setTitle(topStories.get(0).getTitle());
    }
}
 
开发者ID:liuguangqiang,项目名称:Idaily,代码行数:9,代码来源:MainActivity.java


示例9: onAskedToSearchCategories

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.Async)
public void onAskedToSearchCategories(EventMyList.EventFetch event) {
    if (isCorrectEventFetch(event)) {
        EventFetched<T> result = new EventFetched<>(getListOfItem());
        EventBus.getDefault().post(result);
    }
}
 
开发者ID:codlab,项目名称:amiibo,代码行数:8,代码来源:AbstractLoadableFragment.java


示例10: onFetchedCategories

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onFetchedCategories(EventFetched<T> event) {
    List list = event.result;
    if (list != null && list.size() > 0 && isCorrectInstance(list.get(0))) {
        updateUpdate(event);
    }
}
 
开发者ID:codlab,项目名称:amiibo,代码行数:8,代码来源:AbstractLoadableFragment.java


示例11: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread, sticky = true)
public void onEvent(SyncResult event) {
    if (event.finished) {
        _progress_bar.setVisibility(View.GONE);
        _start_sync.setVisibility(View.VISIBLE);
    } else {
        _progress_bar.setVisibility(View.VISIBLE);
        _start_sync.setVisibility(View.GONE);
    }
}
 
开发者ID:codlab,项目名称:amiibo,代码行数:11,代码来源:DriveFragment.java


示例12: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.Async)
public void onEvent(PostRefreshAmiibos event) {
    List<AmiiboDescriptorInformation> list = event.amiibos;
    if (list != null) {
        for (AmiiboDescriptorInformation amiibo : list) {
            Log.d("ApplicationController", "writing amiibo " + amiibo.identifier + " " + amiibo.name);
            AmiiboFactory.getAmiiboDescriptorCache()
                    .updateInDatabase(amiibo.asAmiiboDescriptor());
        }
    }
}
 
开发者ID:codlab,项目名称:amiibo,代码行数:12,代码来源:ApplicationController.java


示例13: onCategoryCreateEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onCategoryCreateEvent(CategoryCreateEvent categoryCreateEvent) {
    mRxCategory.getAllCategories()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(categories -> mHomeView.updateCategoryList(categories));
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:7,代码来源:HomePresenterImpl.java


示例14: onCategoryUpdateEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onCategoryUpdateEvent(CategoryUpdateEvent categoryUpdateEvent) {
    mRxCategory.getAllCategories()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(categories -> mHomeView.updateCategoryList(categories));
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:7,代码来源:HomePresenterImpl.java


示例15: onCategoryMoveEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onCategoryMoveEvent(CategoryMoveEvent categoryMoveEvent) {
    mRxCategory.getAllCategories()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(categories -> mHomeView.updateCategoryList(categories));
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:7,代码来源:HomePresenterImpl.java


示例16: onCategoryRenameEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MainThread)
public void onCategoryRenameEvent(CategoryEditEvent categoryEditEvent) {
    mRxCategory.getAllCategories()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(categories -> mHomeView.updateCategoryList(categories));
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:7,代码来源:HomePresenterImpl.java


示例17: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void onEvent(CatImageSelectedEvent event) {
    Intent viewIntent = CatViewerActivity.withCatImage(this, event.catImage);
    startActivity(viewIntent);
}
 
开发者ID:Egorand,项目名称:android-aop-analytics,代码行数:6,代码来源:MainActivity.java


示例18: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void onEvent(String str){
    setMusicInfo();
}
 
开发者ID:kiddot,项目名称:MusicPlay,代码行数:5,代码来源:BottomControl.java


示例19: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void onEvent(MusicInfo musicInfo){
    upDateMusicInfo(musicInfo);
}
 
开发者ID:kiddot,项目名称:MusicPlay,代码行数:5,代码来源:BaseFragment.java


示例20: onEvent

import de.greenrobot.event.Subscribe; //导入依赖的package包/类
@Subscribe
public void onEvent(PostThreadEvent event){
    Toast.makeText(this, event.message, 1).show();
}
 
开发者ID:it114,项目名称:OneFramework,代码行数:5,代码来源:EventBusActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FreshEntityPolicy类代码示例发布时间:2022-05-22
下一篇:
Java TextColor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap