|
|
@@ -9,6 +9,8 @@ import android.view.View;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
+
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.application.App;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.SettingMemberBean;
|
|
|
@@ -20,6 +22,7 @@ import kr.co.zumo.app.lifeplus.tool.ShareClipBoard;
|
|
|
import kr.co.zumo.app.lifeplus.tool.ShareFacebook;
|
|
|
import kr.co.zumo.app.lifeplus.tool.ShareKakaoTalk;
|
|
|
import kr.co.zumo.app.lifeplus.util.AppUtil;
|
|
|
+import kr.co.zumo.app.lifeplus.util.Formatter;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.DoubleChecker;
|
|
|
@@ -102,7 +105,8 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
showToast(
|
|
|
ResourceUtil.getString(R.string.special_code_confirm_success),
|
|
|
String.format(ResourceUtil.getString(R.string.special_code_confirm_success_detail), model.getSpecialCodeType()),
|
|
|
- 0
|
|
|
+ 0,
|
|
|
+ Toast.LENGTH_LONG
|
|
|
);
|
|
|
|
|
|
model.clearSpecialCodeType();
|
|
|
@@ -112,7 +116,8 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
showToast(
|
|
|
ResourceUtil.getString(R.string.recommend_special_code_confirm_success),
|
|
|
String.format(ResourceUtil.getString(R.string.recommend_confirm_success_detail), model.getRecommendName(), model.getIncreasedCoin()),
|
|
|
- 0
|
|
|
+ 0,
|
|
|
+ Toast.LENGTH_LONG
|
|
|
);
|
|
|
|
|
|
model.clearRecommendName();
|
|
|
@@ -312,7 +317,7 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
share.shareRecommendCode(model.getMyRecommendCode(), new IShareListener() {
|
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
|
- showToast("", ResourceUtil.getString(R.string.share_completed_message), 1);
|
|
|
+ showToast("", ResourceUtil.getString(R.string.share_completed_message), 1, Toast.LENGTH_LONG);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -332,7 +337,7 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
share.shareRecommendCode(model.getMyRecommendCode(), new IShareListener() {
|
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
|
- showToast("", ResourceUtil.getString(R.string.share_completed_message), 1);
|
|
|
+ showToast("", ResourceUtil.getString(R.string.share_completed_message), 1, Toast.LENGTH_LONG);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -348,7 +353,7 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
share.shareRecommendCode(model.getMyRecommendCode(), new IShareListener() {
|
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
|
- showToast("", ResourceUtil.getString(R.string.share_copy_completed_message), 1);
|
|
|
+ showToast("", ResourceUtil.getString(R.string.share_copy_completed_message), 1, Toast.LENGTH_LONG);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -374,6 +379,13 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
}
|
|
|
else if (index == SettingViewHolder.SWITCH_MARKETING) {
|
|
|
// 마케팅
|
|
|
+ String date = Formatter.format(Calendar.getInstance().getTimeInMillis(), "yyyy.MM.dd");
|
|
|
+ showToast(
|
|
|
+ ResourceUtil.getString(bool ? R.string.setting_menu3_event_agree : R.string.setting_menu3_event_disagree),
|
|
|
+ String.format(ResourceUtil.getString(bool ? R.string.setting_menu3_event_agree_message : R.string.setting_menu3_event_disagree_message), date),
|
|
|
+ 0,
|
|
|
+ Toast.LENGTH_SHORT
|
|
|
+ );
|
|
|
}
|
|
|
else if (index == SettingViewHolder.SWITCH_LOCATION) {
|
|
|
// 위치
|
|
|
@@ -460,11 +472,11 @@ 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, int duration) {
|
|
|
|
|
|
Context context = App.getInstance().getContext();
|
|
|
Toast toast = new Toast(context);
|
|
|
- toast.setDuration(Toast.LENGTH_LONG);
|
|
|
+ toast.setDuration(duration);
|
|
|
toast.setGravity(Gravity.FILL, 0, 0);
|
|
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
View view;
|