|
|
@@ -40,6 +40,7 @@ import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.AppUpdateCommand;
|
|
|
+import kr.co.zumo.app.lifeplus.view.command.EmailSendingCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.NotificationSettingCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.CurrentPageShareDialog;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogBase;
|
|
|
@@ -203,24 +204,17 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
break;
|
|
|
case Event.KAKAO_TALK:
|
|
|
//카카오링크
|
|
|
- try {
|
|
|
-// KakaoLink kakaoLink = KakaoLink.getKakaoLink(view.getActivity());
|
|
|
-// KakaoTalkLinkMessageBuilder messageBuilder = kakaoLink.createKakaoTalkLinkMessageBuilder();
|
|
|
-// messageBuilder.addText("카카오톡으로 공유해요.");
|
|
|
-// kakaoLink.sendMessage(messageBuilder, view.getActivity());
|
|
|
-
|
|
|
- sendKakaoLink();
|
|
|
- } catch (Throwable e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ sendKakaoLink();
|
|
|
break;
|
|
|
case Event.FACE_BOOK:
|
|
|
- Log.e("APP# SettingPresenter | onDialogResult", "|" + "facebook");
|
|
|
sendFaceBook();
|
|
|
break;
|
|
|
case Event.CODE_COPY:
|
|
|
sendClipBoardCopy();
|
|
|
break;
|
|
|
+ case Event.EMAIL_CLICK:
|
|
|
+ sendEmail();
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -275,6 +269,12 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void sendEmail() {
|
|
|
+ String subject = ResourceUtil.getString(R.string.share_title, ResourceUtil.getString(R.string.share_recommend_code_subject));
|
|
|
+ String contents = ResourceUtil.getString(R.string.share_recommend_code_contents, model.getMyRecommendCode());
|
|
|
+ onCommand(new EmailSendingCommand("", subject, contents));
|
|
|
+ }
|
|
|
+
|
|
|
private void sendKakaoLink() {
|
|
|
FeedTemplate params = FeedTemplate
|
|
|
.newBuilder(ContentObject.newBuilder("디저트 사진",
|
|
|
@@ -341,11 +341,14 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
|
|
|
private void sendClipBoardCopy() {
|
|
|
|
|
|
- ClipboardManager clipboardManager = (ClipboardManager) view.getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
|
|
|
+ ClipboardManager clipboardManager = (ClipboardManager) view.getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
|
|
|
ClipData clipData = ClipData.newPlainText("code", model.getMyRecommendCode());
|
|
|
- clipboardManager.setPrimaryClip(clipData);
|
|
|
- Log.i("APP# SettingPresenter | sendClipBoardCopy", "|" + model.getMyRecommendCode());
|
|
|
- showToast("", "URL이 복사되었습니다", 1);
|
|
|
+ try {
|
|
|
+ clipboardManager.setPrimaryClip(clipData);
|
|
|
+ showToast("", "URL이 복사되었습니다", 1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -415,7 +418,7 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void showToast(String title, String detail , @Nullable int copyToastFlag) {
|
|
|
+ private void showToast(String title, String detail, @Nullable int copyToastFlag) {
|
|
|
|
|
|
Context context = App.getInstance().getContext();
|
|
|
Toast toast = new Toast(context);
|
|
|
@@ -423,9 +426,10 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
toast.setGravity(Gravity.FILL, 0, 0);
|
|
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
View view;
|
|
|
- if(copyToastFlag!=0){
|
|
|
+ if (copyToastFlag != 0) {
|
|
|
view = inflater.inflate(R.layout.setting_toast_url_copy_pop_up, null);
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else {
|
|
|
view = inflater.inflate(R.layout.setting_toast_pop_up, null);
|
|
|
((TextView) view.findViewById(R.id.setting_toast_title)).setText(title);
|
|
|
((TextView) view.findViewById(R.id.setting_toast_detail)).setText(detail);
|