一键连更改相关数据
This commit is contained in:
parent
b6b439bca4
commit
7a1312d0b3
|
|
@ -113,17 +113,17 @@ dependencies {
|
|||
// implementation("com.luozm.captcha:captcha:1.1.2")
|
||||
// implementation("com.aliyun.dpa:oss-android-sdk:2.9.19")
|
||||
// implementation ("com.hihonor.mcs:ads-identifier:1.0.3.301")
|
||||
implementation("com.github.gzu-liyujiang:Android_CN_OAID:4.2.8") {
|
||||
exclude("com.hihonor.mcs", "ads-identifier")
|
||||
exclude("com.huawei.hms", "ads-identifier")
|
||||
}
|
||||
// implementation("com.github.gzu-liyujiang:Android_CN_OAID:4.2.8") {
|
||||
// exclude("com.hihonor.mcs", "ads-identifier")
|
||||
// exclude("com.huawei.hms", "ads-identifier")
|
||||
// }
|
||||
// 华为的最新版本广告标识服务SDK,参阅 https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/identifier-service-version-change-history-0000001050066927
|
||||
// api ("com.huawei.hms:ads-identifier:3.4.62.300")
|
||||
// // 荣耀的最新版本广告标识服务SDK,参阅 https://developer.hihonor.com/cn/kitdoc?kitId=11030&navigation=guides&docId=intergrate.md
|
||||
// api ("com.hihonor.mcs:ads-identifier:1.0.2.301")
|
||||
//stripe 支付
|
||||
implementation("com.stripe:stripe-android:21.4.2")// 使用最新版本
|
||||
implementation("com.github.getActivity:XXPermissions:20.0")
|
||||
// 华为的最新版本广告标识服务SDK,参阅 https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/identifier-service-version-change-history-0000001050066927
|
||||
api ("com.huawei.hms:ads-identifier:3.4.62.300")
|
||||
// 荣耀的最新版本广告标识服务SDK,参阅 https://developer.hihonor.com/cn/kitdoc?kitId=11030&navigation=guides&docId=intergrate.md
|
||||
api ("com.hihonor.mcs:ads-identifier:1.0.2.301")
|
||||
implementation("com.android.installreferrer:installreferrer:2.2")// 使用最新版本
|
||||
implementation("io.github.youth5201314:banner:2.2.3")
|
||||
implementation("com.github.zhpanvip:viewpagerindicator:1.2.3")
|
||||
|
|
|
|||
|
|
@ -9,8 +9,11 @@ import android.graphics.Color
|
|||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
|
@ -54,6 +57,8 @@ import com.yingmao.clash.view.dialog.DialogDoMainChoose
|
|||
import com.yingmao.clash.view.dialog.PayConfirmDialog
|
||||
import com.yingmao.clash.view.dialog.RxDialogShapeLoading
|
||||
import com.yingmao.clash.view.dialog.SplashDialog
|
||||
import com.yingmao.clash.webview.BZYWebViewKeFu
|
||||
import com.yingmao.clash.webview.CustomerServiceWebView
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.MainScope
|
||||
|
|
@ -63,23 +68,18 @@ import java.text.SimpleDateFormat
|
|||
import java.util.Locale
|
||||
|
||||
class MemberRechargeActivity : BaseActivity() {
|
||||
private lateinit var aiBack: AppCompatImageView
|
||||
private lateinit var userIdentity: TextView
|
||||
private lateinit var userIdentityNumber: TextView
|
||||
private lateinit var expirationTime: TextView
|
||||
private lateinit var userIdentityNumberCopy: TextView
|
||||
private lateinit var aiBack: AppCompatImageView
|
||||
private lateinit var viewModel: RechargeViewModel
|
||||
private lateinit var swipeLayout: SwipeRefreshLayout
|
||||
private lateinit var rvRechargeList: RecyclerView
|
||||
private lateinit var tvPay: TextView
|
||||
private lateinit var tvRechargeRecord: TextView
|
||||
|
||||
private lateinit var swipeLayout: SwipeRefreshLayout
|
||||
private lateinit var rvRechargeList:RecyclerView
|
||||
private lateinit var tvPay:TextView
|
||||
private lateinit var tvRechargeRecord:TextView
|
||||
private lateinit var clCustom: ConstraintLayout
|
||||
private var selectedGrade: Grade? = null
|
||||
|
||||
private lateinit var rxDialogShapeLoading: RxDialogShapeLoading
|
||||
private var outTradeNo = ""
|
||||
private var selectedGradeID: Int = 0
|
||||
|
||||
private var selectedGradeID :Int=0
|
||||
//stripePay 支付
|
||||
private var paymentIntentClientSecret: String = ""
|
||||
private val stripe: Stripe by lazy {
|
||||
|
|
@ -98,69 +98,37 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
private fun initData() {
|
||||
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
|
||||
setExpireDate(validPeriod)
|
||||
if (checkExpire()) {
|
||||
userIdentity.text = resources.getString(R.string.TemporaryUser)
|
||||
} else {
|
||||
userIdentity.text = resources.getString(R.string.VIPMember)
|
||||
}
|
||||
userIdentityNumber.text =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME)
|
||||
|
||||
|
||||
viewModel = ViewModelProvider(this)[RechargeViewModel::class.java]
|
||||
observe(this, viewModel)
|
||||
//获取充值列表
|
||||
val username =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
val phToken = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_PH_TOKEN, "")!!
|
||||
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)!!
|
||||
viewModel.getPhRechargeInfo(username, phToken, userId)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
aiBack = findViewById(R.id.aiBack)
|
||||
userIdentity = findViewById(R.id.userIdentity)
|
||||
userIdentityNumber = findViewById(R.id.userIdentityNumber)
|
||||
expirationTime = findViewById(R.id.expirationTime)
|
||||
userIdentityNumberCopy = findViewById(R.id.userIdentityNumberCopy)
|
||||
swipeLayout = findViewById(R.id.swipeLayout)
|
||||
rvRechargeList = findViewById(R.id.rvRechargeList)
|
||||
tvPay = findViewById(R.id.tvPay)
|
||||
tvRechargeRecord = findViewById(R.id.tvRechargeRecord)
|
||||
|
||||
aiBack=findViewById(R.id.aiBack)
|
||||
swipeLayout=findViewById(R.id.swipeLayout)
|
||||
rvRechargeList=findViewById(R.id.rvRechargeList)
|
||||
tvPay=findViewById(R.id.tvPay)
|
||||
tvRechargeRecord=findViewById(R.id.tvRechargeRecord)
|
||||
clCustom=findViewById(R.id.clCustom)
|
||||
swipeLayout.setColorSchemeColors(Color.rgb(47, 223, 189))
|
||||
swipeLayout.setOnRefreshListener {
|
||||
selectedGrade = null
|
||||
val username =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
val phToken = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_PH_TOKEN, "")!!
|
||||
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)!!
|
||||
viewModel.getPhRechargeInfo(username, phToken, userId)
|
||||
}
|
||||
|
||||
aiBack.setOnClickListener {
|
||||
val intent = Intent()
|
||||
this.setResult(1000, intent)
|
||||
val intent=Intent()
|
||||
this.setResult(1000,intent)
|
||||
finish() // 关闭当前 Activity
|
||||
}
|
||||
|
||||
userIdentityNumberCopy.setOnClickListener {
|
||||
val userName = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME)
|
||||
val clipboardManager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clipData = ClipData.newPlainText("text", userName)
|
||||
clipboardManager.setPrimaryClip(clipData)
|
||||
RxToast.info(resources.getString(R.string.CopyToClipboard))
|
||||
}
|
||||
userIdentityNumber.setOnClickListener {
|
||||
val userName = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME)
|
||||
val clipboardManager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clipData = ClipData.newPlainText("text", userName)
|
||||
clipboardManager.setPrimaryClip(clipData)
|
||||
RxToast.info(resources.getString(R.string.CopyToClipboard))
|
||||
}
|
||||
tvRechargeRecord.setOnClickListener {
|
||||
startActivity(Intent(this@MemberRechargeActivity, ExpensesRecordActivity::class.java))
|
||||
}
|
||||
|
|
@ -170,82 +138,13 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
RxToast.info(resources.getString(R.string.selectRechargeAmount))
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(BuildConfig.productId=="9788"){
|
||||
val payConfirm =
|
||||
PayConfirmDialog(this)
|
||||
payConfirm.showDialog(this@MemberRechargeActivity)
|
||||
payConfirm.setOnDialogClickListener(object : PayConfirmDialog.ActivityLinkListener{
|
||||
override fun onFinishClickListener() {
|
||||
viewModel.pay("1", selectedGrade!!, "pointCard")
|
||||
payConfirm.cancel()
|
||||
}
|
||||
override fun onCancelClickListener() {
|
||||
payConfirm.cancel()
|
||||
}
|
||||
viewModel.pay("1", selectedGrade!!, "pointCard")
|
||||
|
||||
})
|
||||
}else{
|
||||
viewModel.pay("1", selectedGrade!!, "pointCard")
|
||||
}
|
||||
}
|
||||
clCustom.setOnClickListener {
|
||||
startActivity(Intent(this@MemberRechargeActivity, CustomerServiceWebView::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
fun setExpireDate(validPeriod: Long) {
|
||||
val isExpire = checkExpire()
|
||||
var endTimeInfo = "--"
|
||||
if (isExpire) {
|
||||
endTimeInfo = resources.getString(R.string.AccountExpired)
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
|
||||
} 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)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expirationTime.text = endTimeInfo
|
||||
}
|
||||
|
||||
private fun checkExpire(): Boolean {
|
||||
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
|
||||
if (validPeriod > 0) {
|
||||
|
|
@ -264,13 +163,11 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
Logger.d("获取充值续费信息")
|
||||
swipeLayout.isRefreshing = true
|
||||
}
|
||||
|
||||
HttpReqType.PAY -> {
|
||||
Logger.d("支付获取订单号")
|
||||
showLoadingDialog(resources.getString(R.string.GeneratingOrder))
|
||||
}
|
||||
|
||||
else -> {
|
||||
else->{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -283,7 +180,7 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
swipeLayout.isRefreshing = false
|
||||
(httpStatus.rsp as RechargeInfoRsp).let { it ->
|
||||
if (it.code != "1000") {
|
||||
RxToast.error(if (it.message.isNullOrBlank()) resources.getString(R.string.FailedRechargeList) + "(${it.code})" else "${it.code}:${it.message}")
|
||||
RxToast.error(if (it.message.isNullOrBlank())resources.getString(R.string.FailedRechargeList)+ "(${it.code})" else "${it.code}:${it.message}")
|
||||
} else {
|
||||
it.data?.let { rechargeInfo ->
|
||||
initAdapter(rechargeInfo)
|
||||
|
|
@ -291,13 +188,12 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
HttpReqType.PAY -> {
|
||||
hideLoadingDialog()
|
||||
Logger.d("生成订单请求成功")
|
||||
(httpStatus.rsp as PayRsp).let { rsp ->
|
||||
if (rsp.code != "1000") {
|
||||
RxToast.error(if (rsp.message.isNullOrBlank()) resources.getString(R.string.OrderGenerationFailed) + "(${rsp.code})" else "${rsp.code}:${rsp.message}")
|
||||
RxToast.error(if (rsp.message.isNullOrBlank()) resources.getString(R.string.OrderGenerationFailed)+"(${rsp.code})" else "${rsp.code}:${rsp.message}")
|
||||
} else {
|
||||
let {
|
||||
outTradeNo = rsp.data?.outTradeNo!!
|
||||
|
|
@ -308,11 +204,10 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
HttpReqType.unionPay -> {
|
||||
(httpStatus.rsp as PayRsp).let { rsp ->
|
||||
if (rsp.code != "1000") {
|
||||
RxToast.error(if (rsp.message.isNullOrBlank()) resources.getString(R.string.OrderGenerationFailed) + "(${rsp.code})" else "${rsp.code}:${rsp.message}")
|
||||
RxToast.error(if (rsp.message.isNullOrBlank()) resources.getString(R.string.OrderGenerationFailed)+"(${rsp.code})" else "${rsp.code}:${rsp.message}")
|
||||
} else {
|
||||
if (rsp.data != null) {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(rsp.data.payUrl)))
|
||||
|
|
@ -320,57 +215,37 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
HttpReqType.StripeType -> {
|
||||
HttpReqType.StripeType ->{
|
||||
(httpStatus.rsp as PayUploadParamData).let {
|
||||
if (it.data != null) {
|
||||
paymentIntentClientSecret = it.data.clientSecret.toString()
|
||||
if(it.data!=null){
|
||||
paymentIntentClientSecret= it.data.clientSecret.toString()
|
||||
startCheckout()
|
||||
} else {
|
||||
}else{
|
||||
hideLoading()
|
||||
RxToast.info(getString(R.string.NoPaymentReceipt))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HttpReqType.StripeWeChat -> {
|
||||
HttpReqType.StripeWeChat ->{
|
||||
(httpStatus.rsp as PayUploadParamData).let {
|
||||
if (it.data != null) {
|
||||
paymentIntentClientSecret = it.data.clientSecret.toString()
|
||||
if(it.data!=null){
|
||||
paymentIntentClientSecret= it.data.clientSecret.toString()
|
||||
val serviceUrl = MMKV.defaultMMKV().decodeString(
|
||||
BZYConstants.MMKV_KEY_CURRENT_HOST,
|
||||
BuildConfig.service_url
|
||||
)!!
|
||||
val payUrl =
|
||||
serviceUrl + "/78zccgy0nsgknh9n4/iiii.html?s=${it.data.clientSecret.toString()}"
|
||||
val payUrl=serviceUrl+"/78zccgy0nsgknh9n4/iiii.html?s=${it.data.clientSecret.toString()}"
|
||||
val uri = Uri.parse(payUrl)
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(uri)
|
||||
startActivity(intent)
|
||||
} else {
|
||||
}else{
|
||||
hideLoading()
|
||||
RxToast.info(getString(R.string.NoPaymentReceipt))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HttpReqType.CHECK_LOGIN -> {
|
||||
Logger.d("支付成功更新有效期")
|
||||
val checkLoginRsp = httpStatus.rsp
|
||||
if (checkLoginRsp is CheckLoginRsp) {
|
||||
if (checkLoginRsp.code == 0) {
|
||||
if (checkLoginRsp.data != null) {
|
||||
val vpnExpireTime = checkLoginRsp.data.vpnExpireTime
|
||||
setExpireDate(vpnExpireTime)
|
||||
}
|
||||
|
||||
} else {
|
||||
Logger.d("微信或者支付宝支付成功更新有效期失败:${checkLoginRsp.code}${checkLoginRsp.msg}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
else->{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -389,23 +264,20 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
Logger.d("获取支付订单号异常${httpStatus.msg}")
|
||||
RxToast.error(resources.getString(R.string.DataPayNumber))
|
||||
}
|
||||
|
||||
HttpReqType.unionPay -> {
|
||||
Logger.d("OrderGenerationFailed${httpStatus.msg}")
|
||||
RxToast.error(resources.getString(R.string.OrderGenerationFailed))
|
||||
}
|
||||
|
||||
HttpReqType.StripeType -> {
|
||||
hideLoading()
|
||||
RxToast.error(resources.getString(R.string.NoPaymentReceipt))
|
||||
}
|
||||
|
||||
else -> {
|
||||
else->{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var dialogDoMainChoose: DialogDoMainChoose? = null
|
||||
private fun showDomainList() {
|
||||
try {
|
||||
|
|
@ -428,8 +300,6 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
val userId = MMKV.defaultMMKV()
|
||||
.decodeString(BZYConstants.MMKV_KEY_USER_ID)!!
|
||||
viewModel.getPhRechargeInfo(username, phToken, userId)
|
||||
dialogDoMainChoose?.dismiss()
|
||||
|
||||
}
|
||||
|
||||
override fun cancel() {
|
||||
|
|
@ -437,32 +307,6 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
dialogDoMainChoose?.dismiss()
|
||||
}
|
||||
})
|
||||
dialogDoMainChoose?.setOnListItemListener(object :
|
||||
DialogDoMainChoose.OnListItemListener {
|
||||
override fun listItemClick() {
|
||||
MainApplication.restartApp(this@MemberRechargeActivity, object :
|
||||
MainApplication.OnRestartButtonListener {
|
||||
override fun enterButton() {
|
||||
}
|
||||
|
||||
override fun cancelButton() {
|
||||
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)!!
|
||||
viewModel.getPhRechargeInfo(username, phToken, userId)
|
||||
dialogDoMainChoose?.dismiss()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
dialogDoMainChoose?.show()
|
||||
}
|
||||
}
|
||||
|
|
@ -473,7 +317,6 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showLoadingDialog(content: String) {
|
||||
apply {
|
||||
if (!::rxDialogShapeLoading.isInitialized) {
|
||||
|
|
@ -486,37 +329,32 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideLoadingDialog() {
|
||||
if (::rxDialogShapeLoading.isInitialized && rxDialogShapeLoading.isShowing) {
|
||||
rxDialogShapeLoading.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initAdapter(recharge: RechargeInfo) {
|
||||
val rechargeListAdapter = VIPRechargeAdapter()
|
||||
rvRechargeList.layoutManager =
|
||||
GridLayoutManager(CommonUtils.getApp(), 2, GridLayoutManager.VERTICAL, false)
|
||||
rechargeListAdapter.setCloudServiceList(recharge, this@MemberRechargeActivity)
|
||||
rvRechargeList.adapter = rechargeListAdapter
|
||||
rechargeListAdapter.setListener(object : VIPRechargeAdapter.VIPRechargeItemClickListener {
|
||||
rvRechargeList.layoutManager =GridLayoutManager(CommonUtils.getApp(), 2, GridLayoutManager.VERTICAL, false)
|
||||
rechargeListAdapter.setCloudServiceList(recharge,this@MemberRechargeActivity)
|
||||
rvRechargeList.adapter=rechargeListAdapter
|
||||
rechargeListAdapter.setListener(object :VIPRechargeAdapter.VIPRechargeItemClickListener{
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onItemClick(noteItem: Grade?) {
|
||||
selectedGrade = noteItem
|
||||
selectedGrade=noteItem
|
||||
val amount = selectedGrade!!.amount?.toFloat()
|
||||
if (amount != null) {
|
||||
if (selectedGrade!!.id != null) {
|
||||
if(selectedGrade!!.id!=null){
|
||||
selectedGradeID = selectedGrade!!.id!!
|
||||
}
|
||||
val decimalFormat = DecimalFormat("#0.00")
|
||||
tvPay.text =
|
||||
resources.getString(R.string.ActivateVIP) + "(¥${decimalFormat.format(amount)})"
|
||||
tvPay.text =resources.getString(R.string.ActivateVIP)+"(¥${decimalFormat.format(amount)})"
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
private fun startCheckout() {
|
||||
GlobalScope.launch {
|
||||
|
|
@ -536,14 +374,12 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
RxToast.info(getString(R.string.PaymentCompleted))
|
||||
}
|
||||
}
|
||||
|
||||
StripeIntent.Status.RequiresAction -> {
|
||||
Log.i("startCheckout:RequiresAction")
|
||||
ThreadUtils.runOnUiThread {
|
||||
RxToast.info(getString(R.string.PaymentCancellation))
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
Log.i("startCheckout status::${paymentIntent.status}")
|
||||
}
|
||||
|
|
@ -559,7 +395,6 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun orderPayment(data: Trade) {
|
||||
Log.i("PayGradeIDTEST:${selectedGradeID}")
|
||||
val payList = mutableListOf<RechargeModelEntity>()
|
||||
|
|
@ -644,16 +479,9 @@ class MemberRechargeActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
super.onRestart()
|
||||
android.util.Log.e("MemberRechargeActivity", " onRestart 重新可见之后刷新有效期")
|
||||
viewModel.checkLogin()
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
val intent = Intent()
|
||||
this.setResult(1000, intent)
|
||||
val intent=Intent()
|
||||
this.setResult(1000,intent)
|
||||
finish() // 关闭当前 Activity
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,28 +237,8 @@ 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)
|
||||
|
||||
mainAtyVM.getRuningNoticeInfo()
|
||||
mainAtyVM.startHeartBeat()
|
||||
initViews()
|
||||
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_GLOBAL_MODEL, false)
|
||||
|
|
@ -267,12 +247,8 @@ class NewMainActivity : BaseActivity() {
|
|||
|
||||
|
||||
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
|
||||
|
||||
startLog()
|
||||
// showBindAccount()
|
||||
firstEntry()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
val requestPermissionLauncher =
|
||||
|
|
@ -315,7 +291,7 @@ class NewMainActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
mainAtyVM.getNoticeInfo()
|
||||
// mainAtyVM.getNoticeInfo()
|
||||
activityPopupWindow()
|
||||
}
|
||||
}
|
||||
|
|
@ -589,110 +565,106 @@ class NewMainActivity : BaseActivity() {
|
|||
} else if (httpStatus.reqType == HttpReqType.GetActivity) {
|
||||
val data = httpStatus.rsp as GetActivityRsp
|
||||
if (data.code == 200) {
|
||||
if (data.data != null) {
|
||||
if (data.data.data != null) {
|
||||
if (data.data.data.list.isNotEmpty()) {
|
||||
if(data.data.data.list.size>1){
|
||||
val bannerImgBeans=mutableListOf<BannerImgBean>()
|
||||
data.data.data.list.forEach {item->
|
||||
bannerImgBeans.add(BannerImgBean(item.title,item.content,item.redirectLink,0))
|
||||
}
|
||||
homeActivityDialog = HomeActivityDialog(this,bannerImgBeans)
|
||||
homeActivityDialog!!.show()
|
||||
homeActivityDialog?.setOnDialogClickListener(object : HomeActivityDialog.OnHADialogClickListener {
|
||||
override fun onRechargeClickListener() {
|
||||
//跳转到支付界面
|
||||
goBackupRechargeWeb()
|
||||
}
|
||||
|
||||
override fun onCancelClickListener() {
|
||||
homeActivityDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onClickImgType(position: Int) {
|
||||
android.util.Log.i("Postion", "position::$position")
|
||||
|
||||
if(bannerImgBeans.get(position).redirectLink.contains("https:")){
|
||||
var uri = Uri.parse(bannerImgBeans.get(position).redirectLink)
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(uri)
|
||||
startActivity(intent)
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("firstCharge")){
|
||||
goBackupRechargeWeb()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("BindAccount")){
|
||||
var useraccount =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
if (Utils.isEmail(useraccount) || Utils.isPhoneNumber(useraccount)) {
|
||||
RxToast.info(resources.getString(R.string.bindingAgi))
|
||||
return
|
||||
}
|
||||
val dialog = DialogBandChoose(this@NewMainActivity)
|
||||
dialog.setOnBandClickListener(object : DialogBandChoose.OnBandClickListener {
|
||||
override fun onBandClick(isPhone: Boolean) {
|
||||
val intent = Intent(CommonUtils.getApp(), BandPhoneActivity::class.java)
|
||||
intent.putExtra("isPhone", isPhone)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
dialog.show()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("SignIn")){
|
||||
mainAtyVM.vipSign()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
data.data.data.list[0].redirectLink.let {
|
||||
var bannerImgBeans=mutableListOf<BannerImgBean>()
|
||||
bannerImgBeans.add(BannerImgBean(data.data.data.list[0].title,data.data.data.list[0].content,data.data.data.list[0].redirectLink,0))
|
||||
homeActivityDialog =
|
||||
HomeActivityDialog(this,bannerImgBeans)
|
||||
homeActivityDialog!!.show()
|
||||
homeActivityDialog?.setOnDialogClickListener(object :
|
||||
HomeActivityDialog.OnHADialogClickListener {
|
||||
override fun onRechargeClickListener() {
|
||||
//跳转到支付界面
|
||||
goBackupRechargeWeb()
|
||||
}
|
||||
|
||||
override fun onCancelClickListener() {
|
||||
homeActivityDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onClickImgType(position: Int) {
|
||||
android.util.Log.i("Postion", "position::$position")
|
||||
if(bannerImgBeans.get(position).redirectLink.contains("https:")){
|
||||
var uri = Uri.parse(bannerImgBeans.get(position).redirectLink)
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(uri)
|
||||
startActivity(intent)
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("firstCharge")){
|
||||
goBackupRechargeWeb()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("BindAccount")){
|
||||
var useraccount =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
if (Utils.isEmail(useraccount) || Utils.isPhoneNumber(useraccount)) {
|
||||
RxToast.info(resources.getString(R.string.bindingAgi))
|
||||
return
|
||||
}
|
||||
val dialog = DialogBandChoose(this@NewMainActivity)
|
||||
dialog.setOnBandClickListener(object : DialogBandChoose.OnBandClickListener {
|
||||
override fun onBandClick(isPhone: Boolean) {
|
||||
val intent = Intent(CommonUtils.getApp(), BandPhoneActivity::class.java)
|
||||
intent.putExtra("isPhone", isPhone)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
dialog.show()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("SignIn")){
|
||||
mainAtyVM.vipSign()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.data.data.list.isNotEmpty()) {
|
||||
if(data.data.data.list.size>1){
|
||||
val bannerImgBeans=mutableListOf<BannerImgBean>()
|
||||
data.data.data.list.forEach {item->
|
||||
bannerImgBeans.add(BannerImgBean(item.title,item.content,item.redirectLink,0))
|
||||
}
|
||||
homeActivityDialog = HomeActivityDialog(this,bannerImgBeans)
|
||||
homeActivityDialog!!.show()
|
||||
homeActivityDialog?.setOnDialogClickListener(object : HomeActivityDialog.OnHADialogClickListener {
|
||||
override fun onRechargeClickListener() {
|
||||
//跳转到支付界面
|
||||
goBackupRechargeWeb()
|
||||
}
|
||||
|
||||
override fun onCancelClickListener() {
|
||||
homeActivityDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onClickImgType(position: Int) {
|
||||
android.util.Log.i("Postion", "position::$position")
|
||||
|
||||
if(bannerImgBeans.get(position).redirectLink.contains("https:")){
|
||||
val uri = Uri.parse(bannerImgBeans.get(position).redirectLink)
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(uri)
|
||||
startActivity(intent)
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("firstCharge")){
|
||||
goBackupRechargeWeb()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("BindAccount")){
|
||||
var useraccount =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
if (Utils.isEmail(useraccount) || Utils.isPhoneNumber(useraccount)) {
|
||||
RxToast.info(resources.getString(R.string.bindingAgi))
|
||||
return
|
||||
}
|
||||
val dialog = DialogBandChoose(this@NewMainActivity)
|
||||
dialog.setOnBandClickListener(object : DialogBandChoose.OnBandClickListener {
|
||||
override fun onBandClick(isPhone: Boolean) {
|
||||
val intent = Intent(CommonUtils.getApp(), BandPhoneActivity::class.java)
|
||||
intent.putExtra("isPhone", isPhone)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
dialog.show()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("SignIn")){
|
||||
mainAtyVM.vipSign()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
data.data.data.list[0].redirectLink.let {
|
||||
var bannerImgBeans=mutableListOf<BannerImgBean>()
|
||||
bannerImgBeans.add(BannerImgBean(data.data.data.list[0].title,data.data.data.list[0].content,data.data.data.list[0].redirectLink,0))
|
||||
homeActivityDialog =
|
||||
HomeActivityDialog(this,bannerImgBeans)
|
||||
homeActivityDialog!!.show()
|
||||
homeActivityDialog?.setOnDialogClickListener(object :
|
||||
HomeActivityDialog.OnHADialogClickListener {
|
||||
override fun onRechargeClickListener() {
|
||||
//跳转到支付界面
|
||||
goBackupRechargeWeb()
|
||||
}
|
||||
|
||||
override fun onCancelClickListener() {
|
||||
homeActivityDialog?.dismiss()
|
||||
}
|
||||
|
||||
override fun onClickImgType(position: Int) {
|
||||
android.util.Log.i("Postion", "position::$position")
|
||||
if(bannerImgBeans.get(position).redirectLink.contains("https:")){
|
||||
var uri = Uri.parse(bannerImgBeans.get(position).redirectLink)
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.setData(uri)
|
||||
startActivity(intent)
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("firstCharge")){
|
||||
goBackupRechargeWeb()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("BindAccount")){
|
||||
var useraccount =
|
||||
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_REMEMBER_USERNAME, "")!!
|
||||
if (Utils.isEmail(useraccount) || Utils.isPhoneNumber(useraccount)) {
|
||||
RxToast.info(resources.getString(R.string.bindingAgi))
|
||||
return
|
||||
}
|
||||
val dialog = DialogBandChoose(this@NewMainActivity)
|
||||
dialog.setOnBandClickListener(object : DialogBandChoose.OnBandClickListener {
|
||||
override fun onBandClick(isPhone: Boolean) {
|
||||
val intent = Intent(CommonUtils.getApp(), BandPhoneActivity::class.java)
|
||||
intent.putExtra("isPhone", isPhone)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
dialog.show()
|
||||
}else if(bannerImgBeans.get(position).redirectLink.contains("SignIn")){
|
||||
mainAtyVM.vipSign()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,11 +149,7 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
private fun initApplication(isNeedRegister: Boolean) {
|
||||
username = Utils.getUniqueID(this)
|
||||
val decodeBool =
|
||||
MMKV.defaultMMKV().decodeBool(BZYConstants.is_splash_first, false)
|
||||
if(decodeBool){
|
||||
MainApplication.initUtil()
|
||||
}
|
||||
MainApplication.initUtil()
|
||||
setLocalLanguage()
|
||||
// splashAtyVM.getSplashBg()
|
||||
var clashBinder = MainApplication.getApp()?.let {
|
||||
|
|
@ -449,7 +445,6 @@ class SplashActivity : BaseActivity() {
|
|||
override fun onFinishClickListener() {
|
||||
doRegisterByEncryption()
|
||||
MMKV.defaultMMKV().encode(BZYConstants.is_splash_first, true)
|
||||
MainApplication.initUtil()
|
||||
}
|
||||
override fun onCancelClickListener() {
|
||||
MMKV.defaultMMKV().encode(BZYConstants.is_splash_first, false)
|
||||
|
|
@ -471,7 +466,7 @@ class SplashActivity : BaseActivity() {
|
|||
rlPb.visibility = View.INVISIBLE
|
||||
but_skip?.visibility = View.INVISIBLE
|
||||
but_register?.visibility = View.INVISIBLE
|
||||
if (MMKV.defaultMMKV().decodeBool(BZYConstants.MMKV_KEY_IS_REGISTER, false)) {
|
||||
if (MMKV.defaultMMKV().decodeBool(MMKV_KEY_IS_REGISTER, false)) {
|
||||
|
||||
if (token != null && token.isNotEmpty()) {
|
||||
ll_action.visibility = View.GONE
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ import androidx.core.content.getSystemService
|
|||
import com.cncat.vpn.common.Global
|
||||
import com.cncat.vpn.common.compat.currentProcessName
|
||||
import com.cncat.vpn.common.log.Log
|
||||
import com.github.gzuliyujiang.oaid.DeviceID
|
||||
import com.github.gzuliyujiang.oaid.DeviceIdentifier
|
||||
import com.github.gzuliyujiang.oaid.IGetter
|
||||
|
||||
import com.jakewharton.processphoenix.ProcessPhoenix
|
||||
import com.orhanobut.logger.Logger
|
||||
|
|
@ -94,7 +91,7 @@ class MainApplication : Application() {
|
|||
|
||||
fun initUtil() {
|
||||
getApp()?.let { mainApplication ->
|
||||
DeviceIdentifier.register(mApp);
|
||||
// DeviceIdentifier.register(mApp)
|
||||
|
||||
val processName = mainApplication.currentProcessName
|
||||
mainApplication.extractGeoFiles()
|
||||
|
|
@ -106,22 +103,22 @@ class MainApplication : Application() {
|
|||
* */
|
||||
val crashCatchHandler: CrashCatchHandler = CrashCatchHandler.getInstance() //获得单例
|
||||
crashCatchHandler.init(mainApplication) //初始化,传入context
|
||||
|
||||
if (DeviceID.supportedOAID(mainApplication)) {
|
||||
// 获取OAID/AAID,异步回调
|
||||
DeviceID.getOAID(mainApplication, object : IGetter {
|
||||
override fun onOAIDGetComplete(result: String) {
|
||||
// 不同厂商的OAID/AAID格式是不一样的,可进行MD5、SHA1之类的哈希运算统一
|
||||
Log.d("onOAIDGetComplete ${result}")
|
||||
OAID = result
|
||||
}
|
||||
|
||||
override fun onOAIDGetError(error: Exception) {
|
||||
// 获取OAID/AAID失败
|
||||
error.printStackTrace()
|
||||
}
|
||||
})
|
||||
}
|
||||
//
|
||||
// if (DeviceID.supportedOAID(mainApplication)) {
|
||||
// // 获取OAID/AAID,异步回调
|
||||
// DeviceID.getOAID(mainApplication, object : IGetter {
|
||||
// override fun onOAIDGetComplete(result: String) {
|
||||
// // 不同厂商的OAID/AAID格式是不一样的,可进行MD5、SHA1之类的哈希运算统一
|
||||
// Log.d("onOAIDGetComplete ${result}")
|
||||
// OAID = result
|
||||
// }
|
||||
//
|
||||
// override fun onOAIDGetError(error: Exception) {
|
||||
// // 获取OAID/AAID失败
|
||||
// error.printStackTrace()
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
//openinstall
|
||||
// OpenInstall.init(applicationContext);
|
||||
PaymentConfiguration.init(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import android.view.ViewGroup
|
|||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.cncat.vpn.common.log.Log
|
||||
import com.yingmao.clash.R
|
||||
import com.yingmao.clash.net.http.entity.Grade
|
||||
import com.yingmao.clash.net.http.entity.RechargeInfo
|
||||
|
|
@ -47,13 +46,11 @@ class VIPRechargeAdapter : RecyclerView.Adapter<VIPRechargeAdapter.VIPRechargeVi
|
|||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.vip_recharge_list_item_layout, parent, false)
|
||||
)
|
||||
|
||||
// override fun getItemCount() = rechargeInfo.grade?.size
|
||||
override fun getItemCount(): Int {
|
||||
if(rechargeInfo.grade!=null){
|
||||
return rechargeInfo.grade!!.size
|
||||
}
|
||||
return 0
|
||||
return 0
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged", "SetTextI18n")
|
||||
|
|
@ -71,6 +68,7 @@ class VIPRechargeAdapter : RecyclerView.Adapter<VIPRechargeAdapter.VIPRechargeVi
|
|||
val firstPayGiftDay = rechargeInfo.firstPayGiftDay?.toInt()?:0
|
||||
val notFirstPayGiftDay = rechargeInfo.notFirstPayGiftDay?.toInt()?:0
|
||||
val totalGiftAmount = giftDay + firstPayGiftDay + notFirstPayGiftDay
|
||||
android.util.Log.i("AAAATAAAA","totalGiftAmount:::"+totalGiftAmount)
|
||||
when (rechargeInfo.grade?.getOrNull(position)?.days) {
|
||||
30 -> {
|
||||
holder.tvDayTxt.text = context!!.resources.getString(R.string.price30)
|
||||
|
|
@ -132,14 +130,15 @@ class VIPRechargeAdapter : RecyclerView.Adapter<VIPRechargeAdapter.VIPRechargeVi
|
|||
|
||||
if (selectorPosition == position) {
|
||||
holder.rechargeItemRl.isSelected = true
|
||||
holder.rechargeItemRl.setBackgroundResource(R.drawable.oc_pay_choose_bg)
|
||||
if (selectorPosition == 0) {
|
||||
listener?.onItemClick(rechargeInfo.grade?.getOrNull(position))
|
||||
}
|
||||
} else {
|
||||
holder.rechargeItemRl.isSelected = false
|
||||
holder.rechargeItemRl.setBackgroundResource(R.drawable.oc_pay_item_bg)
|
||||
}
|
||||
holder.rechargeItemRl.setOnClickListener {
|
||||
Log.i("TESSS position:${position}")
|
||||
listener?.onItemClick(rechargeInfo.grade?.getOrNull(position))
|
||||
selectorPosition = position
|
||||
notifyDataSetChanged()
|
||||
|
|
@ -159,60 +158,6 @@ class VIPRechargeAdapter : RecyclerView.Adapter<VIPRechargeAdapter.VIPRechargeVi
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if(rechargeInfo.grade!=null){
|
||||
// holder.tvDayAverage.text=" ¥${rechargeInfo.grade?.getOrNull(position)?.amount}"
|
||||
// if(rechargeInfo.grade?.getOrNull(position)?.days!=null){
|
||||
// holder.tvDiscount.text=" ¥"+context!!.resources.getString(R.string.Discount).replace("$","${rechargeInfo.grade?.getOrNull(position)?.monthlyAmount}")
|
||||
// if(context!=null){
|
||||
// when(rechargeInfo.grade?.getOrNull(position)?.days){
|
||||
// 30->{
|
||||
// holder.tvDayTxt.text=context!!.resources.getString(R.string.price30)
|
||||
// }
|
||||
// 90->{
|
||||
// holder.tvDayTxt.text=context!!.resources.getString(R.string.price90)
|
||||
// }
|
||||
// 180->{
|
||||
// holder.tvDayTxt.text=context!!.resources.getString(R.string.price180)
|
||||
// }
|
||||
// 365->{
|
||||
// holder.tvDayTxt.text=context!!.resources.getString(R.string.price365)
|
||||
// }
|
||||
// else->{
|
||||
// holder.tvDayTxt.text="${rechargeInfo.grade?.getOrNull(position)?.days}"+ context!!.resources.getString(R.string.day)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if(selectorPosition == position){
|
||||
// holder.rechargeItemRl.isSelected = true
|
||||
// if(selectorPosition==0){
|
||||
// listener?.onItemClick(rechargeInfo.grade?.getOrNull(position))
|
||||
// }
|
||||
// }else{
|
||||
// holder.rechargeItemRl.isSelected = false
|
||||
// }
|
||||
// holder.rechargeItemRl.setOnClickListener {
|
||||
// Log.i("TESSS position:${position}")
|
||||
// listener?.onItemClick(rechargeInfo.grade?.getOrNull(position))
|
||||
// selectorPosition=position
|
||||
// notifyDataSetChanged()
|
||||
// }
|
||||
// if(rechargeInfo.grade?.getOrNull(position)?.giftDay!=null&&rechargeInfo.firstPayGiftDay!=null&&rechargeInfo.notFirstPayGiftDay!=null){
|
||||
// val giftDay =rechargeInfo.grade?.getOrNull(position)?.giftDay?:0
|
||||
// val firstPayGiftDay =rechargeInfo.firstPayGiftDay!!.toInt()
|
||||
// val notFirstPayGiftDay =rechargeInfo.notFirstPayGiftDay!!.toInt()
|
||||
// val totalGiftAmount=giftDay+firstPayGiftDay+notFirstPayGiftDay
|
||||
//
|
||||
// if(totalGiftAmount>0){
|
||||
// holder.clRandomlySend.visibility=View.VISIBLE
|
||||
// holder.tvRandomlySend.text=context!!.resources.getString(R.string.GiveawayDay).replace("$","$totalGiftAmount")
|
||||
// }else{
|
||||
// holder.clRandomlySend.visibility=View.GONE
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ class NetService private constructor() : INetService {
|
|||
// .sslSocketFactory(getSSLSocketFactory(), CustomTrustManager())//信任所有证书
|
||||
.sslSocketFactory(getSSLSocketFactory(), trustAllCerts[0] as X509TrustManager)
|
||||
.hostnameVerifier(getHostnameVerifier()!!)
|
||||
if (BuildConfig.DEBUG) {
|
||||
builder.addInterceptor(loggingInterceptor)
|
||||
}
|
||||
// builder.addInterceptor(loggingInterceptor)
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// builder.addInterceptor(loggingInterceptor)
|
||||
// }
|
||||
builder.addInterceptor(loggingInterceptor)
|
||||
return builder.build()
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,19 @@
|
|||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- This is the main color -->
|
||||
<item>
|
||||
<shape>
|
||||
<!-- 边框颜色 -->
|
||||
<solid android:color="#5A2B31"/>
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 给View的上 左 右设置8dp的边框 -->
|
||||
<item android:top="1dp" android:left="1dp" android:right="3dp" android:bottom="3dp" >
|
||||
<shape>
|
||||
<!-- View填充颜色 -->
|
||||
<solid android:color="#FFFFFF" />
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- This is the main color -->
|
||||
<item>
|
||||
<shape>
|
||||
<!-- 边框颜色 -->
|
||||
<solid android:color="#5A2B31"/>
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 给View的上 左 右设置8dp的边框 -->
|
||||
<item android:top="1dp" android:left="1dp" android:right="3dp" android:bottom="3dp" >
|
||||
<shape>
|
||||
<!-- View填充颜色 -->
|
||||
<solid android:color="#FFDBB2" />
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
|
|
@ -5,6 +5,6 @@
|
|||
android:drawable="@color/translate"/>
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:drawable="@color/black_141b21">
|
||||
android:drawable="@color/gray_BDBDBD">
|
||||
</item>
|
||||
</selector>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".act.InstallApplicationActivity"
|
||||
android:background="@drawable/homeact_linea_bg"
|
||||
android:background="@mipmap/oc_index_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_write"
|
||||
android:src="@drawable/ic_mode_black"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@
|
|||
android:layout_marginStart="13dp"
|
||||
android:layout_marginEnd="13dp"
|
||||
android:layout_marginTop="31dp"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/oc_setting_lo_bg"
|
||||
>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/oc_version_up_bg"
|
||||
android:background="@mipmap/oc_index_bg"
|
||||
>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivBack"
|
||||
|
|
|
|||
|
|
@ -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="@mipmap/oc_index_bg"
|
||||
android:id="@+id/root_view"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
android:id="@+id/aiBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_s_back"
|
||||
android:src="@drawable/ic_mode_black"
|
||||
android:contentDescription="@string/kefu"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@
|
|||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
app:drawableLeftCompat="@drawable/checked_selector"
|
||||
app:layout_constraintStart_toStartOf="@+id/cb_remember_password"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cb_remember_password"
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@
|
|||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:layout_gravity="start"
|
||||
>
|
||||
<!-- android:layout_gravity="start"-->
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/oc_version_up_bg"
|
||||
android:background="@drawable/payment_options_bg"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/KJPay"
|
||||
|
|
@ -24,8 +24,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textSize="17sp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@color/orange_FF8A04"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/quickPayment" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/vip_recharge_list_item_bg_selector"
|
||||
android:background="@drawable/oc_language_bg"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
>
|
||||
<LinearLayout
|
||||
|
|
@ -40,24 +40,12 @@
|
|||
android:id="@+id/tvDayTxt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/blue_4072FE"
|
||||
android:textColor="#B36C1B"
|
||||
android:textSize="21sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
/>
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tvDayAverage"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:textColor="@color/orange_FF991A"-->
|
||||
<!-- android:text="¥36.8"-->
|
||||
<!-- android:textSize="21sp"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:layout_marginTop="5dp"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- />-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -72,7 +60,7 @@
|
|||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="@string/laPay"
|
||||
android:textColor="@color/orange_FF991A"
|
||||
android:textColor="#FF8A04"
|
||||
android:textSize="14sp"
|
||||
|
||||
/>
|
||||
|
|
@ -80,7 +68,7 @@
|
|||
android:id="@+id/tvDayAverage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/orange_FF991A"
|
||||
android:textColor="#FF8A04"
|
||||
android:text="36.8"
|
||||
android:textSize="18sp"
|
||||
android:layout_gravity="center"
|
||||
|
|
|
|||
Loading…
Reference in New Issue