big fix: 启动问题

This commit is contained in:
level 2025-07-15 16:02:11 +08:00
parent 66971ecab1
commit 3bc5e26744
1 changed files with 29 additions and 30 deletions

View File

@ -173,12 +173,28 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
} }
return@setOnClickListener return@setOnClickListener
}else{ }else{
showLoading(resources.getString(R.string.Starting), requireContext()) if (checkExpire()) {
launch { if (isAdded) {
delay(2000) MaterialDialog(requireContext()).show {
startClash() this.cancelable(false)
cornerRadius(res = R.dimen.dp_10)
customView(
R.layout.expired_recharge__layout,
scrollable = false,
noVerticalPadding = true,
horizontalPadding = false
)
getCustomView().findViewById<TextView>(R.id.tv_pay_finish).setOnClickListener {
goNewRecharge()
dismiss()
} }
} }
}
return@setOnClickListener
}
showLoading(resources.getString(R.string.Starting), requireContext())
startClash(true)
}
} }
} }
@ -201,28 +217,11 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
} }
private fun startClash() { private fun startClash(isStart:Boolean) {
if (checkExpire()) {
if (isAdded) {
hideLoading()
MaterialDialog(requireContext()).show {
this.cancelable(false)
cornerRadius(res = R.dimen.dp_10)
customView(
R.layout.expired_recharge__layout,
scrollable = false,
noVerticalPadding = true,
horizontalPadding = false
)
getCustomView().findViewById<TextView>(R.id.tv_pay_finish).setOnClickListener {
goNewRecharge()
dismiss()
}
}
}
return
}
launch { launch {
if(isStart){
delay(2000)
}
profileBinder?.let { pm -> profileBinder?.let { pm ->
val active = pm.queryActive() val active = pm.queryActive()
if (active == null) { if (active == null) {
@ -399,7 +398,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (clashRunning) { if (clashRunning) {
Log.d("clashRunning $clashRunning") Log.d("clashRunning $clashRunning")
} else { } else {
startClash() startClash(false)
} }
} else { } else {
if (::rxDialogShapeLoading.isInitialized || rxDialogShapeLoading.isShowing) { if (::rxDialogShapeLoading.isInitialized || rxDialogShapeLoading.isShowing) {
@ -414,12 +413,12 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (clashRunning) { if (clashRunning) {
Log.d("clashRunning $clashRunning") Log.d("clashRunning $clashRunning")
} else { } else {
startClash() startClash(false)
} }
checkGlo() checkGlo()
}?.run { }?.run {
if (is_runing == true && !clashRunning) { if (is_runing == true && !clashRunning) {
startClash() startClash(false)
} }
} }
} else if (requestCode == Proxy_Mode_REQUEST_CODE) { } else if (requestCode == Proxy_Mode_REQUEST_CODE) {
@ -431,12 +430,12 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (clashRunning) { if (clashRunning) {
Log.d("clashRunning $clashRunning") Log.d("clashRunning $clashRunning")
} else { } else {
startClash() startClash(false)
} }
checkGlo() checkGlo()
}.run { }.run {
if (!clashRunning) { if (!clashRunning) {
startClash() startClash(false)
} }
} }
} }