马上连更改

This commit is contained in:
level 2025-05-13 09:49:33 +08:00
parent b01a87d25f
commit 954ccfad39
49 changed files with 723 additions and 760 deletions

View File

@ -15,36 +15,36 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
import com.bumptech.glide.util.Util
import com.chad.library.adapter.base.BaseQuickAdapter
import com.cncat.vpn.common.constants.Intents
import com.cncat.vpn.common.log.Log
import com.cncat.vpn.service.model.Profile
import com.cncat.vpn.service.remote.IProfileManager
import com.cncat.vpn.service.remote.IRemoteService
import com.google.gson.Gson
import com.google.gson.JsonParser
import com.tencent.mmkv.MMKV
import com.yingmao.clash.R
import com.yingmao.clash.act.ProxyModeActivity.ProxyMode
import com.yingmao.clash.act.NewMainActivity.Companion.clashBinder
import com.yingmao.clash.act.NewMainActivity.Companion.profileBinder
import com.yingmao.clash.act.NewMainActivity.Companion.subUrl
import com.yingmao.clash.app.MainApplication
import com.yingmao.clash.base.BaseActivity
import com.cncat.vpn.common.constants.Intents
import com.cncat.vpn.common.log.Log
import com.yingmao.clash.conf.BZYConstants
import com.yingmao.clash.conf.Conf
import com.yingmao.clash.entity.ClashNodebBean
import com.yingmao.clash.fragment.NewAccFragment
import com.yingmao.clash.fragment.NewAccFragment.Companion.CHECK_NODE_RESULT_CODE
import com.yingmao.clash.fragment.NewAccFragment.Companion.clashRunning
import com.yingmao.clash.fragment.NewAccFragment.Companion.isGlo
import com.yingmao.clash.remote.Resource
import com.cncat.vpn.service.model.Profile
import com.cncat.vpn.service.remote.IProfileManager
import com.cncat.vpn.service.remote.IRemoteService
import com.yingmao.clash.app.MainApplication
import com.yingmao.clash.fragment.home.HomeFragment
import com.yingmao.clash.util.Utils
import com.yingmao.clash.view.RxToast
import com.yingmao.clash.view.adapter.NodeListAdapter
import com.yingmao.clash.view.dialog.DialogDoMainChoose
import com.yingmao.clash.view.dialog.DialogSureRestartChoose
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.MainScope
@ -56,53 +56,50 @@ import java.util.Timer
import java.util.TimerTask
import java.util.UUID
class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
class ChangeNodeActivity : BaseActivity() {
companion object {
private var currentNode: MutableList<ClashNodebBean> = mutableListOf()
// var clash: ClashManager? = null
}
private lateinit var swipeLayout: SwipeRefreshLayout
private lateinit var changeNodeVM: ChangeNodeVM
private lateinit var nodeListRv: RecyclerView
private lateinit var nodeItemTest: TextView
private var names: List<String>? = null
private lateinit var aiBack: AppCompatImageView
private var broadcastReceiver: BroadcastReceiver? = null
private var cacheNodeStr: String? = ""
// private var checkedNode: ClashNodebBean? = null
private var uuid: UUID? = null
private var testRuning = false
// var cprofile: ProfileManager? = null
// private var currentNode: Profile? = null
private lateinit var tvProA:TextView
private lateinit var tvProj:TextView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_change_node)
setMoreBar("线路测速", this)
changeNodeVM = ViewModelProvider(this).get(ChangeNodeVM::class.java)
initData()
changeNodeVM = ViewModelProvider(this)[ChangeNodeVM::class.java]
initViews()
// cprofile = ProfileManager(this)
initData()
}
override fun onBackPressed() {
intent.putExtra(BZYConstants.EXTRA_KEY_IS_RUNING, is_runing)
setResult(CHECK_NODE_RESULT_CODE, intent)
setResult(2, intent)
super.onBackPressed()
}
private fun initData() {
// clash = MainApplication.getApp()?.let { ClashManager(it) }
cacheNodeStr = MMKV.defaultMMKV().decodeString(BZYConstants.NODE_All_ITEM_NAME_KEY, "");
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
val px: ProxyMode
if (isGlobal) {
px = ProxyMode.GLOBAL
} else {
px = ProxyMode.PAC
}
setBackground(px)
cacheNodeStr = MMKV.defaultMMKV().decodeString(BZYConstants.NODE_All_ITEM_NAME_KEY, "")
val intentFilter = IntentFilter(Intents.ACTION_NODE_LIST)
android.util.Log.i("NODETA","DAAAAqqqqq::AA")
broadcastReceiver = NodeListBR()
if (Build.VERSION.SDK_INT >= 34 && applicationInfo.targetSdkVersion >= 34) {
registerReceiver(
@ -116,55 +113,51 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
intentFilter
)
}
// registerReceiver(
// broadcastReceiver,
// intentFilter
// )
}
@SuppressLint("SetTextI18n")
private fun initViews() {
tvProA=findViewById(R.id.tvProA)
tvProj=findViewById(R.id.tvProj)
aiBack = findViewById(R.id.aiBack)
nodeItemTest = findViewById(R.id.node_item_test)
nodeItemTest.setOnClickListener(this@ChangeNodeActivity)
swipeLayout = findViewById(R.id.swipeLayout)
nodeListRv = findViewById(R.id.rv_node_list)
tvProA.setOnClickListener {
setBackground(ProxyMode.PAC)
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
}
tvProj.setOnClickListener {
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, true)
setBackground(ProxyMode.GLOBAL)
}
aiBack.setOnClickListener {
onBackPressed()
}
swipeLayout = findViewById(R.id.swipeLayout)
initRefreshLayout()
nodeListRv = findViewById(R.id.rv_node_list)
var userTrafficTv: TextView = findViewById(R.id.node_user_traffic)
findViewById<ImageView>(R.id.iv_back).setOnClickListener {
onBackPressed()
}
initAdapter()
// Log.d("initViews cacheNodeStr==>${cacheNodeStr}")
if (!TextUtils.isEmpty(cacheNodeStr)) {
currentNode = getNodesInfo(cacheNodeStr!!)
setNewData(currentNode)
}
// if (!TextUtils.isEmpty(serStore.userTraffic)) {
// userTrafficTv.visibility=View.VISIBLE
// var jo = JsonParser.parseString(serStore.userTraffic).asJsonObject
// var t = jo.get("total")
// var d = jo.get("download").asLong
// var u = jo.get("upload").asLong
// val trafficUsedInGB = String.format("%.2f", (d + u) / 1024.0 / 1024.0 / 1024.0)
// userTrafficTv.text="已用流量:${trafficUsedInGB}GB"
// }
}
private fun getNodesInfo(json: String): MutableList<ClashNodebBean> {
var mList: MutableList<ClashNodebBean> = mutableListOf()
val mList: MutableList<ClashNodebBean> = mutableListOf()
if (TextUtils.isEmpty(json)) {
return mList
}
val gson = Gson()
var ja = JsonParser.parseString(json).asJsonArray
val ja = JsonParser.parseString(json).asJsonArray
var cnb = ClashNodebBean("自动选择", "", "", 1, "", "", 0, true);
val cnb = ClashNodebBean("自动选择", "", "", 1, "", "", 0, true);
mList.add(cnb)
for (i in 0 until ja.size()) {
var bean = gson.fromJson(ja.get(i).asString, ClashNodebBean::class.java)
@ -176,30 +169,26 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
inner class NodeListBR : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
android.util.Log.i("NODETA","DAAAA::"+intent?.action)
when (intent?.action) {
Intents.ACTION_NODE_LIST -> {
Log.d("ACTION_NODE_LIST ACTION_NODE_LIST")
// val parcelableArrayListExtra = intent.getParcelableArrayListExtra<Map<String,Any>>("")
hideLoading()
// stopTimer()
timerJob?.cancel()
dialogDoMainChoose?.dismiss()
// var json = intent.getStringExtra("node_list")
// Log.d("onReceive: $json")
// currNodeJsonA = json
var json = serStore.nodes
// Log.d("serStore.nodes: $json")
val json = serStore.nodes
if (TextUtils.isEmpty(json)) {
return
}
android.util.Log.i("NODETA","subUrl::"+subUrl)
android.util.Log.i("NODETA","json::"+json)
//缓存订阅地址
UIMainActivity.subUrl = nowSubUrl
subUrl = nowSubUrl
MMKV.defaultMMKV().encode(BZYConstants.PROFILE_SUB_URL, nowSubUrl)
//缓存节点
MMKV.defaultMMKV().encode(BZYConstants.NODE_All_ITEM_NAME_KEY, json)
currentNode = getNodesInfo(json)
// val listType = object : TypeToken<MutableList<ClashNodebBean>>() {}.type
// currentNode = gson.fromJson(json, listType)
setNewData(currentNode)
swipeLayout.isRefreshing = false
}
@ -226,19 +215,15 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
}
val remote = Resource<IRemoteService>()
var GetNodeTimeOutNum = 5;
var GetNodeTimeOutNum = 5
var is_runing = false
private var timer: Timer? = null
private var timerTask: TimerTask? = null
var nowSubUrl: String = ""
private fun updateProfile(isDelete: Boolean) {
// showLoading("正在获取...", this@ChangeNodeActivity)
try {
launch(Dispatchers.IO) {
UIMainActivity.profileBinder?.let { profileManager ->
profileBinder?.let { profileManager ->
var mProfile = profileManager.queryAll().find {
it.name == Conf.getClashConfName(this@ChangeNodeActivity.applicationContext)
}
@ -315,7 +300,7 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
override fun onStart() {
super.onStart()
UIMainActivity.subUrl?.let {
subUrl?.let {
nowSubUrl = it
}
doProfile()
@ -323,9 +308,6 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
}
fun doProfile() {
if (TextUtils.isEmpty(cacheNodeStr)) {
}
showLoading("正在获取...", this@ChangeNodeActivity)
startTimer()
updateProfile(false)
@ -339,26 +321,21 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
}
}
private fun updateTestBut(str: String) {
nodeItemTest.text=str
}
val reloadLock = Semaphore(10)
private fun setPing() {
if (!HomeFragment.clashRunning) {
RxToast.info("请先开启加速后,再进行测试.");
if (!clashRunning) {
RxToast.info("请先开启加速后,再进行测试.")
return
}
if (testRuning) {
RxToast.info("正在测速中.");
RxToast.info("正在测速中.")
return
}
testRuning = true
// updateMoreBar("测速中")
updateTestBut("测速中")
launch(Dispatchers.IO) {
var group = reloadLock.withPermit {
UIMainActivity.clashBinder?.let { cb ->
clashBinder?.let { cb ->
var names = cb.queryProxyGroupNames(false)
if (names.isNotEmpty()) {
cb.healthCheck(names[0])
@ -370,7 +347,6 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
}
}
testRuning = false
runOnUiThread { updateTestBut("线路测速") }
var newDatas = mutableListOf<ClashNodebBean>();
group?.proxies?.forEach { proxy ->
Log.d("node==>${proxy}")
@ -398,12 +374,11 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
runOnUiThread {
if (nodes != null) {
nodeListAdapter.setNewInstance(nodes)
var selected_name =
val selectedName =
MMKV.defaultMMKV().decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "");
for ((index, node) in nodes.withIndex()) {
if (node.name == selected_name) {
if (node.name == selectedName) {
nodeListAdapter.selectedPosition = index
// checkedNode = node
}
}
nodeListAdapter.notifyDataSetChanged()
@ -418,30 +393,19 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
nodeListAdapter.selectedPosition
nodeListAdapter.setOnItemClickListener { baseQuickAdapter: BaseQuickAdapter<*, *>, view: View, position: Int ->
(baseQuickAdapter.getItem(position) as ClashNodebBean).let { profile ->
com.cncat.vpn.common.log.Log.i("select_node : ${profile.name}")
Log.i("select_node : ${profile.name}")
// checkedNode = profile
MMKV.defaultMMKV().encode(BZYConstants.NODE_SELECTED_NAME_KEY, profile.name)
nodeListAdapter.notifyItemChanged(nodeListAdapter.selectedPosition)
nodeListAdapter.selectedPosition =
if (nodeListAdapter.selectedPosition == position) -1 else position
nodeListAdapter.notifyItemChanged(position)
// launch {
// withClash {
// val names = queryProxyGroupNames(false)
// val mode = queryOverride(Clash.OverrideSlot.Session).mode
// com.cncat.vpn.common.log.Log.d("names 222==>${names}, mode==>$mode")
// names?.let { ns ->
// if (ns.isNotEmpty()) {
// patchSelector(ns[0], profile.name)
// }
// }
// }
// }
android.util.Log.i("AAAAAAAAAAAAAA:","profile.name:::"+{profile.name})
launch(Dispatchers.IO) {
val intent = Intent()
intent.putExtra(BZYConstants.MMKV_KEY_SELECT_NODE_NAME, profile.name)
intent.putExtra(BZYConstants.EXTRA_KEY_IS_RUNING, is_runing)
setResult(CHECK_NODE_RESULT_CODE, intent)
setResult(2, intent)
finish()
}
}
@ -450,11 +414,11 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
private fun createProfile() {
launch(Dispatchers.IO) {
UIMainActivity.profileBinder?.let { pro ->
profileBinder?.let { pro ->
uuid?.let { uu ->
pro.delete(uu)
delay(500)
setSub2(pro, UIMainActivity.subUrl)
setSub2(pro, subUrl)
}
}
}
@ -588,7 +552,6 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
private fun saveSubUrl() {
var currentHost = MMKV.defaultMMKV()
.decodeString(BZYConstants.MMKV_KEY_CURRENT_HOST, "")
// com.cncat.vpn.common.log.Log.d("tryButton currentHost==>${currentHost}")
var oldUrl = nowSubUrl
currentHost?.let { changeSubUrl(oldUrl, it) }
}
@ -600,18 +563,35 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
timerTask = null
timer = null
}
override fun onClick(p0: View?) {
when (p0?.id) {
R.id.node_item_test -> {
setPing()
private fun setBackground(proxyMode: ProxyMode) {
when (proxyMode) {
ProxyMode.PAC -> {
isGlo = false
tvProA.setBackgroundResource(R.drawable.oc_proxy_choose_bg)
tvProj.setBackgroundResource(0)
tvProA.setTextColor(Color.parseColor("#FFFFFF"))
tvProj.setTextColor(Color.parseColor("#B36C1B"))
sendMode(false)
}
else -> {
ProxyMode.GLOBAL -> {
isGlo = true
tvProA.setBackgroundResource(0)
tvProA.setTextColor(Color.parseColor("#B36C1B"))
tvProj.setTextColor(Color.parseColor("#FFFFFF"))
tvProj.setBackgroundResource(R.drawable.oc_proxy_choose_bg)
sendMode(true)
}
else->{
}
}
}
fun sendMode(type: Boolean) {
val intent = Intent(Intents.ACTION_Glo_Mode)
intent.putExtra("mode", type)
sendBroadcast(
intent.setPackage(this.packageName)
)
}
}

View File

@ -723,10 +723,14 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
private inner class IOnCheckedChangeListener : CompoundButton.OnCheckedChangeListener {
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
if (isChecked)
if (isChecked){
passwordEt.transformationMethod = HideReturnsTransformationMethod.getInstance()
else
passwordEt.setSelection(passwordEt.text.length)
} else{
passwordEt.transformationMethod = PasswordTransformationMethodBigDot()
passwordEt.setSelection(passwordEt.text.length)
}
}
}
private fun showUpdateDialog(url: String, illustrate: String, isForce: Boolean) {

View File

@ -15,6 +15,7 @@ import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.afollestad.materialdialogs.MaterialDialog

View File

@ -67,6 +67,8 @@ import com.cncat.vpn.service.remote.IClashManager
import com.cncat.vpn.service.remote.ILogObserver
import com.cncat.vpn.service.remote.IProfileManager
import com.cncat.vpn.service.remote.wrap
import com.yingmao.clash.fragment.NewAccFragment.Companion.CHECK_NODE_REQUEST_CODE
import com.yingmao.clash.net.http.entity.ExpensesRecordRsp
import com.yingmao.clash.util.AESUtil
import com.yingmao.clash.util.CommonUtils
import com.yingmao.clash.util.Utils
@ -103,7 +105,7 @@ class NewMainActivity : BaseActivity() {
public val fragments = arrayListOf<Fragment>()
private lateinit var iv_slider: ImageView
private lateinit var ll_slider: LinearLayout
private lateinit var ll_slider: ConstraintLayout
private lateinit var tv_exit: ConstraintLayout
// private lateinit var tv_band: TextView
lateinit var containerVP: ViewPager2
@ -118,7 +120,11 @@ class NewMainActivity : BaseActivity() {
private var activityDialog: ActivityViewDialog? = null
private var timer: Timer? = null
private var u_timerTask: TimerTask? = null
private lateinit var tvExitTime:TextView
private lateinit var clTopUp:ConstraintLayout
private lateinit var clLocation:ConstraintLayout
private lateinit var tvTemporaryAccount:TextView
private val mPageInfo = PageInfo()
companion object {
//记录心跳失败次数
var HEART_BEAT_FAILURE_FREQUENCY = 0
@ -226,24 +232,6 @@ class NewMainActivity : BaseActivity() {
profileBinder =
MainApplication.getApp()?.let { ProfileManager(it).wrap() as IProfileManager }
clashBinder = MainApplication.getApp()?.let { ClashManager(it).wrap() as IClashManager }
//文件权限请求
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// if (ContextCompat.checkSelfPermission(
// this,
// Manifest.permission.WRITE_EXTERNAL_STORAGE
// ) != PackageManager.PERMISSION_GRANTED
// ) {
// ActivityCompat.requestPermissions(
// this,
// arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
// REQUEST_CODE_WRITE_STORAGE
// )
// } else {
//
// }
// }
mainAtyVM = ViewModelProvider(this).get(MainAtyVM::class.java)
observe(this, mainAtyVM)
@ -251,15 +239,10 @@ class NewMainActivity : BaseActivity() {
mainAtyVM.startHeartBeat()
initViews()
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
mainAtyVM.appCheck()
mainAtyVM.getAirNodes()
val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
// val uc = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_VPN_UserCommand, "")
// Log.i("newMainActGlo isGlobal==>${isGlobal}, uc==>${uc}")
newMainActGlo = isGlobal
mainAtyVM.getExpensesRecord(mPageInfo)
startLog()
// showBindAccount()
firstEntry()
@ -485,7 +468,6 @@ class NewMainActivity : BaseActivity() {
mmkv.encode(BZYConstants.MMKV_KEY_VPN_EXPIRED, expired ?: true)
mmkv.encode(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD, nowExpireTime)
setExpireDate()
fragments.filterIsInstance<NewAccFragment>().forEach { it.setExpireDate() }
checkPayResultDia?.dismiss()
mainAtyVM.getAirNodes()
RxToast.info(resources.getString(R.string.SuccessfullyUpdatedUserInformation))
@ -585,6 +567,29 @@ class NewMainActivity : BaseActivity() {
}
}
}
}else if(httpStatus.reqType == HttpReqType.EXPENSES_RECORD){
if(httpStatus.rsp is ExpensesRecordRsp){
httpStatus.rsp.let { expensesRecordRsp ->
if(expensesRecordRsp.code == "1000"){
if(expensesRecordRsp.data != null) {
val expensesRecordList = expensesRecordRsp.data.expensesRecords
if(expensesRecordList!=null){
if(expensesRecordList.size>0){
tvTemporaryAccount.text=resources.getString(R.string.VIPMember)
}else{
tvTemporaryAccount.text=resources.getString(R.string.TemporaryAccount)
}
}else{
tvTemporaryAccount.text=resources.getString(R.string.TemporaryAccount)
}
}else{
tvTemporaryAccount.text=resources.getString(R.string.TemporaryAccount)
}
}else{
tvTemporaryAccount.text=resources.getString(R.string.TemporaryAccount)
}
}
}
}
}
@ -616,7 +621,33 @@ class NewMainActivity : BaseActivity() {
private fun initViews() {
// tv_rechar = findViewById(R.id.recharge_but)
clTopUp=findViewById(R.id.clTopUp)
tvExitTime=findViewById(R.id.tvExitTime)
containerVP = findViewById(R.id.container)
clLocation=findViewById(R.id.clLocation)
tvTemporaryAccount=findViewById(R.id.tvTemporaryAccount)
clLocation.setOnClickListener {
if (checkExpire()) {
RxToast.info(resources.getString(R.string.AccountExpired))
return@setOnClickListener
}
val intent = Intent(this, ChangeNodeActivity::class.java)
if (!TextUtils.isEmpty(newUuid)) {
intent.putExtra(BZYConstants.MMKV_KEY_CURRENT_NODE, newUuid)
intent.putExtra(
BZYConstants.EXTRA_KEY_IS_RUNING, clashRunning
)
}
startActivityForResult(
intent, 2
)
drawer.close()
}
clTopUp.setOnClickListener {
goBackupRechargeWeb()
}
containerVP.offscreenPageLimit = 1
if (fragments.isNotEmpty()) fragments.clear()
fragments.add(NewAccFragment())
@ -742,7 +773,7 @@ class NewMainActivity : BaseActivity() {
goBackupRechargeWeb()
}
findViewById<TextView>(R.id.tv_notice).setOnClickListener {//通知
findViewById<ConstraintLayout>(R.id.clMessage).setOnClickListener {//通知
val notice =
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_NOTICE_READ, "暂无新通知")!!
val download_url =
@ -834,7 +865,7 @@ class NewMainActivity : BaseActivity() {
public fun goBackupRechargeWeb() {
startActivityForResult(
Intent(this@NewMainActivity, BackupRechargeActivity::class.java),
Intent(this@NewMainActivity, MemberRechargeActivity::class.java),
REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY
)
}
@ -1019,6 +1050,7 @@ class NewMainActivity : BaseActivity() {
}
tv_expire_date.text =resources.getString(R.string.expire_date)+":"+ endTimeInfo
tvExitTime.text=resources.getString(R.string.expire_date)+":"+ endTimeInfo
}
private fun showUpdateDialog(url: String, illustrate: String, isForce: Boolean) {
@ -1190,13 +1222,22 @@ class NewMainActivity : BaseActivity() {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY) {
if (activityDialog != null) {
activityDialog?.dismiss()
}
goCheckLogin()
showBindAccount()
}else if(requestCode == 2){
val node = data?.extras?.getString(BZYConstants.MMKV_KEY_SELECT_NODE_NAME)
node.let {
fragments.filterIsInstance<NewAccFragment>().forEach {
if (node != null) {
it.onCheckNodeChange(node)
}
}
}
}
}
@ -1205,5 +1246,17 @@ class NewMainActivity : BaseActivity() {
stopUploadTimer()
mainAtyVM.stopHeartBeat()
}
class PageInfo {
var page = 1
fun nextPage() {
page++
}
fun reset() {
page = 1
}
val isFirstPage: Boolean
get() = page == 1
}
}

View File

@ -11,6 +11,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.appcompat.widget.AppCompatImageView
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -74,7 +75,6 @@ class SettingActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_setting)
showTitleBar(resources.getString(R.string.setting))
initView()
mainAtyVM = ViewModelProvider(this)[MainAtyVM::class.java]
observe(this, mainAtyVM)
@ -82,8 +82,11 @@ class SettingActivity : BaseActivity() {
@RequiresApi(Build.VERSION_CODES.R)
private fun initView() {
tv_proxy_model = findViewById<TextView>(R.id.tv_proxy_model)
tv_proxy_model = findViewById<TextView>(R.id.tv_proxy_model)
findViewById<AppCompatImageView>(R.id.aiBack).setOnClickListener {
finish()
}
findViewById<View>(R.id.ll_proxy_mode).setOnClickListener {
val intent = Intent(this, ProxyModeActivity::class.java)
startActivity(intent)

View File

@ -715,13 +715,13 @@ class SplashActivity : BaseActivity() {
showUpdateDialog(md.versionPath!!, md.illustrate!!, false)
}
}else{
val intent = Intent(this@SplashActivity, UIMainActivity::class.java)
val intent = Intent(this@SplashActivity, NewMainActivity::class.java)
startActivity(intent)
finish()
}
}
}else{
val intent = Intent(this@SplashActivity, UIMainActivity::class.java)
val intent = Intent(this@SplashActivity, NewMainActivity::class.java)
startActivity(intent)
finish()
}
@ -1054,7 +1054,7 @@ class SplashActivity : BaseActivity() {
}
override fun cancel() {
val intent = Intent(this@SplashActivity, UIMainActivity::class.java)
val intent = Intent(this@SplashActivity, NewMainActivity::class.java)
startActivity(intent)
finish()
}

View File

@ -69,6 +69,8 @@ open class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope(), Br
super.onCreate(savedInstanceState)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; //竖屏
StatusBarUtils.with(this).init()
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
override fun setContentView(layoutResID: Int) {

View File

@ -19,6 +19,8 @@ import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContract
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity.RESULT_OK
import androidx.appcompat.widget.AppCompatImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.cncat.vpn.common.constants.Intents
@ -61,8 +63,7 @@ import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatchers.IO),
View.OnClickListener {
class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatchers.IO){
companion object {
@ -74,26 +75,19 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
const val Clash_Started = 11
const val Clash_Starting = 22
const val Clash_Stop = 33
public var currNodeJsonA: String? = null
var isGlo: Boolean = false
var clashRunning: Boolean = false
}
lateinit var accelerateViewModel: AccelerateViewModel
private lateinit var rxDialogShapeLoading: RxDialogShapeLoading
private lateinit var rxDialogSureCancel: RxDialogSureCancel
private lateinit var accelerateIv: ImageView
private lateinit var tv_proxy_model: TextView
private lateinit var tv_end_time: TextView
private lateinit var iv_proxy_mode: ImageView
private lateinit var nodeNameTv: TextView
private lateinit var countryIv: ImageView
// var currentNode: Profile? = null
private var reConnection = false
private var connectId=-1
private lateinit var clickOnLink: ConstraintLayout
private lateinit var InTheLink: AppCompatImageView
private lateinit var ClickTheLink: TextView
override fun init(
titleBarRl: RelativeLayout,
backIv: ImageView,
@ -147,66 +141,47 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
ClashBP(), intentFilter
)
}
// context?.registerReceiver(
// ClashBP(), intentFilter
// )
}
private fun initViews(view: View) {
val checkNodeRl = view.findViewById<RelativeLayout>(R.id.rl_check_node)
nodeNameTv = view.findViewById(R.id.tv_node)
countryIv = view.findViewById(R.id.iv_country)
tv_end_time = view.findViewById(R.id.tv_end_time)
clickOnLink=view.findViewById(R.id.clickOnLink)
InTheLink=view.findViewById(R.id.InTheLink)
ClickTheLink=view.findViewById(R.id.ClickTheLink)
clickOnLink.setOnClickListener {
if (clashRunning) {
val rxDialogSureCancel = RxDialogSureCancel(activity)
if (isAdded) {
rxDialogSureCancel.setContent(requireActivity().resources.getString(R.string.StopAccelerating))
}
rxDialogSureCancel.setCancelListener {
rxDialogSureCancel.cancel()
}
rxDialogSureCancel.setSureListener {
stop_u_timer()
stopClash()
clickOnLink.setBackgroundResource(R.drawable.home_circle_select)
InTheLink.setImageResource(R.mipmap.ic_linek)
ClickTheLink.text=requireActivity().resources.getString(R.string.OpenConnection)
rxDialogSureCancel.cancel()
reConnection = false
Log.d("NewAccFragment connectId${connectId}")
if(connectId!=-1){
accelerateViewModel.appStopStatus(connectId)
}
//不记住
// currentNode = MMKV.defaultMMKV().decodeParcelable(
// BZYConstants.MMKV_KEY_CURRENT_NODE,
// Node::class.java
// )
// setNodeNameAndImg(currentNode)
}
rxDialogSureCancel.show()
checkNodeRl.setOnClickListener(this)
accelerateIv = view.findViewById(R.id.iv_accelerate)
accelerateIv.setOnClickListener(this)
tv_proxy_model = view.findViewById(R.id.tv_proxy_model)
iv_proxy_mode = view.findViewById(R.id.iv_proxy_mode)
view.findViewById<View>(R.id.ll_proxy_mode).setOnClickListener {
// startActivity(Intent(activity, ProxyModeActivity::class.java))
val intent = Intent(activity, ProxyModeActivity::class.java)
startActivityForResult(intent, Proxy_Mode_REQUEST_CODE)
} else {
startClash()
}
}
var selected_name =
MMKV.defaultMMKV().decodeString(BZYConstants.NODE_SELECTED_NAME_KEY, "");
if (!TextUtils.isEmpty(selected_name)) {
setNodeNameAndImg(selected_name!!)
}
view.findViewById<Button>(R.id.recharge_but).setOnClickListener {
goNewRecharge()
}
//备用充值
view.findViewById<Button>(R.id.backupRecharge).setOnClickListener {
goRechargeWeb()
}
view.findViewById<ImageView>(R.id.refresh_expire_iv).setOnClickListener {
updateUserInfo()
}
setExpireDate()
setProxyModeView(NewMainActivity.newMainActGlo)
}
override fun onResume() {
super.onResume()
// val isGlobal = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
lifecycleScope.launch {
// if (isGlobal) {
// iv_proxy_mode.setImageResource(R.drawable.ic_s_global)
// tv_proxy_model.text = "全局模式"
// } else {
// iv_proxy_mode.setImageResource(R.drawable.smart)
// tv_proxy_model.text = "智能模式"
// }
Log.d("clashRunning==>$clashRunning")
if (clashRunning) {
stateChanged(Clash_Started, false)
@ -216,64 +191,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
}
// protected val uiStore by lazy { MainApplication.getApp()?.applicationContext?.let { UiStore(it) } }
override fun onClick(v: View?) {
when (v?.id) {
R.id.rl_check_node -> {
if (checkExpire()) {
if (isAdded) {
RxToast.info(requireActivity().resources.getString(R.string.AccountExpired))
}
return
}
val intent = Intent(CommonUtils.getApp(), ChangeNodeActivity::class.java)
if (!TextUtils.isEmpty(NewMainActivity.newUuid)) {
intent.putExtra(BZYConstants.MMKV_KEY_CURRENT_NODE, NewMainActivity.newUuid)
intent.putExtra(BZYConstants.EXTRA_KEY_IS_RUNING, clashRunning)
}
startActivityForResult(intent, CHECK_NODE_REQUEST_CODE)
}
R.id.iv_accelerate -> {
// Logger.i("mState:${mState}")
if (clashRunning) {
val rxDialogSureCancel = RxDialogSureCancel(activity)
if (isAdded) {
rxDialogSureCancel.setContent(requireActivity().resources.getString(R.string.StopAccelerating))
}
rxDialogSureCancel.setCancelListener {
rxDialogSureCancel.cancel()
}
rxDialogSureCancel.setSureListener {
// Core.stopService()
stop_u_timer()
stopClash()
rxDialogSureCancel.cancel()
reConnection = false
Log.d("NewAccFragment connectId${connectId}")
if(connectId!=-1){
accelerateViewModel.appStopStatus(connectId)
}
}
rxDialogSureCancel.show()
} else {
startClash()
// connectVPNSS(currentNode)
}
// }
}
}
}
private fun selectActive() {
}
public fun stopClash() {
context?.stopClashService()
}
@ -284,26 +201,19 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (isAdded) {
RxToast.info(resources.getString(R.string.AccountExpired))
}
return
}
// if (!NewMainActivity.isSubed) {
// if(isAdded){
// RxToast.info(resources.getString(R.string.Initializing))
// }
// return
// }
launch {
NewMainActivity.profileBinder?.let { pm ->
val active = pm.queryActive()
if (active == null) {
com.cncat.vpn.common.log.Log.d("startClash: 未选择")
Log.d("startClash: 未选择")
val pro = pm.queryAll().find {
it.name == Conf.getClashConfName(this@NewAccFragment.context)
}
pro?.let { profile ->
com.cncat.vpn.common.log.Log.d("new setactive name " + profile.name)
Log.d("new setactive name " + profile.name)
pm.setActive(profile)
newUuid = profile.uuid.toString();
@ -320,9 +230,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
delay(500)
}
val vpnRequest = context?.startClashService()
try {
android.util.Log.i("VVVVVVVVVVVV:","VVVV:"+vpnRequest)
start_u_timer()
if (vpnRequest != null) {
val result = startActivityForResult(
@ -332,9 +242,15 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
stateChanged(Clash_Starting, true)
context?.startClashService()
accelerateViewModel.appStartupStatus()
// clashRunning = true
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
clickOnLink.setBackgroundResource(R.drawable.home_circle_select)
InTheLink.setImageResource(R.mipmap.ic_click)
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
}
}else{
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
InTheLink.setImageResource(R.mipmap.ic_click)
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
accelerateViewModel.appStartupStatus()
}
} catch (e: Exception) {
@ -343,6 +259,13 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
}
if(isAdded){
android.util.Log.i("VVVVVVVVVVVV:","VVVV222:")
InTheLink.setImageResource(R.mipmap.ic_click)
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
}
}
}
@ -365,20 +288,13 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
inner class ClashBP : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
com.cncat.vpn.common.log.Log.i("action==>" + intent?.action)
Log.i("action==>" + intent?.action)
when (intent?.action) {
Intents.ACTION_CLASH_STARTED -> {
if (::rxDialogShapeLoading.isInitialized) {
rxDialogShapeLoading.cancel()
}
accelerateIv.isSelected = true
clashRunning = true
// MMKV.defaultMMKV().encode(
// BZYConstants.MMKV_KEY_CURRENT_NODE,
// currentNode
// )
// setNodeNameAndImg(currentNode!!.name)
if (isAdded) {
RxToast.success(resources.getString(R.string.AccelerateSuccess))
}
@ -389,14 +305,12 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (::rxDialogShapeLoading.isInitialized) {
rxDialogShapeLoading.cancel()
}
accelerateIv.isSelected = false
clashRunning = false
stop_u_timer()
}
Intents.ACTION_CLASH_REQUEST_STOP -> {
// clashRunning = false
com.cncat.vpn.common.log.Log.d("ACTION_CLASH_REQUEST_STOP")
Log.d("ACTION_CLASH_REQUEST_STOP")
if (::rxDialogShapeLoading.isInitialized) {
if (!rxDialogShapeLoading.isShowing) {
if (isAdded) {
@ -431,18 +345,11 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (::rxDialogShapeLoading.isInitialized) {
rxDialogShapeLoading.cancel()
}
accelerateIv.isSelected = true
// MMKV.defaultMMKV().encode(
// BZYConstants.MMKV_KEY_CURRENT_NODE,
// currentNode
// )
// setNodeNameAndImg(currentNode!!.name)
if (isShowToast) {
if (isAdded) {
RxToast.success(resources.getString(R.string.AccelerateSuccess))
}
}
// File("${Core.deviceStorage.noBackupFilesDir}/${BaseService.CONFIG_FILE}").delete()
accelerateViewModel.appStartupStatus()
}
@ -450,10 +357,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (::rxDialogShapeLoading.isInitialized) {
rxDialogShapeLoading.cancel()
}
accelerateIv.isSelected = false
// if (reConnection) {
// connectVPNSS(currentNode)
// }
}
Clash_Starting -> {
@ -481,7 +384,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
com.cncat.vpn.common.log.Log.i("onActivityResult ==>>> requestCode:${requestCode} resultCode:${resultCode}")
Log.i("onActivityResult ==>>> requestCode:${requestCode} resultCode:${resultCode}")
android.util.Log.i("AAAAAAAAAAAAAA:","onActivityResult ==>>> requestCode:${requestCode} resultCode:${resultCode}")
if (requestCode == REQUEST_CONNECT) {
if (resultCode == Activity.RESULT_OK) {
if (clashRunning) {
@ -497,10 +402,8 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
} else if (requestCode == CHECK_NODE_REQUEST_CODE) {
val node = data?.extras?.getString(BZYConstants.MMKV_KEY_SELECT_NODE_NAME)
val is_runing = data?.extras?.getBoolean(BZYConstants.EXTRA_KEY_IS_RUNING)
// val node = data?.extras?.getSerializable(BZYConstants.MMKV_KEY_SELECT_NODE) as Profile
Log.d("onActivityResult ==>>> Node:${node}")
node?.let {
setNodeNameAndImg(node)
if (clashRunning) {
Log.d("clashRunning $clashRunning")
} else {
@ -518,74 +421,26 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
checkGlo()
}
}
@SuppressLint("SimpleDateFormat")
fun setExpireDate() {
var isExpire = checkExpire()
// var isExpire = false
var endTimeInfo = "--"
if (isExpire) {
if (isAdded) {
endTimeInfo = resources.getString(R.string.AccountExpired)
}
} else {
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, "")
if (decodeString.isNullOrEmpty()) {
//获取当前系统语言
val config = resources.configuration
val language = config.locale.language
if (language.equals("en")) {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val localEN = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm", localEN)
} else {
val localEN = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm", localEN)
}
endTimeInfo = dateFormat.format(validPeriod)
} else {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
SimpleDateFormat("yyyy年MM月dd日 HH:mm")
} else {
SimpleDateFormat("yyyy年MM月dd日 HH:mm")
}
endTimeInfo = dateFormat.format(validPeriod)
}
fun onCheckNodeChange(node:String){
node.let {
if (clashRunning) {
Log.d("clashRunning $clashRunning")
} else {
if (decodeString == "English") {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val locale = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm", locale)
} else {
val locale = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm", locale)
}
endTimeInfo = dateFormat.format(validPeriod)
} else {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
SimpleDateFormat("yyyy年MM月dd日 HH:mm")
} else {
SimpleDateFormat("yyyy年MM月dd日 HH:mm")
}
endTimeInfo = dateFormat.format(validPeriod)
}
startClash()
}
checkGlo()
}.run {
if (!clashRunning) {
startClash()
}
}
tv_end_time.text = endTimeInfo
}
private fun checkExpire(): Boolean {
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
if (validPeriod > 0) {
var nowTime = System.currentTimeMillis();
com.cncat.vpn.common.log.Log.d("validPeriod==>$validPeriod, nowTime==>$nowTime")
Log.d("validPeriod==>$validPeriod, nowTime==>$nowTime")
if (validPeriod >= nowTime) {
return false
}
@ -594,91 +449,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
private fun setNodeNameAndImg(it: String) {
launch(Dispatchers.Main) {
nodeNameTv.text = it
when {
it.contains("中国", true) -> {
countryIv.setImageResource(R.drawable.flag_china)
}
it.contains("香港", true) -> {
countryIv.setImageResource(R.drawable.flag_china)
}
it.contains("日本", true) -> {
countryIv.setImageResource(R.drawable.flag_japan)
}
it.contains("韩国", true) -> {
countryIv.setImageResource(R.drawable.flag_korea)
}
it.contains("美国", true) -> {
countryIv.setImageResource(R.drawable.flag_usa)
}
it.contains("德国", true) -> {
countryIv.setImageResource(R.drawable.flag_germany)
}
it.contains("法国", true) -> {
countryIv.setImageResource(R.drawable.flag_france)
}
it.contains("俄罗斯", true) -> {
countryIv.setImageResource(R.drawable.flag_russia)
}
it.contains("新加坡", true) -> {
countryIv.setImageResource(R.drawable.flag_singapore)
}
it.contains("英国", true) -> {
countryIv.setImageResource(R.drawable.flag_uk)
}
it.contains("澳大利亚", true) -> {
countryIv.setImageResource(R.drawable.flag_australia)
}
it.contains("印度", true) -> {
countryIv.setImageResource(R.drawable.flag_india)
}
it.contains("加拿大", true) -> {
countryIv.setImageResource(R.drawable.flag_canada)
}
else -> {
countryIv.setImageResource(R.drawable.ic_s_location)
}
}
}
}
private fun goRechargeWeb() {
if (activity != null) {
var mact = activity as NewMainActivity
mact.goRechargeWeb()
}
}
private fun goNewRecharge() {
if (activity != null) {
var mact = activity as NewMainActivity
mact.goBackupRechargeWeb()
}
}
private fun updateUserInfo() {
if (activity != null) {
var mact = activity as NewMainActivity
mact.goCheckLogin()
}
}
private fun start_u_timer() {
if (activity != null) {
var mact = activity as NewMainActivity
@ -698,7 +468,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
val isGlobal = isGlo
val isGlobal2 = MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
Log.i("checkGlo isGlobal==>${isGlobal}, isGlobal2==>${isGlobal2}")
setProxyModeView(isGlobal)
launch(Dispatchers.IO) {
if (isGlobal) {
if (clashRunning) {
@ -740,22 +509,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
}
}
private fun setProxyModeView(isGlobal: Boolean) {
if (isGlobal) {
iv_proxy_mode.setImageResource(R.drawable.ic_s_global)
if (isAdded) {
tv_proxy_model.text = resources.getString(R.string.GlobalMode)
}
} else {
iv_proxy_mode.setImageResource(R.drawable.smart)
if (isAdded) {
tv_proxy_model.text = resources.getString(R.string.IntelligentMode)
}
}
}
var proList: MutableList<ClashNodebBean>? = null
private suspend fun getNodes() {

View File

@ -483,11 +483,6 @@ class RechargeFragment : BaseFragment() {
if (activity is NewMainActivity) {
val newMainAt = activity as NewMainActivity
newMainAt.setExpireDate()
for (fragment in newMainAt.fragments) {
if (fragment is NewAccFragment) {
fragment.setExpireDate()
}
}
}
} else {
Logger.d("微信或者支付宝支付成功更新有效期失败:${checkLoginRsp.code}${checkLoginRsp.msg}")

View File

@ -53,14 +53,14 @@ import com.yingmao.clash.act.ChangePwdActivity
import com.yingmao.clash.act.InstallApplicationActivity
import com.yingmao.clash.act.LoginActivity
import com.yingmao.clash.act.LossPreventionActivity
import com.yingmao.clash.act.NewMainActivity
import com.yingmao.clash.act.ShareActivity
import com.yingmao.clash.act.SplashActivity
import com.yingmao.clash.act.SplashHelper
import com.yingmao.clash.act.UIMainActivity
import com.yingmao.clash.act.UIMainActivity.Companion.isSubed
import com.yingmao.clash.act.UIMainActivity.Companion.newUuid
import com.yingmao.clash.act.UIMainActivity.Companion.profileBinder
import com.yingmao.clash.act.UIMainActivity.Companion.subUrl
import com.yingmao.clash.act.NewMainActivity.Companion.isSubed
import com.yingmao.clash.act.NewMainActivity.Companion.newUuid
import com.yingmao.clash.act.NewMainActivity.Companion.profileBinder
import com.yingmao.clash.act.NewMainActivity.Companion.subUrl
import com.yingmao.clash.app.MainApplication
import com.yingmao.clash.conf.BZYConstants
import com.yingmao.clash.conf.Conf
@ -656,14 +656,14 @@ class SettingFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatc
private fun stopUpLoadTimer() {
if (activity != null) {
val uiMainActivity = activity as UIMainActivity
val uiMainActivity = activity as NewMainActivity
uiMainActivity.stopUploadTimer()
}
}
private fun goNewRecharge() {
if (activity != null) {
val uiMainActivity = activity as UIMainActivity
val uiMainActivity = activity as NewMainActivity
uiMainActivity.goBackupRechargeWeb()
}
}

View File

@ -343,4 +343,18 @@ class MainAtyVM : PublicViewMode() {
httpApi.appUpStatus(paramsToken,requestBody)
}
}
fun getExpensesRecord(page : NewMainActivity.PageInfo){
val httpApi = NetService.instances.createHttps(HttpApi::class.java)
val username = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME,"")!!
val phToken = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_PH_TOKEN,"")!!
val userId = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_USER_ID)!!
val params = hashMapOf<String,String>(
"phoneNumber" to username,
"userId" to userId,
"phToken" to phToken,
"pageno" to "${page.page}",
"pageSize" to "5",
)
doAsync(HttpReqType.EXPENSES_RECORD){httpApi.phOrderList(params)}
}
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:type="linear"
android:angle="180"
android:endColor="#67a1ff"
android:startColor="#67a1ff"
/>
<corners android:radius="30dp"/>
<item android:name="android:shadowColor">#33ff7800</item>
<item android:name="android:shadowDx">0</item>
<item android:name="android:shadowDy">10</item>
</shape>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:angle="180"
android:endColor="#3228df"
android:startColor="#0fd7ef"
android:type="linear"
/>
</shape>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#BFD5D5D5" >
<item>
<shape>
<gradient android:type="linear"
android:angle="180"
android:startColor="#61f4e4"
android:endColor="#0fd7ef"
/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#BFD5D5D5" >
<item>
<shape>
<gradient android:type="linear"
android:angle="180"
android:startColor="#5aa8ff"
android:endColor="#7b5dfb"
/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:pathData="M51.431,25.523C51.431,14.792 42.731,6.092 32,6.092C21.269,6.092 12.569,14.792 12.569,25.523C12.569,34.287 18.373,41.695 26.346,44.117L32,49.771L37.654,44.117C45.627,41.695 51.431,34.287 51.431,25.523ZM32,18.936C35.638,18.936 38.587,21.885 38.587,25.523C38.587,29.161 35.638,32.11 32,32.11C28.362,32.11 25.413,29.161 25.413,25.523C25.413,21.885 28.362,18.936 32,18.936Z"
android:fillColor="#1196db"/>
<path
android:pathData="M11.142,54.779C11.142,55.19 11.682,55.597 12.73,55.976C13.778,56.356 15.314,56.701 17.251,56.991C19.188,57.282 21.487,57.512 24.018,57.67C26.549,57.827 29.261,57.908 32,57.908C34.739,57.908 37.451,57.827 39.982,57.67C42.512,57.512 44.812,57.282 46.749,56.991C48.685,56.701 50.222,56.356 51.27,55.976C52.318,55.597 52.858,55.19 52.858,54.779C52.858,53.949 50.66,53.153 46.749,52.567C42.837,51.98 37.532,51.65 32,51.65C26.468,51.65 21.163,51.98 17.251,52.567C13.34,53.153 11.142,53.949 11.142,54.779Z"
android:fillColor="#1196db"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M395.2,513.6l323.1,-312.4c19.1,-18.4 19.1,-48.3 0,-66.7 -19.1,-18.4 -49.9,-18.4 -69,0L291.8,480.3c-19.1,18.4 -19.1,48.3 0,66.7l357.6,345.7c9.5,9.2 22,13.8 34.5,13.8 12.5,0 25,-4.6 34.5,-13.8 19.1,-18.4 19.1,-48.2 0,-66.7L395.2,513.6z"
android:fillColor="#FFF"/>
</vector>

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:width="60dp"
android:height="60dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path

View File

@ -0,0 +1,20 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- This is the main color -->
<item>
<shape>
<!-- 边框颜色 -->
<solid android:color="#B36C1B"/>
<corners android:topRightRadius="24dp" android:topLeftRadius="24dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="3dp"/>
</shape>
</item>
<!-- 给View的上 左 右设置8dp的边框 -->
<item android:top="1dp" android:left="1dp" android:right="3dp" android:bottom="3dp" >
<shape>
<!-- View填充颜色 -->
<solid android:color="#FFE7CC" />
<corners android:topRightRadius="24dp" android:topLeftRadius="24dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="3dp"/>
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,20 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- This is the main color -->
<item>
<shape>
<!-- 边框颜色 -->
<solid android:color="#B36C1B"/>
<corners android:topRightRadius="24dp" android:topLeftRadius="24dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="3dp"/>
</shape>
</item>
<!-- 给View的上 左 右设置8dp的边框 -->
<item android:top="1dp" android:left="1dp" android:right="4dp" android:bottom="4dp" >
<shape>
<!-- View填充颜色 -->
<solid android:color="#FF8A04" />
<corners android:topRightRadius="24dp" android:topLeftRadius="24dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="3dp"/>
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/white"/>
<gradient
android:angle="0"
android:startColor="@color/white_70"
android:endColor="@color/white_70"
/>
<corners android:radius="1dp"/>
</shape>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#BFD5D5D5" >
<item android:drawable="@drawable/settingpage_click_effect_item"/>
</ripple>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<solid android:color="@color/white"/>
<corners android:radius="30dp"/>
</shape>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" >
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff448aff" android:endColor="#ff0a5ae0" android:angle="0" />
<item android:name="android:shadowDx">0</item>
<item android:name="android:shadowDy">3</item>
<item android:name="android:shadowColor">#4d357df7</item>
<corners android:radius="30dp" />
<stroke android:color="#0055AA" android:width="1dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="@color/wh_EAEAEA" android:endColor="@color/wh_EAEAEA" android:angle="0" />
<corners android:radius="30dp" />
<stroke android:color="#0055AA" android:width="1dp"/>
</shape>
</item>
</selector>

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
>
<TextView

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
android:orientation="vertical"
>

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/main_bg">
>
<RelativeLayout
android:gravity="center"

View File

@ -5,9 +5,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg"
tools:context=".act.ChangeNodeActivity"
android:padding="@dimen/dp_10">
android:padding="@dimen/dp_10"
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"
android:layout_width="match_parent"
@ -21,7 +22,9 @@
android:id="@+id/aiBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
android:src="@drawable/ic_mode_write"
android:layout_marginTop="17dp"
android:layout_marginBottom="17dp"
android:padding="5dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"
@ -31,27 +34,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/blue_0136CB"
android:textColor="#FFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@string/LineSwitching"
android:text="@string/changeLocation"
android:textSize="18sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/node_item_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/orange_FF9C00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@string/node_item_test"
android:layout_marginEnd="@dimen/dp_10"
android:textSize="18sp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/node_user_traffic"
@ -66,15 +58,52 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<LinearLayout
android:id="@+id/clProxy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="13dp"
android:layout_marginEnd="13dp"
android:layout_marginTop="18dp"
app:layout_constraintTop_toBottomOf="@id/node_user_traffic"
android:orientation="horizontal"
android:background="@drawable/oc_proxy_bg"
>
<TextView
android:id="@+id/tvProA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/oc_proxy_choose_bg"
android:layout_weight="1"
android:text="@string/anqpro"
android:gravity="center"
android:textColor="@color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
/>
<TextView
android:id="@+id/tvProj"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/jsmpri"
android:gravity="center"
android:textColor="#B36C1B"
android:paddingTop="10dp"
android:paddingBottom="10dp"
/>
</LinearLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/node_user_traffic"
app:layout_constraintTop_toBottomOf="@id/clProxy"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="10dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="@dimen/dp_10"
>
<androidx.recyclerview.widget.RecyclerView

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg">
android:background="@drawable/homeact_linea_bg">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"
android:layout_width="match_parent"
@ -17,7 +17,7 @@
android:id="@+id/aiBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
android:src="@drawable/ic_mode_write"
android:padding="5dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"

View File

@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg">
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout

View File

@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".act.InstallApplicationActivity"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
@ -32,7 +32,7 @@
android:id="@+id/AIVBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
android:src="@drawable/ic_mode_write"
android:padding="5dp"
/>
</androidx.appcompat.widget.Toolbar>

View File

@ -3,22 +3,52 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_bg"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:orientation="vertical"
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:elevation="@dimen/dp_10"
app:cardCornerRadius="25dp"
app:cardElevation="@dimen/dp_10">
android:layout_marginTop="46dp"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aiBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="5dp"
android:tint="#fff"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:textStyle="bold"
android:textColor="#fff"
android:textSize="16sp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#5aa8ff"
android:layout_marginTop="10dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:background="@drawable/setting_bg_shape"
android:orientation="vertical">
<LinearLayout
@ -27,11 +57,12 @@
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/setting_bg_shape"
>
<TextView
@ -73,14 +104,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/change_password"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -90,7 +123,8 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_s_arrow_right" />
android:src="@drawable/ic_s_arrow_right"
app:tint="@color/black_0e1010" />
</LinearLayout>
@ -110,14 +144,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/ServiceTerms"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -127,6 +163,7 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="@dimen/dp_10"
app:tint="@color/black_0e1010"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
@ -146,14 +183,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/PrivacyPolicy"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -161,6 +200,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
app:tint="@color/black_0e1010"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
@ -179,14 +219,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/InitializationRepair"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -195,6 +237,7 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="@dimen/dp_10"
app:tint="@color/black_0e1010"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
@ -213,14 +256,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/UploadErrorLog"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -228,6 +273,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
app:tint="@color/black_0e1010"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
@ -249,14 +295,16 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/SubApplicationProxy"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
@ -264,6 +312,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
app:tint="@color/black_0e1010"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
@ -283,27 +332,29 @@
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10">
android:paddingBottom="@dimen/dp_10"
android:background="@drawable/settinga_bg_shape"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/LanguageSwitching"
android:textColor="@color/text_yellow"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
app:tint="@color/black_0e1010"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/ic_s_arrow_right" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/ic_index_bg">
android:background="@drawable/homeact_linea_bg">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"
android:layout_width="match_parent"

View File

@ -5,207 +5,53 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_70"
tools:ignore="ContentDescription,MissingConstraints">
<ImageView
android:id="@+id/iv_accelerate"
android:layout_width="match_parent"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clickOnLink"
android:layout_width="0dp"
android:layout_height="0dp"
android:clickable="true"
android:focusable="true"
android:scaleType="centerInside"
app:layout_constraintHeight_percent="0.50"
app:layout_constraintDimensionRatio="1:1"
android:background="@drawable/home_circle_select"
android:elevation="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="0dp" />
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
>
<LinearLayout
android:id="@+id/ll_ex"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_node"
app:layout_constraintBottom_toTopOf="@+id/ll_node"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="30dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
<TextView
android:id="@+id/ClickTheLink"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="15dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expire_date"
android:textColor="@color/text_yellow"
android:textSize="16sp"
android:textStyle="bold" />
android:maxLines="1"
android:text="@string/OpenConnection"
android:layout_marginTop="10dp"
android:textColor="#fff"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@+id/InTheLink"
app:layout_constraintStart_toStartOf="@+id/InTheLink"
app:layout_constraintTop_toBottomOf="@+id/InTheLink" />
<TextView
android:id="@+id/tv_end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="2024.01.01"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:layout_marginLeft="5dp"
android:id="@+id/refresh_expire_iv"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/refresh2"></ImageView>
</LinearLayout>
<LinearLayout
android:id="@+id/llRecharge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.widget.Button
android:id="@+id/recharge_but"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@drawable/main_node_bg_spape"
android:gravity="center"
android:text="@string/recharge"
android:textColor="@color/white"
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>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.95" /> <!-- 90% from top -->
<LinearLayout
android:id="@+id/ll_node"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/guideline"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:layout_marginRight="30dp"
android:background="@drawable/main_node_bg_spape"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="25dp"
android:paddingRight="25dp">
<RelativeLayout
android:id="@+id/ll_proxy_mode"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/InTheLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_proxy_mode"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="12dp"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:srcCompat="@mipmap/ic_linek"
android:tint="#fff"
/>
android:layout_centerVertical="true"
android:src="@drawable/smart" />
<TextView
android:id="@+id/tv_proxy_model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/iv_proxy_mode"
android:padding="15dp"
android:text="@string/IntelligentMode"
android:textColor="@color/text_yellow"
android:textSize="16sp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/arrow_grid"></ImageView>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/text_yellow">
</View>
<RelativeLayout
android:id="@+id/rl_check_node"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="@+id/iv_country"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:src="@drawable/straight"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="9dp"
android:layout_toEndOf="@+id/iv_country"
android:orientation="vertical">
<TextView
android:id="@+id/tv_node"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/select_node"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/current_node"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/arrow_grid"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -48,5 +48,5 @@
android:id="@+id/fl_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/rl_title_bar" />
/>
</RelativeLayout>

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"
@ -18,7 +18,7 @@
android:id="@+id/aiBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
android:src="@drawable/ic_mode_write"
android:padding="5dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"
@ -28,7 +28,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/blue_0136CB"
android:textColor="#FFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -4,13 +4,23 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg">
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.login.LoginActivity"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aiWel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/mashanglian"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="80dp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clwe"
android:layout_width="match_parent"
@ -19,6 +29,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
>
<TextView
@ -40,7 +51,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/clwe"
app:layout_constraintTop_toBottomOf="@+id/aiWel"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
>

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
tools:ignore="MissingConstraints">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"

View File

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingConstraints"
android:background="@drawable/ic_index_bg">
android:background="@drawable/homeact_linea_bg">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/ic_index_bg"
android:background="@drawable/homeact_linea_bg"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clTitle"
@ -19,7 +19,7 @@
android:id="@+id/aiBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_mode_back"
android:src="@drawable/ic_mode_write"
android:padding="5dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"
@ -29,7 +29,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/blue_0136CB"
android:textColor="#FFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@ -63,6 +63,7 @@
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginTop="10dp"
android:visibility="gone"
android:background="@drawable/setting_head_bg"
app:layout_constraintTop_toBottomOf="@+id/clTitle"
>
@ -173,11 +174,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/SelectDuration"
android:text="@string/selectVIPRecharge"
android:textColor="@color/black_4F4F4F"
android:textSize="16sp"
android:layout_marginStart="20dp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/clUser"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/clUser" />
<TextView
@ -187,6 +189,7 @@
android:text="@string/MultiTerminal"
android:textColor="@color/black_4F4F4F"
android:textSize="14sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/textView3"
app:layout_constraintStart_toEndOf="@+id/textView3"
app:layout_constraintTop_toTopOf="@+id/textView3"
@ -196,6 +199,7 @@
android:id="@+id/nvSee"
android:layout_width="match_parent"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tvPay"
android:layout_marginStart="@dimen/dp_10"
@ -220,7 +224,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="150dp"
android:layout_marginBottom="20dp"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
app:layout_constraintBottom_toTopOf="@+id/tvPay"

View File

@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#28c3df"
android:background="@drawable/homeact_linea_bg"
tools:context=".act.NewMainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
@ -14,13 +14,24 @@
android:layout_height="match_parent"
android:background="@color/translate"
>
<View
android:id="@+id/viewLines"
android:layout_width="match_parent"
android:layout_height="5dp"
android:visibility="gone"
android:background="@drawable/home_linea_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_slider"
/>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bottomLine"
app:layout_constraintTop_toBottomOf="@+id/iv_slider" />
app:layout_constraintTop_toBottomOf="@+id/viewLines" />
<ImageView
android:id="@+id/iv_slider"
@ -129,20 +140,20 @@
>
<TextView
android:id="@+id/tvExitTime"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="32dp"
android:layout_marginStart="10dp"
android:layout_marginBottom="32dp"
android:layout_marginEnd="10dp"
android:textColor="@color/black"
android:textSize="16sp"
android:gravity="center"
android:text="@string/MembershipExpiration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="32dp"
android:layout_marginStart="32dp"
android:layout_marginBottom="32dp"
android:layout_marginEnd="50dp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:text="@string/MembershipExpiration"
app:layout_constraintBottom_toBottomOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
@ -151,7 +162,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/blue_1795E4"
android:background="#3228df"
>
<LinearLayout
android:layout_width="wrap_content"
@ -188,13 +199,12 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- android:layout_gravity="start"-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_slider"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:layout_gravity="start"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/userIcon"
@ -241,8 +251,11 @@
<TextView
android:id="@+id/tv_expire_date"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:ellipsize="end"
android:maxLines="1"
android:text="18586360139"
android:textSize="14sp"
/>
@ -261,10 +274,49 @@
android:id="@+id/Line"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_FDFCFC"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/settingpage_click_effect"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivYY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_location"
android:layout_marginStart="30dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="@+id/tvYY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/changeLocation"
android:textColor="@color/black_242426"
android:layout_marginStart="12dp"
android:textStyle="bold"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@+id/ivYY"
app:layout_constraintStart_toEndOf="@+id/ivYY"
app:layout_constraintTop_toTopOf="@+id/ivYY" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clSing"
android:layout_width="match_parent"
@ -272,7 +324,7 @@
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@+id/clLocation">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/IvSing"
@ -445,6 +497,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/clActivity">

View File

@ -20,7 +20,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/setting_pay_things"
android:background="@drawable/vip_recharge_list_item_bg_selector"
android:layout_marginTop="@dimen/dp_10"
>
<LinearLayout

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -66,13 +66,11 @@
<color name="orange_FF991A">#FF991A</color>
<color name="orange_FFA433">#FFA433</color>
<color name="click_bg">#BFD5D5D5</color>
<color name="blue_4072FE">#4072FE</color>
<color name="grar_BDBDBD">#BDBDBD</color>
<color name="gray_ECECEC">#ECECEC</color>
<color name="blue_1795E4">#1795E4</color>
<color name="gray_FDFCFC">#FDFCFC</color>
<color name="blue_0080FF">#0080FF</color>
<color name="blue_4072FE">#4072FE</color>
<color name="blue_9AAAFE">#9AAAFE</color>
<color name="blue_0055AA">#0055AA</color>
</resources>

View File

@ -370,4 +370,8 @@
<string name="MessageCenter">消息中心</string>
<string name="RenewMembership">续费会员</string>
<string name="CloseConnection">断开连接</string>
<string name="selectVIPRecharge">请选择VIP会员套餐</string>
<string name="changeLocation">变更国家/地区</string>
<string name="anqpro">安全模式</string>
<string name="jsmpri">极速模式</string>
</resources>

View File

@ -113,8 +113,8 @@ subprojects {
buildConfigField("String", "productId", "\"9972\"")
manifestPlaceholders(
mapOf(
"APP_NAME" to "@string/logo_connect_immediately",
"APP_ICON" to "@mipmap/ic_yingmao_logo_9972"
"APP_NAME" to "@string/ConnectImmediately",
"APP_ICON" to "@mipmap/logo_connect_immediately"
)
)
}