Commit 9eb48dbe authored by jyx's avatar jyx

添加合并完成弹框

parent bdf3f078
......@@ -78,9 +78,6 @@ public class UserManager {
*/
private static final String WX_OPENID = "wx_openid";
public static UserManager getInstance() {
if (_inst != null) {
return _inst;
......
......@@ -63,7 +63,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
val message = baseResponse.message
when (code) {
200 -> {
view.toKeepAccountSuc()
view.toKeepAccountSuc(saveType)
}
else -> {
view.showToast(message)
......
......@@ -7,7 +7,7 @@ interface AccountMergeView : BaseView {
fun getKeepAccountMsgSuc(data: AccountMsgBean)
fun getKeepAccountMsgFail()
fun toKeepAccountSuc()
fun toKeepAccountSuc(saveType: Int)
fun toKeepAccountFail()
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.AccountMsgBean
import com.mints.goodmoney.mvp.presenters.AccountMergePresenter
import com.mints.goodmoney.mvp.views.AccountMergeView
......@@ -76,7 +77,7 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
}
R.id.btn_invite_right -> {
toDoKey?.let {
hintDialog(it, "手机", TYPE_SAVE_MOBILE)
hintDialog(it, "手机", TYPE_SAVE_MOBILE)
}
}
}
......@@ -89,19 +90,12 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
}
private fun hintDialog(toDoKey: String, str: String, type: Int) {
val content = if (type == TYPE_SAVE_WECHAT) {
SpanUtils()
.append("您确定要保留 ")
.append(str).setForegroundColor(resources.getColor(R.color.color_00895B))
.append(" 账号吗?")
.create()
} else {
SpanUtils()
.append("您确定要保留 ")
.append(str).setForegroundColor(resources.getColor(R.color.mainColor))
.append(" 账号吗?")
.create()
}
val content = SpanUtils()
.append("保留后微信会跟手机号绑定,仅保留")
.append(str + "账号").setForegroundColor(resources.getColor(R.color.color_FF2326))
.append("下的数据,请使用")
.append("微信登录").setForegroundColor(resources.getColor(R.color.color_FF2326))
.create()
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
......@@ -118,10 +112,10 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
}
}
})
cdaa!!.setTitle("提示")
cdaa!!.setTitle("温馨提示")
cdaa!!.setContent(content)
cdaa!!.setLeft("取消")
cdaa!!.setRight("保留")
cdaa!!.setLeft("考虑一下")
cdaa!!.setRightDelay("确认绑定", 5)
cdaa!!.show()
}
......@@ -144,8 +138,10 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
override fun getKeepAccountMsgFail() {}
override fun toKeepAccountSuc() {
override fun toKeepAccountSuc(saveType: Int) {
showToast("账号合并成功!")
readyGoThenKill(MainActivity::class.java)
}
......
......@@ -816,10 +816,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
override fun onShareOk() {
myPresenter.cmtShareStatus()
// Timer().schedule(1000,{
// shareDialog.dismiss()
// })
}
})
shareDialog.show()
......
......@@ -4,6 +4,7 @@ import android.content.Context;
import androidx.core.content.ContextCompat;
import android.os.CountDownTimer;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
......@@ -16,6 +17,9 @@ import android.widget.TextView;
import com.mints.goodmoney.R;
import java.util.Timer;
import java.util.TimerTask;
/**
* 仿苹果自定义dialog选择框
*/
......@@ -154,6 +158,40 @@ public class CustomDialogAsApple extends BaseDialog {
}
}
/**
* Dialog显示right按钮文字
*
* @param s
*/
public void setRightDelay(String s, int second) {
dialog_btn_right.setText(s);
if (TextUtils.isEmpty(dialog_btn_left.getText())) {
dialog_btn_left.setVisibility(View.GONE);
dialog_v_line.setVisibility(View.GONE);
} else {
dialog_btn_right.setVisibility(View.VISIBLE);
dialog_v_line.setVisibility(View.VISIBLE);
dialog_btn_right.setEnabled(false);
CountDownTimer countDownTimer = new CountDownTimer(second * 1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
String value = String.valueOf((int) ((millisUntilFinished / 1000) + 1));
dialog_btn_right.setText(s + "(" + value + ")");
}
@Override
public void onFinish() {
dialog_btn_right.setText(s);
dialog_btn_right.setEnabled(true);
}
};
countDownTimer.start();
}
}
/**
* Dialog显示right按钮文字颜色
*
......
......@@ -48,6 +48,7 @@
<TextView
android:id="@+id/tv_coin_left"
android:gravity="center_vertical"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
......@@ -60,6 +61,7 @@
android:id="@+id/tv_bonus_left"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="20dp"
android:drawablePadding="6dp"
android:text="@string/dot"
......@@ -70,6 +72,7 @@
android:id="@+id/tv_invited_left"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="20dp"
android:drawablePadding="6dp"
android:text="@string/dot"
......@@ -92,7 +95,9 @@
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="50dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:src="@mipmap/icon_exchange" />
<LinearLayout
......@@ -129,6 +134,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:drawablePadding="6dp"
android:gravity="end|center_vertical"
android:text="@string/dot"
android:textSize="16sp"
app:drawableEndCompat="@mipmap/ic_coin" />
......@@ -139,6 +145,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:drawablePadding="6dp"
android:gravity="end|center_vertical"
android:text="@string/dot"
android:textSize="16sp"
app:drawableEndCompat="@mipmap/ic_gongxian" />
......@@ -149,6 +156,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:drawablePadding="6dp"
android:gravity="end|center_vertical"
android:text="@string/dot"
android:textSize="16sp"
app:drawableEndCompat="@mipmap/ic_invited" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment