This commit is contained in:
lyr
2022-05-11 11:46:36 +08:00
parent 9628af4168
commit fb4e38e50f
2 changed files with 25 additions and 3 deletions

View File

@ -2115,7 +2115,7 @@ public class DialogUtils {
dialog.show();
}
public static void showBindPhoneDialog(Context context, ConfirmListener listener) {
public static Dialog showBindPhoneDialog(Context context, ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
@ -2133,6 +2133,7 @@ public class DialogUtils {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(binding.getRoot());
dialog.show();
return dialog;
}
public static void showReceiveLibaoSuccessDialog(Context context, String title, String des, String libaoCode, ConfirmListener listener) {

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter.security
import android.app.Dialog
import android.content.Intent
import android.os.Bundle
import android.os.Message
@ -22,6 +23,7 @@ class BindPhoneFragment : NormalFragment() {
private lateinit var mViewModel: BindPhoneViewModel
private val mBinding by lazy { FragmentBindPhoneBinding.inflate(layoutInflater) }
private var mDialog: Dialog? = null
override fun handleMessage(msg: Message) {
if (msg.what == 0) { // 验证码倒计时
@ -66,7 +68,7 @@ class BindPhoneFragment : NormalFragment() {
it.setOnClickListener(this)
}
mBinding.bindPhoneSkip.goneIf(!mFromLogin)
mBinding.bindPhoneSkip.goneIf(!true)
mBinding.bindPhoneTitle.text = if (mChangePhone) requireContext().resources.getString(R.string.bind_phone_title2)
else requireContext().resources.getString(R.string.bind_phone_title1)
mBinding.bindPhoneDesc.text = if (mChangePhone) {
@ -206,7 +208,7 @@ class BindPhoneFragment : NormalFragment() {
when (v.id) {
R.id.bind_phone_skip -> {
DialogUtils.showBindPhoneDialog(requireContext()) { requireActivity().finish() }
showBindPhoneDialog()
}
R.id.bind_phone_captcha -> {
@ -261,6 +263,15 @@ class BindPhoneFragment : NormalFragment() {
}
}
private fun showBindPhoneDialog() {
mDialog = DialogUtils.showBindPhoneDialog(requireContext()) { requireActivity().finish() }
}
override fun onStop() {
super.onStop()
mDialog = null
}
override fun onNightModeChange() {
super.onNightModeChange()
mBinding.run {
@ -274,6 +285,16 @@ class BindPhoneFragment : NormalFragment() {
it.setTextColor(R.color.text_title.toColor(requireContext()))
}
}
bindPhoneBtn.run {
background = R.drawable.download_button_normal_style.toDrawable(requireContext())
setTextColor(R.color.text_white.toColor(requireContext()))
}
if (mDialog != null && mDialog!!.isShowing) {
mDialog?.dismiss()
showBindPhoneDialog()
}
}
}
}