bug修改 - 显示银行账号
This commit is contained in:
parent
4960deb7c3
commit
2527c6369f
|
|
@ -4,7 +4,7 @@ object VididinEvents {
|
||||||
const val Event_Sign_State_Changed = 600
|
const val Event_Sign_State_Changed = 600
|
||||||
const val Event_Account_Gold_Changed = 601
|
const val Event_Account_Gold_Changed = 601
|
||||||
const val Event_Account_Cash_Changed = 602
|
const val Event_Account_Cash_Changed = 602
|
||||||
const val Event_Account_Bank_Info_Changed = 603
|
const val EVENT_BANK_INFO_CHANGED = 603
|
||||||
const val Event_Account_Diamond_Changed = 604
|
const val Event_Account_Diamond_Changed = 604
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -52,6 +52,7 @@ object VididinEvents {
|
||||||
const val EVENT_WITHDRAW_SELECTED_SUB_ITEM_CHANGED = 501
|
const val EVENT_WITHDRAW_SELECTED_SUB_ITEM_CHANGED = 501
|
||||||
const val EVENT_WITHDRAW_CHECK_RESULT_UPDATED = 502
|
const val EVENT_WITHDRAW_CHECK_RESULT_UPDATED = 502
|
||||||
const val EVENT_WITHDRAW_ITEM_LIST_CHANGED = 503
|
const val EVENT_WITHDRAW_ITEM_LIST_CHANGED = 503
|
||||||
|
const val EVENT_WITHDRAW_BANK_ACCOUNT_CHANGED = 504
|
||||||
|
|
||||||
|
|
||||||
// zero withdraw events
|
// zero withdraw events
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class CounterDownTimerView @JvmOverloads constructor(
|
||||||
|
|
||||||
private fun startTimer() {
|
private fun startTimer() {
|
||||||
val startMs = TaskManager.instance().boxTaskStatus().getCurrentBoxStartTimeMs()
|
val startMs = TaskManager.instance().boxTaskStatus().getCurrentBoxStartTimeMs()
|
||||||
val totalMs = TaskManager.instance().boxTaskStatus().getLeftValidBoxTotalDurationMs()
|
val totalMs = TaskManager.instance().boxTaskStatus().getCurrentBoxTotalDurationMs()
|
||||||
|
|
||||||
val restMs = startMs + totalMs - System.currentTimeMillis()
|
val restMs = startMs + totalMs - System.currentTimeMillis()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,12 +174,17 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
|
||||||
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED -> {
|
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED -> {
|
||||||
udpateItemListUI()
|
udpateItemListUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VididinEvents.EVENT_BANK_INFO_CHANGED -> {
|
||||||
|
withdrawPix2.updateBankAccountInfo()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, VididinEvents.Event_Account_Cash_Changed,
|
}, VididinEvents.Event_Account_Cash_Changed,
|
||||||
VididinEvents.EVENT_AD_WATCHED_FOR_WITHDRAW_SMALL,
|
VididinEvents.EVENT_AD_WATCHED_FOR_WITHDRAW_SMALL,
|
||||||
VididinEvents.EVENT_WITHDRAW_CHECK_RESULT_UPDATED,
|
VididinEvents.EVENT_WITHDRAW_CHECK_RESULT_UPDATED,
|
||||||
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED)
|
VididinEvents.EVENT_WITHDRAW_ITEM_LIST_CHANGED,
|
||||||
|
VididinEvents.EVENT_BANK_INFO_CHANGED)
|
||||||
|
|
||||||
readTransactionsAndShowResult()
|
readTransactionsAndShowResult()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import com.ama.core.architecture.util.ResUtil
|
import com.ama.core.architecture.util.ResUtil
|
||||||
|
import com.gamedog.vididin.core.login.login.AccountManager
|
||||||
import com.vididin.real.money.game.R
|
import com.vididin.real.money.game.R
|
||||||
import com.vididin.real.money.game.databinding.WithdrawItemBankViewBinding as ViewBinding
|
import com.vididin.real.money.game.databinding.WithdrawItemBankViewBinding as ViewBinding
|
||||||
|
|
||||||
|
|
@ -23,6 +24,18 @@ class WithDrawItemBankView @JvmOverloads constructor(
|
||||||
mBinding = ViewBinding.inflate(LayoutInflater.from(context), this, true)
|
mBinding = ViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateBankAccountInfo() {
|
||||||
|
if (AccountManager.isBankAccountExist()) {
|
||||||
|
AccountManager.getBankInfo()?.bankAccount?.let {
|
||||||
|
mBinding.tvBankAccount.text = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
updateBankAccountInfo()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For withdraw number in top area
|
* For withdraw number in top area
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,13 @@ object AccountManager {
|
||||||
|
|
||||||
fun saveBankAccount(bankAccount: String?) {
|
fun saveBankAccount(bankAccount: String?) {
|
||||||
if (bankAccount.isNullOrEmpty()) {
|
if (bankAccount.isNullOrEmpty()) {
|
||||||
mAccount?.bankInfo = null
|
mAccount.bankInfo = null
|
||||||
} else {
|
} else {
|
||||||
mAccount?.bankInfo = BankInfo(bankAccount=bankAccount)
|
mAccount.bankInfo = BankInfo(bankAccount=bankAccount)
|
||||||
}
|
}
|
||||||
saveAccountInfo()
|
saveAccountInfo()
|
||||||
NotifyMan.instance().sendEvent(
|
NotifyMan.instance().sendEvent(
|
||||||
VididinEvents.Event_Account_Bank_Info_Changed, NotifyMan.NotifyData(bankAccount))
|
VididinEvents.EVENT_BANK_INFO_CHANGED, NotifyMan.NotifyData(bankAccount))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,8 @@ import com.ama.core.architecture.util.eventbus.NotifyMan
|
||||||
import com.vididin.real.money.game.R
|
import com.vididin.real.money.game.R
|
||||||
import com.gamedog.vididin.VididinEvents
|
import com.gamedog.vididin.VididinEvents
|
||||||
import com.gamedog.vididin.beans.RECORD_CASH_PLUS_BOX_TASK
|
import com.gamedog.vididin.beans.RECORD_CASH_PLUS_BOX_TASK
|
||||||
import com.gamedog.vididin.beans.RECORD_CASH_PLUS_GOLD_CONVERT
|
|
||||||
import com.gamedog.vididin.beans.RecordCash
|
import com.gamedog.vididin.beans.RecordCash
|
||||||
import com.gamedog.vididin.core.login.login.AccountManager
|
import com.gamedog.vididin.core.login.login.AccountManager
|
||||||
import com.gamedog.vididin.core.login.login.AccountManager.adjustCash
|
|
||||||
import com.gamedog.vididin.main.fragments.task.BoxTaskRoot
|
import com.gamedog.vididin.main.fragments.task.BoxTaskRoot
|
||||||
import com.gamedog.vididin.manager.TaskManager
|
import com.gamedog.vididin.manager.TaskManager
|
||||||
import com.gamedog.vididin.manager.TaskManager.Companion.BOX_SUB_TASK_TYPE_ZERO_BUY
|
import com.gamedog.vididin.manager.TaskManager.Companion.BOX_SUB_TASK_TYPE_ZERO_BUY
|
||||||
|
|
@ -170,7 +168,11 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLeftValidBoxTotalDurationMs(): Long {
|
fun getCurrentBoxTotalDurationMs(): Long {
|
||||||
|
return 1L * mStateBean.boxList[mStateBean.currentBoxIndex].duration_days * 24 * 3600000
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getLeftValidBoxTotalDurationMs2(): Long {
|
||||||
var totalLeftMs = 0L
|
var totalLeftMs = 0L
|
||||||
val currentBoxIndex = mStateBean.currentBoxIndex
|
val currentBoxIndex = mStateBean.currentBoxIndex
|
||||||
mStateBean.boxList.forEachIndexed { index, box ->
|
mStateBean.boxList.forEachIndexed { index, box ->
|
||||||
|
|
@ -186,7 +188,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLeftValidBoxTotalDurationStr(): String {
|
fun getLeftValidBoxTotalDurationStr(): String {
|
||||||
val leftMs = TaskManager.instance().boxTaskStatus().getLeftValidBoxTotalDurationMs()
|
val leftMs = TaskManager.instance().boxTaskStatus().getCurrentBoxTotalDurationMs()
|
||||||
val boxLeftDays = leftMs / (24*3600000)
|
val boxLeftDays = leftMs / (24*3600000)
|
||||||
val boxLeftHours = (leftMs - boxLeftDays * 24 * 3600000) / 3600000
|
val boxLeftHours = (leftMs - boxLeftDays * 24 * 3600000) / 3600000
|
||||||
return boxLeftDays.toString() + ResUtil.getString(R.string.day_simple) + " " + boxLeftHours.toString( ) + ResUtil.getString(R.string.hour_simple)
|
return boxLeftDays.toString() + ResUtil.getString(R.string.day_simple) + " " + boxLeftHours.toString( ) + ResUtil.getString(R.string.hour_simple)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/tv_bank_account"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue