diff --git a/app/src/main/java/com/yingmao/clash/fragment/home/HomeFragment.kt b/app/src/main/java/com/yingmao/clash/fragment/home/HomeFragment.kt index 945a550..7278ace 100644 --- a/app/src/main/java/com/yingmao/clash/fragment/home/HomeFragment.kt +++ b/app/src/main/java/com/yingmao/clash/fragment/home/HomeFragment.kt @@ -26,6 +26,9 @@ import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope +import com.afollestad.materialdialogs.MaterialDialog +import com.afollestad.materialdialogs.customview.customView +import com.afollestad.materialdialogs.customview.getCustomView import com.cncat.vpn.common.constants.Intents import com.cncat.vpn.common.log.Log import com.cncat.vpn.core.Clash @@ -186,7 +189,20 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher llLine.setOnClickListener { if (checkExpire()) { if (isAdded) { - RxToast.info(requireActivity().resources.getString(R.string.AccountExpired)) + 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(R.id.tv_pay_finish).setOnClickListener { + goNewRecharge() + dismiss() + } + } } return@setOnClickListener } @@ -460,7 +476,20 @@ class HomeFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatcher private fun startClash() { if (checkExpire()) { if (isAdded) { - RxToast.info(resources.getString(R.string.AccountExpired)) + 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(R.id.tv_pay_finish).setOnClickListener { + goNewRecharge() + dismiss() + } + } } return } diff --git a/app/src/main/res/layout/expired_recharge__layout.xml b/app/src/main/res/layout/expired_recharge__layout.xml new file mode 100644 index 0000000..518ae69 --- /dev/null +++ b/app/src/main/res/layout/expired_recharge__layout.xml @@ -0,0 +1,36 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index d109ccf..4260278 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -336,4 +336,6 @@ Service Description\n Customer Service Version Update Update + Free time has ended\nPlease recharge + Go to recharge \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index a81d16e..9ecc14a 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -326,4 +326,6 @@ 在線客服 版本更新 更新 + 免費時長已結束\n請充值使用 + 去充值 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index aab85da..ad36646 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -325,4 +325,6 @@ 在線客服 版本更新 更新 + 免費時長已結束\n請充值使用 + 去充值 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dff60ce..3f85913 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -344,4 +344,6 @@ 在线客服 版本更新 更新 + 免费时长已结束\n请充值使用 + 去充值 \ No newline at end of file