|
|
@@ -12,10 +12,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.disposables.Disposable;
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.ContentsDeliveryBean;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.ContentsWebDeliveryBean;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.UtilityActivityBean;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.api.LifeplusContentsBean;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.api.LinkBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.MainContentsCategoryBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.PromotionPopupBean;
|
|
|
import kr.co.zumo.app.lifeplus.config.DebugConfig;
|
|
|
@@ -30,10 +26,8 @@ import kr.co.zumo.app.lifeplus.view.dialog.DialogBuilder;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogID;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.ICustomDialogListener;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.PromotionDialog;
|
|
|
-import kr.co.zumo.app.lifeplus.view.presenter.LinkInvoker;
|
|
|
import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.category.CategoryID;
|
|
|
-import kr.co.zumo.app.lifeplus.view.screen.my.coin.MyCoinMainPresenter;
|
|
|
|
|
|
/**
|
|
|
* MainPresenter
|
|
|
@@ -74,7 +68,6 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
protected void startInternalOnce() {
|
|
|
model.loadContents();
|
|
|
model.loadPopupInfo();
|
|
|
- model.loadMyBucket();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -353,7 +346,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
}
|
|
|
else if (event.getEventId() == Event.BANNER) {
|
|
|
// 배너 클릭
|
|
|
- if (invoke(model.getPromotionPopupBeans().get(event.getIndex())) == false) {
|
|
|
+ if (invokeLink(model.getPromotionPopupBeans().get(event.getIndex())) == false) {
|
|
|
showToast("Invalid Link");
|
|
|
}
|
|
|
}
|
|
|
@@ -370,82 +363,4 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
.show();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * {@link MyCoinMainPresenter} 와 중복 코드, 리팩토링 필요
|
|
|
- * <p>
|
|
|
- * bucket 리스트를 우선 로딩하지 않고 선택 후 로딩하는 방식으로 수정
|
|
|
- */
|
|
|
- protected boolean invoke(LinkBean linkBean) {
|
|
|
- boolean isSuccess = true;
|
|
|
- /*
|
|
|
- 링크 구분 코드
|
|
|
- 01:외부URL, 02:컨텐츠, 03:이벤트, 04:특정메뉴
|
|
|
- */
|
|
|
- switch (linkBean.getLinkType()) {
|
|
|
- case LinkBean.TYPE_CONTENTS:
|
|
|
- LifeplusContentsBean bean = new LifeplusContentsBean();
|
|
|
- bean.setContentsNo(linkBean.getLink());
|
|
|
- ContentsDeliveryBean contentsDeliveryBean = new ContentsDeliveryBean.Builder(bean).build();
|
|
|
-
|
|
|
- model.setDeliveryPackaging(contentsDeliveryBean);
|
|
|
- go(ScreenID.CONTENTS);
|
|
|
- break;
|
|
|
- case LinkBean.TYPE_URL:
|
|
|
- ContentsWebDeliveryBean contentsWebDeliveryBean = new ContentsWebDeliveryBean(null, -1, linkBean.getLink());
|
|
|
-
|
|
|
- model.setDeliveryPackaging(contentsWebDeliveryBean);
|
|
|
- go(ScreenID.WEB_FROM_CONTENTS);
|
|
|
- break;
|
|
|
- case LinkBean.TYPE_EVENT:
|
|
|
- go(ScreenID.EVENT);
|
|
|
- break;
|
|
|
- case LinkBean.TYPE_MENU:
|
|
|
- @ScreenID.ID int screenId = LinkInvoker.getScreenIdByApiId(linkBean.getLink());
|
|
|
-
|
|
|
- /**
|
|
|
- * Main 에서 직접 프래그먼트를 전환하면 정상 작동이 되지 않으므로 액티비티에 담아서 프래그먼트를 표시한다.
|
|
|
- */
|
|
|
- UtilityActivityBean utilityActivityBean = new UtilityActivityBean();
|
|
|
- switch (screenId) {
|
|
|
- case ScreenID.MY_MAIN:
|
|
|
- case ScreenID.MY_COIN_MAIN:
|
|
|
- utilityActivityBean.setScreenId(screenId);
|
|
|
- model.setDeliveryPackaging(utilityActivityBean);
|
|
|
- go(ScreenID.UTILITY_ACTIVITY);
|
|
|
- break;
|
|
|
- case ScreenID.BUCKET_ACTIVITY:
|
|
|
- if (model.getBucketCount() == 0) {
|
|
|
- utilityActivityBean.setScreenId(ScreenID.BUCKET_BEST);
|
|
|
- }
|
|
|
- else {
|
|
|
- utilityActivityBean.setScreenId(ScreenID.MY_BUCKET_LIST);
|
|
|
- }
|
|
|
- model.setDeliveryPackaging(utilityActivityBean);
|
|
|
- go(ScreenID.UTILITY_ACTIVITY);
|
|
|
- break;
|
|
|
- case ScreenID.SETTING_MEMBER_INFO:
|
|
|
- confirmPin(() -> {
|
|
|
- utilityActivityBean.setScreenId(ScreenID.SETTING_MEMBER_INFO);
|
|
|
- model.setDeliveryPackaging(utilityActivityBean);
|
|
|
- go(ScreenID.UTILITY_ACTIVITY);
|
|
|
- });
|
|
|
- break;
|
|
|
- case ScreenID.SETTING_CODE:
|
|
|
- utilityActivityBean.setScreenId(ScreenID.SETTING_CODE);
|
|
|
- model.setDeliveryPackaging(utilityActivityBean);
|
|
|
- go(ScreenID.UTILITY_ACTIVITY);
|
|
|
- break;
|
|
|
- default:
|
|
|
- // 원래 액티비티로 표시되는 화면들.
|
|
|
- go(screenId);
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- isSuccess = false;
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- return isSuccess;
|
|
|
- }
|
|
|
}
|