use of pri.weiqiang.myjapanese.rxbus.event.PhotoViewEvent in project MyJapanese by 54wall.
the class MainActivityPresenterImpl method onBusEventInteraction.
@Override
public void onBusEventInteraction(EventContainer eventContainer) {
Log.i(TAG, "onBusEventInteraction: " + eventContainer);
switch(eventContainer.getType()) {
case EventContainer.TYPE_PHOTOVIEW:
PhotoViewEvent photoViewEvent = (PhotoViewEvent) eventContainer.getEvent();
Bundle bundle = new Bundle();
bundle.putString(Constants.IMG_URL, photoViewEvent.getImg_url());
bundle.putInt(Constants.IMG_ID, photoViewEvent.getImg_id());
view.startPhotoViewActivity(bundle);
break;
case EventContainer.TYPE_GAME:
GameEvent gameEvent = (GameEvent) eventContainer.getEvent();
switch(gameEvent.getType()) {
case GameEvent.TYPE_PUZZLE:
view.startPuzzleActivity();
break;
case GameEvent.TYPE_SUPPERZZLE:
view.startSupperzzleActivity();
break;
default:
break;
}
break;
case EventContainer.TYPE_SETTING:
SettingEvent event = (SettingEvent) eventContainer.getEvent();
view.showSnackBar(event.getMsg());
break;
default:
break;
}
}
use of pri.weiqiang.myjapanese.rxbus.event.PhotoViewEvent in project MyJapanese by 54wall.
the class PixivIllustFragment method showImg.
@Override
public void showImg(String url, int id) {
PhotoViewEvent event = new PhotoViewEvent(url, id);
RxBus.getDefault().post(new EventContainer(EventContainer.TYPE_PHOTOVIEW, event));
}
Aggregations