|
|
@@ -1,179 +0,0 @@
|
|
|
-/*
|
|
|
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
|
|
|
- */
|
|
|
-package kr.co.zumo.app.lifeplus.view.screen.contents;
|
|
|
-
|
|
|
-import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.ContentsDeliveryBean;
|
|
|
-import kr.co.zumo.app.lifeplus.helper.NavigationBar;
|
|
|
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
|
|
|
-import kr.co.zumo.app.lifeplus.tool.Share;
|
|
|
-import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
-import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
-import kr.co.zumo.app.lifeplus.view.dialog.ConfirmDialog;
|
|
|
-import kr.co.zumo.app.lifeplus.view.dialog.DialogBase;
|
|
|
-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.ICustomConfirmListener;
|
|
|
-import kr.co.zumo.app.lifeplus.view.dialog.ICustomDialogListener;
|
|
|
-import kr.co.zumo.app.lifeplus.view.dialog.TooltipDialog;
|
|
|
-
|
|
|
-/**
|
|
|
- * ContentsWebPresenter
|
|
|
- * <pre>
|
|
|
- * </pre>
|
|
|
- *
|
|
|
- * @author 민효동
|
|
|
- * @version 1.0
|
|
|
- * @history 민효동 [2018. 11. 6.] [최초 작성]
|
|
|
- * @since 2018. 11. 6.
|
|
|
- */
|
|
|
-public class ContentsWebPresenter extends ContentsBasePresenter<ContentsWebModel, IContentsBaseView> {
|
|
|
-
|
|
|
- protected DialogBase reviewDialog;
|
|
|
- protected Share share;
|
|
|
-
|
|
|
- public ContentsWebPresenter(ContentsWebModel model, IContentsBaseView view) {
|
|
|
- super(model, view);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void startInternal() {
|
|
|
- super.startInternal();
|
|
|
-
|
|
|
- if (null != model.getContentsBean()) {
|
|
|
- view.setLiked(model.isLiked());
|
|
|
- view.setBookmarked(model.isBookmarked());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void startInternalOnce() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean onBackPressedInternal() {
|
|
|
- back(ScreenID.MAIN);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void onEventInternal(Event event) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void onContentsResultInternal(Event event) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onScreenReady() {
|
|
|
- if (null == model.getContentsBean()) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- view.render(model.getContentsBean().getContentsUrlWithParam());
|
|
|
-
|
|
|
- view.setLiked(model.isLiked());
|
|
|
- view.setBookmarked(model.isBookmarked());
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 닷닷닷 메뉴
|
|
|
- *
|
|
|
- * @param actionBar
|
|
|
- */
|
|
|
- public void onNavigationClickDotDotDot(NavigationBar actionBar) {
|
|
|
- showTooltipDialog();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 좋아요 클릭
|
|
|
- *
|
|
|
- * @param navigationBar
|
|
|
- */
|
|
|
- public void onNavigationClickLike(NavigationBar navigationBar) {
|
|
|
- model.updateLiked();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 북마크 클릭
|
|
|
- *
|
|
|
- * @param navigationBar
|
|
|
- */
|
|
|
- public void onNavigationClickBookmark(NavigationBar navigationBar) {
|
|
|
- if (model.isMember()) {
|
|
|
- model.updateBookmarked();
|
|
|
- }
|
|
|
- else {
|
|
|
- showPopupForGuest();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 공유 클릭
|
|
|
- *
|
|
|
- * @param navigationBar
|
|
|
- */
|
|
|
- public void onNavigationClickShare(NavigationBar navigationBar) {
|
|
|
- showShareDialog();
|
|
|
- }
|
|
|
-
|
|
|
- protected void showPopupForGuest() {
|
|
|
- // 비회원 가입 유도
|
|
|
- new DialogBuilder<ConfirmDialog, ICustomConfirmListener>(getFragmentManager(), DialogID.CONFIRM)
|
|
|
- .listener(new ICustomConfirmListener<ConfirmDialog>() {
|
|
|
- @Override
|
|
|
- public void onPositiveResult(ConfirmDialog dialog, Event event) {
|
|
|
- dialog.dispose();
|
|
|
- go(ScreenID.SIGN_UP_START);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onNegativeResult(ConfirmDialog dialog, Event event) {
|
|
|
- dialog.dispose();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDialogCanceled(ConfirmDialog dialog) {
|
|
|
- dialog.dispose();
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- .attribute(dialog -> {
|
|
|
- dialog.setText(ResourceUtil.getString(R.string.only_user_service));
|
|
|
- dialog.setPositiveButtonLabelId(R.string.member_confirm);
|
|
|
- })
|
|
|
- .show();
|
|
|
- }
|
|
|
-
|
|
|
- protected void showTooltipDialog() {
|
|
|
- new DialogBuilder<TooltipDialog, ICustomDialogListener>(getFragmentManager(), DialogID.TOOL_TIP)
|
|
|
- .listener(new ICustomDialogListener<TooltipDialog>() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDialogResult(TooltipDialog dialog, Event event) {
|
|
|
- if (event.getEventId() == Event.OVER_VIEW) {
|
|
|
- dialog.dispose();
|
|
|
-
|
|
|
- model.setDeliveryPackaging(new ContentsDeliveryBean.Builder(model.getContentsBean()).build());
|
|
|
-
|
|
|
- go(ScreenID.OVER_VIEW);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDialogCanceled(TooltipDialog dialog) {
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- .attribute(dialog -> {
|
|
|
- })
|
|
|
- .show();
|
|
|
- }
|
|
|
-
|
|
|
-}
|