日夜间模式的切换(账号与安全页面) https://git.shanqu.cc/halo/android/assistant-android/-/issues/65
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user