parent
c7a93838b4
commit
241c70bdf8
|
|
@ -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<TextView>(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<TextView>(R.id.tv_pay_finish).setOnClickListener {
|
||||
goNewRecharge()
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/pay_dialog_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/blue_4072FE"
|
||||
android:text="@string/TimeOver"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pay_finish"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@drawable/activity_jump_bg"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:text="@string/GORecharge"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
@ -336,4 +336,6 @@ Service Description\n
|
|||
<string name="OnlineCustomerService">Customer Service</string>
|
||||
<string name="VersionUpdate">Version Update</string>
|
||||
<string name="Update">Update</string>
|
||||
<string name="TimeOver">Free time has ended\nPlease recharge</string>
|
||||
<string name="GORecharge">Go to recharge</string>
|
||||
</resources>
|
||||
|
|
@ -326,4 +326,6 @@
|
|||
<string name="OnlineCustomerService">在線客服</string>
|
||||
<string name="VersionUpdate">版本更新</string>
|
||||
<string name="Update">更新</string>
|
||||
<string name="TimeOver">免費時長已結束\n請充值使用</string>
|
||||
<string name="GORecharge">去充值</string>
|
||||
</resources>
|
||||
|
|
@ -325,4 +325,6 @@
|
|||
<string name="OnlineCustomerService">在線客服</string>
|
||||
<string name="VersionUpdate">版本更新</string>
|
||||
<string name="Update">更新</string>
|
||||
<string name="TimeOver">免費時長已結束\n請充值使用</string>
|
||||
<string name="GORecharge">去充值</string>
|
||||
</resources>
|
||||
|
|
@ -344,4 +344,6 @@
|
|||
<string name="OnlineCustomerService">在线客服</string>
|
||||
<string name="VersionUpdate">版本更新</string>
|
||||
<string name="Update">更新</string>
|
||||
<string name="TimeOver">免费时长已结束\n请充值使用</string>
|
||||
<string name="GORecharge">去充值</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue