描述:新增备用充值UI展示

This commit is contained in:
level 2024-08-12 17:37:50 +08:00
parent f5e2e1d7f7
commit 4fd52037f6
8 changed files with 81 additions and 10 deletions

View File

@ -143,6 +143,12 @@
<activity <activity
android:name=".act.LossPreventionActivity" android:name=".act.LossPreventionActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".fragment.recharge.BackupRechargeActivity"
android:screenOrientation="portrait"
/>
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider" android:authorities="${applicationId}.fileprovider"

View File

@ -35,6 +35,7 @@ import com.yingmao.clash.conf.Conf
import com.yingmao.clash.core.Clash import com.yingmao.clash.core.Clash
import com.yingmao.clash.core.model.TunnelState import com.yingmao.clash.core.model.TunnelState
import com.yingmao.clash.entity.ClashNodebBean import com.yingmao.clash.entity.ClashNodebBean
import com.yingmao.clash.fragment.recharge.BackupRechargeActivity
import com.yingmao.clash.listener.AsyncCallBackListener import com.yingmao.clash.listener.AsyncCallBackListener
import com.yingmao.clash.util.ActivityResultLifecycle import com.yingmao.clash.util.ActivityResultLifecycle
import com.yingmao.clash.util.CommonUtils import com.yingmao.clash.util.CommonUtils
@ -170,10 +171,18 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
view.findViewById<Button>(R.id.recharge_but).setOnClickListener { view.findViewById<Button>(R.id.recharge_but).setOnClickListener {
goRechargeWeb() goRechargeWeb()
} }
//备用充值
view.findViewById<Button>(R.id.backupRecharge).setOnClickListener {
goBackupRechargeWeb()
}
setExpireDate() setExpireDate()
setProxyModeView(NewMainActivity.newMainActGlo) setProxyModeView(NewMainActivity.newMainActGlo)
} }
private fun goBackupRechargeWeb() {
startActivity(Intent(activity, BackupRechargeActivity::class.java))
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()

View File

@ -0,0 +1,14 @@
package com.yingmao.clash.fragment.recharge
import android.os.Bundle
import android.view.WindowManager
import com.yingmao.clash.R
import com.yingmao.clash.base.BaseActivity
class BackupRechargeActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_backup_recharge)
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
}
}

View File

@ -87,12 +87,15 @@ class RechargeFragment : BaseFragment() {
container: FrameLayout, container: FrameLayout,
) { ) {
titleBarRl.visibility = View.VISIBLE titleBarRl.visibility = View.VISIBLE
backIv.visibility = View.INVISIBLE backIv.visibility = View.VISIBLE
moreTv.visibility = View.VISIBLE moreTv.visibility = View.VISIBLE
titleTv.visibility = View.VISIBLE titleTv.visibility = View.VISIBLE
moreTv.setOnClickListener { moreTv.setOnClickListener {
startActivity(Intent(activity, ExpensesRecordActivity::class.java)) startActivity(Intent(activity, ExpensesRecordActivity::class.java))
} }
backIv.setOnClickListener {
activity?.finish()
}
titleTv.text = "充值" titleTv.text = "充值"
moreTv.text = "消费记录" moreTv.text = "消费记录"
val view = View.inflate(CommonUtils.getApp(), R.layout.fragment_recharge_new, null) val view = View.inflate(CommonUtils.getApp(), R.layout.fragment_recharge_new, null)

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_141b21"
tools:context=".fragment.recharge.BackupRechargeActivity">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/BackupRechargeView"
android:name="com.yingmao.clash.fragment.recharge.RechargeFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -55,17 +55,38 @@
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/llRecharge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.widget.Button <android.widget.Button
android:id="@+id/recharge_but" android:id="@+id/recharge_but"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:background="@drawable/main_node_bg_spape" android:background="@drawable/main_node_bg_spape"
android:gravity="center" android:gravity="center"
android:text="@string/recharge" android:text="@string/recharge"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="17sp"></android.widget.Button> android:textSize="17sp" />
<android.widget.Button
android:id="@+id/backupRecharge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:background="@drawable/main_node_bg_spape"
android:gravity="center"
android:text="@string/backup_recharge"
android:textColor="@color/white"
android:textSize="17sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline" android:id="@+id/guideline"

View File

@ -32,4 +32,5 @@
<color name="translucent_bg">#00000000</color> <color name="translucent_bg">#00000000</color>
<color name="ic_taizi_logo_background">#FDFDFD</color> <color name="ic_taizi_logo_background">#FDFDFD</color>
<color name="black_141b21">#141b21</color>
</resources> </resources>

View File

@ -33,6 +33,7 @@
<string name="verification_success">验证成功!</string> <string name="verification_success">验证成功!</string>
<string name="accelerate">加速</string> <string name="accelerate">加速</string>
<string name="recharge">充值</string> <string name="recharge">充值</string>
<string name="backup_recharge">备用充值</string>
<string name="mine">我的</string> <string name="mine">我的</string>
<string name="current_node">当前节点</string> <string name="current_node">当前节点</string>
<string name="node_hongkong">香港节点</string> <string name="node_hongkong">香港节点</string>