|
|
@@ -15,7 +15,6 @@ 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.EventDeliveryBean;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.SignUpCompletedBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.APIData;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.EventDetailBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.LinkBean;
|
|
|
@@ -59,6 +58,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
private DoubleChecker doubleChecker;
|
|
|
private DoubleChecker doubleCheckerPopup;
|
|
|
private DoubleChecker doubleCheckerWeather;
|
|
|
+ private Disposable disposableNewbie;
|
|
|
private boolean isRequestingLocationPermissions = false;
|
|
|
|
|
|
public MainPresenter(MainModel model, IMainView view) {
|
|
|
@@ -99,10 +99,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
|
|
|
model.loadWeather();
|
|
|
|
|
|
- SignUpCompletedBean signUpCompletedBean = model.getDeliveryPackaging(SignUpCompletedBean.class);
|
|
|
- if (null != signUpCompletedBean) {
|
|
|
- model.clearDeliveryPackaging();
|
|
|
-
|
|
|
+ if (model.canDisplayNewbiePopup()) {
|
|
|
// 회원 가입 팝업 표시
|
|
|
showNewbiePopup();
|
|
|
}
|
|
|
@@ -113,6 +110,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
@Override
|
|
|
protected void stopInternal() {
|
|
|
clearTimer();
|
|
|
+ closeNewbiePopup();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -203,6 +201,9 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
if (event.getInteger() == Event.LOADING_WEATHER) {
|
|
|
onWeatherComplete();
|
|
|
}
|
|
|
+ else if (event.getInteger() == Event.LOADED_POPUP_INFO) {
|
|
|
+ startNewbiePopupTimer();
|
|
|
+ }
|
|
|
else {
|
|
|
showErrorDialog(event.getString());
|
|
|
}
|
|
|
@@ -326,7 +327,6 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
break;
|
|
|
case Event.SPECIAL_CODE_CLICK:
|
|
|
linkForNewbie(event.getEventId());
|
|
|
- view.setNewbieLayoutVisible(false);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
@@ -556,6 +556,8 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
private void showPromotionPopup() {
|
|
|
|
|
|
if (false == model.isVisiblePromotion() || null == model.getPromotionPopupBeans() || model.getPromotionPopupBeans().size() < 1) {
|
|
|
+
|
|
|
+ startNewbiePopupTimer();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -574,6 +576,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
@Override
|
|
|
public void onDialogResult(PromotionDialog dialog, Event event) {
|
|
|
dialog.dispose();
|
|
|
+ startNewbiePopupTimer();
|
|
|
if (event.getEventId() == Event.TODAY) {
|
|
|
model.setPromotionSkipTime();
|
|
|
}
|
|
|
@@ -586,6 +589,7 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
@Override
|
|
|
public void onDialogCanceled(PromotionDialog dialog) {
|
|
|
dialog.dispose();
|
|
|
+ startNewbiePopupTimer();
|
|
|
}
|
|
|
})
|
|
|
.attribute(dialog -> {
|
|
|
@@ -594,10 +598,28 @@ public class MainPresenter extends Presenter<MainModel, IMainView> {
|
|
|
.show();
|
|
|
}
|
|
|
|
|
|
+ private void closeNewbiePopup() {
|
|
|
+ if (null != disposableNewbie) {
|
|
|
+ disposableNewbie.dispose();
|
|
|
+ disposableNewbie = null;
|
|
|
+ view.setNewbieLayoutVisible(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void showNewbiePopup() {
|
|
|
view.setNewbieLayoutVisible(true);
|
|
|
}
|
|
|
|
|
|
+ private void startNewbiePopupTimer() {
|
|
|
+ if (model.canDisplayNewbiePopup()) {
|
|
|
+ disposableNewbie = Completable.timer(10000, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(() -> {
|
|
|
+ disposableNewbie = null;
|
|
|
+ view.setNewbieLayoutVisible(false);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* GA 에 이용되는 현재 화면의 이름
|
|
|
* - 기본값: NavigationBar 의 title
|