Compare commits
2 Commits
fedae8b98f
...
6dd6502c5a
| Author | SHA1 | Date |
|---|---|---|
|
|
6dd6502c5a | |
|
|
09d74032a9 |
|
|
@ -1,6 +1,6 @@
|
|||
package com.gamedog.vididin.beans
|
||||
|
||||
data class Transaction(
|
||||
data class RecordCash(
|
||||
val id: Long,
|
||||
val dateTime: String,
|
||||
val status: TransactionStatus,
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.gamedog.vididin.beans
|
||||
|
||||
data class RecordGold(
|
||||
val id: Long,
|
||||
val dateTime: String,
|
||||
val status: TransactionStatus,
|
||||
val statusText: String,
|
||||
val description: String,
|
||||
val amount: String,
|
||||
val amountColor: Int
|
||||
)
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.gamedog.vididin.features.withdrawrecord
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gamedog.vididin.beans.RecordCash
|
||||
import com.gamedog.vididin.beans.TransactionStatus
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordCashItemBinding as ViewBinding
|
||||
|
||||
class RecordCashRvAdapter : ListAdapter<RecordCash, RecordCashRvAdapter.ViewHolder>(DiffCallback()) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val binding = ViewBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return ViewHolder(binding)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
holder.bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(transaction: RecordCash) {
|
||||
binding.tvDate.text = transaction.dateTime
|
||||
binding.tvStatus.text = transaction.statusText
|
||||
binding.tvDescription.text = transaction.description
|
||||
binding.tvAmount.text = transaction.amount
|
||||
binding.tvAmount.setTextColor(ContextCompat.getColor(binding.root.context, transaction.amountColor))
|
||||
|
||||
// 设置状态图标
|
||||
binding.tvStatusIcon.text = when (transaction.status) {
|
||||
TransactionStatus.SUCCESS -> "✔"
|
||||
TransactionStatus.FAILED -> "!"
|
||||
TransactionStatus.PROCESSING -> "⟳"
|
||||
TransactionStatus.REDEEM -> "↗"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DiffCallback : DiffUtil.ItemCallback<RecordCash>() {
|
||||
override fun areItemsTheSame(oldItem: RecordCash, newItem: RecordCash): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: RecordCash, newItem: RecordCash): Boolean {
|
||||
return oldItem == newItem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gamedog.vididin.features.withdrawrecord
|
||||
|
||||
|
||||
import com.ama.core.architecture.appBase.vm.AppViewModel
|
||||
import com.gamedog.vididin.beans.RecordCash
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import javax.inject.Inject
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordCashUiState as UiState
|
||||
|
||||
|
||||
@HiltViewModel
|
||||
class RecordCashViewModel @Inject constructor() : AppViewModel<UiState>() {
|
||||
override val uiStateInitialValue: UiState = UiState()
|
||||
override val uiStateFlow: Flow<UiState> = flowOf()
|
||||
|
||||
|
||||
}
|
||||
|
||||
data class RecordCashUiState(
|
||||
val mRecordList: MutableList<RecordCash> = mutableListOf()
|
||||
)
|
||||
|
|
@ -6,14 +6,14 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gamedog.vididin.beans.Transaction
|
||||
import com.gamedog.vididin.beans.RecordGold
|
||||
import com.gamedog.vididin.beans.TransactionStatus
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordGoldItemBinding
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordGoldItemBinding as ViewBinding
|
||||
|
||||
class TransactionAdapter : ListAdapter<Transaction, TransactionAdapter.ViewHolder>(DiffCallback()) {
|
||||
class RecordGoldRvAdapter : ListAdapter<RecordGold, RecordGoldRvAdapter.ViewHolder>(DiffCallback()) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val binding = FragmentWithdrawRecordGoldItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
val binding = ViewBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return ViewHolder(binding)
|
||||
}
|
||||
|
||||
|
|
@ -21,8 +21,8 @@ class TransactionAdapter : ListAdapter<Transaction, TransactionAdapter.ViewHolde
|
|||
holder.bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(private val binding: FragmentWithdrawRecordGoldItemBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(transaction: Transaction) {
|
||||
inner class ViewHolder(private val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(transaction: RecordGold) {
|
||||
binding.tvDate.text = transaction.dateTime
|
||||
binding.tvStatus.text = transaction.statusText
|
||||
binding.tvDescription.text = transaction.description
|
||||
|
|
@ -39,12 +39,12 @@ class TransactionAdapter : ListAdapter<Transaction, TransactionAdapter.ViewHolde
|
|||
}
|
||||
}
|
||||
|
||||
class DiffCallback : DiffUtil.ItemCallback<Transaction>() {
|
||||
override fun areItemsTheSame(oldItem: Transaction, newItem: Transaction): Boolean {
|
||||
class DiffCallback : DiffUtil.ItemCallback<RecordGold>() {
|
||||
override fun areItemsTheSame(oldItem: RecordGold, newItem: RecordGold): Boolean {
|
||||
return oldItem.id == newItem.id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: Transaction, newItem: Transaction): Boolean {
|
||||
override fun areContentsTheSame(oldItem: RecordGold, newItem: RecordGold): Boolean {
|
||||
return oldItem == newItem
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gamedog.vididin.features.withdrawrecord
|
||||
|
||||
|
||||
import com.ama.core.architecture.appBase.vm.AppViewModel
|
||||
import com.gamedog.vididin.beans.RecordGold
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import javax.inject.Inject
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordGoldUiState as UiState
|
||||
|
||||
|
||||
@HiltViewModel
|
||||
class RecordGoldViewModel @Inject constructor() : AppViewModel<UiState>() {
|
||||
override val uiStateInitialValue: UiState = UiState()
|
||||
override val uiStateFlow: Flow<UiState> = flowOf()
|
||||
|
||||
|
||||
}
|
||||
|
||||
data class RecordGoldUiState(
|
||||
val mRecordList: MutableList<RecordGold> = mutableListOf()
|
||||
)
|
||||
|
|
@ -3,7 +3,8 @@ package com.gamedog.vididin.features.withdrawrecord
|
|||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.gamedog.vididin.features.withdrawrecord.fragments.DinheiroFragment
|
||||
import com.gamedog.vididin.features.withdrawrecord.fragments.CashRecordFragment
|
||||
import com.gamedog.vididin.features.withdrawrecord.fragments.GoldRecordFragment
|
||||
|
||||
class ViewPagerAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) {
|
||||
|
||||
|
|
@ -11,8 +12,8 @@ class ViewPagerAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapte
|
|||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return when (position) {
|
||||
0 -> DinheiroFragment()
|
||||
1 -> DinheiroFragment() // 创建类似的Fragment
|
||||
0 -> CashRecordFragment()
|
||||
1 -> GoldRecordFragment()
|
||||
else -> throw IllegalArgumentException("Invalid position: $position")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ import androidx.core.view.ViewCompat
|
|||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updatePadding
|
||||
import com.ama.core.architecture.appBase.AppViewsActivity
|
||||
import com.ama.core.architecture.util.ResUtil
|
||||
import com.gamedog.vididin.R
|
||||
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlin.getValue
|
||||
|
|
@ -62,10 +64,26 @@ class WithdrawRecordActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>
|
|||
val adapter = ViewPagerAdapter(this)
|
||||
binding.viewPager.adapter = adapter
|
||||
|
||||
with (binding.tabLayout) {
|
||||
addOnTabSelectedListener(object: TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab?) {
|
||||
setTabTextColors(ResUtil.getColor(R.color.black),
|
||||
ResUtil.getColor(if (selectedTabPosition == 0) R.color.green_39 else R.color.yellow_0b))
|
||||
}
|
||||
|
||||
override fun onTabUnselected(tab: TabLayout.Tab?) {
|
||||
}
|
||||
|
||||
override fun onTabReselected(tab: TabLayout.Tab?) {
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
TabLayoutMediator(binding.tabLayout, binding.viewPager) { tab, position ->
|
||||
tab.text = when (position) {
|
||||
0 -> "Dinheiro"
|
||||
1 -> "Moedas"
|
||||
0 -> ResUtil.getString(R.string.record_cash_title)
|
||||
1 -> ResUtil.getString(R.string.record_gold_title)
|
||||
else -> null
|
||||
}
|
||||
}.attach()
|
||||
|
|
@ -82,3 +100,5 @@ class WithdrawRecordActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,21 +4,20 @@ package com.gamedog.vididin.features.withdrawrecord.fragments
|
|||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.ama.core.architecture.appBase.AppViewsFragment
|
||||
import com.ama.core.architecture.appBase.OnFragmentBackgroundListener
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.ama.core.architecture.util.setStatusBarDarkFont
|
||||
import com.ama.core.common.util.dp
|
||||
import com.gamedog.vididin.router.Router
|
||||
import com.gamedog.vididin.R
|
||||
import com.gamedog.vididin.beans.RecordCash
|
||||
import com.gamedog.vididin.beans.TransactionStatus
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordCashRvAdapter
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlin.getValue
|
||||
import com.gamedog.vididin.databinding.VididinappFeatureMineFragmentMineBinding as ViewBinding
|
||||
import com.gamedog.vididin.main.fragments.mine.MineUiState as UiState
|
||||
import com.gamedog.vididin.main.fragments.mine.MineViewModel as ViewModel
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordCashBinding as ViewBinding
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordCashUiState as UiState
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordCashViewModel as ViewModel
|
||||
|
||||
|
||||
|
||||
|
|
@ -26,6 +25,7 @@ import com.gamedog.vididin.main.fragments.mine.MineViewModel as ViewModel
|
|||
@AndroidEntryPoint
|
||||
class CashRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
||||
OnFragmentBackgroundListener {
|
||||
private lateinit var mAdapter: RecordCashRvAdapter
|
||||
override val mViewModel: ViewModel by viewModels()
|
||||
override var isBackgroundBright: Boolean = true
|
||||
|
||||
|
|
@ -39,42 +39,22 @@ class CashRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
|||
) = ViewBinding.inflate(inflater, container, false)
|
||||
|
||||
override fun ViewBinding.initWindowInsets() {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(topBackground) { v, insets ->
|
||||
val systemBars =
|
||||
insets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
|
||||
v.updatePadding(top = systemBars.top + 20.dp)
|
||||
insets
|
||||
}
|
||||
binding?.root?.let { setImmerseRootView(it) }
|
||||
}
|
||||
|
||||
override fun ViewBinding.initViews() {
|
||||
setOnClickBatch(rlPrivacy, rlVersion, rlFeedback) {
|
||||
when (this) {
|
||||
rlPrivacy -> {
|
||||
Router.Privacy.startActivity(requireActivity())
|
||||
}
|
||||
rlVersion -> {
|
||||
Router.Version.startActivity(requireActivity())
|
||||
}
|
||||
rlFeedback -> {
|
||||
Router.Feedback.startActivity(requireActivity())
|
||||
}
|
||||
}
|
||||
}
|
||||
setupRecyclerView()
|
||||
}
|
||||
|
||||
override fun ViewBinding.initListeners() {
|
||||
nestedScrollView.setOnScrollChangeListener { _, _, scrollY, _, _ ->
|
||||
isStatusBarDarkFont = scrollY > topBackground.height
|
||||
setStatusBarDarkFont(isStatusBarDarkFont)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun ViewBinding.initObservers() {
|
||||
}
|
||||
|
||||
override fun ViewBinding.onUiStateCollect(uiState: UiState) {
|
||||
//dynamicColorsSwitch.isChecked = uiState.useDynamicColor
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
@ -82,6 +62,55 @@ class CashRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
|||
setStatusBarDarkFont(isDarkFont = isStatusBarDarkFont)
|
||||
}
|
||||
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
mAdapter = RecordCashRvAdapter()
|
||||
binding?.recyclerView?.adapter = mAdapter
|
||||
binding?.recyclerView?.layoutManager = LinearLayoutManager(requireContext())
|
||||
|
||||
// 模拟数据
|
||||
val transactions = listOf(
|
||||
RecordCash(
|
||||
id = 1,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.SUCCESS,
|
||||
statusText = "Sucesso",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,1",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordCash(
|
||||
id = 2,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.FAILED,
|
||||
statusText = "Falhou",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordCash(
|
||||
id = 3,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.PROCESSING,
|
||||
statusText = "Em processamento...",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 10,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordCash(
|
||||
id = 4,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.REDEEM,
|
||||
statusText = "Resgatar",
|
||||
description = "Você resgatou 4980 moedas",
|
||||
amount = "+R$ 10,0",
|
||||
amountColor = R.color.green_39
|
||||
)
|
||||
)
|
||||
|
||||
mAdapter.submitList(transactions)
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal fun newInstance() = CashRecordFragment()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
package com.gamedog.vididin.features.withdrawrecord.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.gamedog.vididin.R
|
||||
import com.gamedog.vididin.beans.Transaction
|
||||
import com.gamedog.vididin.beans.TransactionStatus
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordCashBinding
|
||||
import com.gamedog.vididin.features.withdrawrecord.TransactionAdapter
|
||||
|
||||
class DinheiroFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentWithdrawRecordCashBinding
|
||||
private lateinit var adapter: TransactionAdapter
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
binding = FragmentWithdrawRecordCashBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupRecyclerView()
|
||||
}
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
adapter = TransactionAdapter()
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||
|
||||
// 模拟数据 - 根据您的截图
|
||||
val transactions = listOf(
|
||||
Transaction(
|
||||
id = 1,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.SUCCESS,
|
||||
statusText = "Sucesso",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,1",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
Transaction(
|
||||
id = 2,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.FAILED,
|
||||
statusText = "Falhou",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
Transaction(
|
||||
id = 3,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.PROCESSING,
|
||||
statusText = "Em processamento...",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 10,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
Transaction(
|
||||
id = 4,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.REDEEM,
|
||||
statusText = "Resgatar",
|
||||
description = "Você resgatou 4980 moedas",
|
||||
amount = "+R$ 10,0",
|
||||
amountColor = R.color.green_39
|
||||
)
|
||||
)
|
||||
|
||||
adapter.submitList(transactions)
|
||||
}
|
||||
}
|
||||
|
|
@ -4,21 +4,21 @@ package com.gamedog.vididin.features.withdrawrecord.fragments
|
|||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.ama.core.architecture.appBase.AppViewsFragment
|
||||
import com.ama.core.architecture.appBase.OnFragmentBackgroundListener
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.ama.core.architecture.util.setStatusBarDarkFont
|
||||
import com.ama.core.common.util.dp
|
||||
import com.gamedog.vididin.router.Router
|
||||
import com.gamedog.vididin.R
|
||||
import com.gamedog.vididin.beans.RecordGold
|
||||
import com.gamedog.vididin.beans.TransactionStatus
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordCashRvAdapter
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordGoldRvAdapter
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlin.getValue
|
||||
import com.gamedog.vididin.databinding.VididinappFeatureMineFragmentMineBinding as ViewBinding
|
||||
import com.gamedog.vididin.main.fragments.mine.MineUiState as UiState
|
||||
import com.gamedog.vididin.main.fragments.mine.MineViewModel as ViewModel
|
||||
import com.gamedog.vididin.databinding.FragmentWithdrawRecordGoldBinding as ViewBinding
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordGoldUiState as UiState
|
||||
import com.gamedog.vididin.features.withdrawrecord.RecordGoldViewModel as ViewModel
|
||||
|
||||
|
||||
|
||||
|
|
@ -26,6 +26,7 @@ import com.gamedog.vididin.main.fragments.mine.MineViewModel as ViewModel
|
|||
@AndroidEntryPoint
|
||||
class GoldRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
||||
OnFragmentBackgroundListener {
|
||||
private lateinit var mAdapter: RecordGoldRvAdapter
|
||||
override val mViewModel: ViewModel by viewModels()
|
||||
override var isBackgroundBright: Boolean = true
|
||||
|
||||
|
|
@ -39,42 +40,22 @@ class GoldRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
|||
) = ViewBinding.inflate(inflater, container, false)
|
||||
|
||||
override fun ViewBinding.initWindowInsets() {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(topBackground) { v, insets ->
|
||||
val systemBars =
|
||||
insets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
|
||||
v.updatePadding(top = systemBars.top + 20.dp)
|
||||
insets
|
||||
}
|
||||
binding?.root?.let { setImmerseRootView(it) }
|
||||
}
|
||||
|
||||
override fun ViewBinding.initViews() {
|
||||
setOnClickBatch(rlPrivacy, rlVersion, rlFeedback) {
|
||||
when (this) {
|
||||
rlPrivacy -> {
|
||||
Router.Privacy.startActivity(requireActivity())
|
||||
}
|
||||
rlVersion -> {
|
||||
Router.Version.startActivity(requireActivity())
|
||||
}
|
||||
rlFeedback -> {
|
||||
Router.Feedback.startActivity(requireActivity())
|
||||
}
|
||||
}
|
||||
}
|
||||
setupRecyclerView()
|
||||
}
|
||||
|
||||
override fun ViewBinding.initListeners() {
|
||||
nestedScrollView.setOnScrollChangeListener { _, _, scrollY, _, _ ->
|
||||
isStatusBarDarkFont = scrollY > topBackground.height
|
||||
setStatusBarDarkFont(isStatusBarDarkFont)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun ViewBinding.initObservers() {
|
||||
}
|
||||
|
||||
override fun ViewBinding.onUiStateCollect(uiState: UiState) {
|
||||
//dynamicColorsSwitch.isChecked = uiState.useDynamicColor
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
@ -82,7 +63,56 @@ class GoldRecordFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(),
|
|||
setStatusBarDarkFont(isDarkFont = isStatusBarDarkFont)
|
||||
}
|
||||
|
||||
|
||||
private fun setupRecyclerView() {
|
||||
mAdapter = RecordGoldRvAdapter()
|
||||
binding?.recyclerView?.adapter = mAdapter
|
||||
binding?.recyclerView?.layoutManager = LinearLayoutManager(requireContext())
|
||||
|
||||
// 模拟数据
|
||||
val transactions = listOf(
|
||||
RecordGold(
|
||||
id = 1,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.SUCCESS,
|
||||
statusText = "Sucesso",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,1",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordGold(
|
||||
id = 2,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.FAILED,
|
||||
statusText = "Falhou",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 0,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordGold(
|
||||
id = 3,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.PROCESSING,
|
||||
statusText = "Em processamento...",
|
||||
description = "Você solicitou o saque com sucesso!",
|
||||
amount = "-R$ 10,0",
|
||||
amountColor = R.color.red_11
|
||||
),
|
||||
RecordGold(
|
||||
id = 4,
|
||||
dateTime = "2025/10/31 17:30",
|
||||
status = TransactionStatus.REDEEM,
|
||||
statusText = "Resgatar",
|
||||
description = "Você resgatou 4980 moedas",
|
||||
amount = "+R$ 10,0",
|
||||
amountColor = R.color.green_39
|
||||
)
|
||||
)
|
||||
|
||||
mAdapter.submitList(transactions)
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal fun newInstance() = GoldRecordFragment()
|
||||
internal fun newInstance() = CashRecordFragment()
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +182,8 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
|||
playVideo()
|
||||
}
|
||||
PlayerConstants.PlayerState.BUFFERING -> {
|
||||
//togglePlayingState(false)
|
||||
binding?.circlePb?.isVisible = true
|
||||
//showLoading(true)
|
||||
}
|
||||
PlayerConstants.PlayerState.VIDEO_CUED -> {
|
||||
togglePlayingState(false)
|
||||
|
|
@ -210,10 +211,12 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
|||
mIsPlaying = isPlaying
|
||||
if (!mIsPlaying) {
|
||||
generateThumbAndSet()
|
||||
} else {
|
||||
binding?.circlePb?.isVisible = false
|
||||
}
|
||||
|
||||
binding?.ivMask?.isVisible = false/*!mIsPlaying*/
|
||||
binding?.playerContainer?.isVisible = isPlaying
|
||||
binding?.ivMask?.isVisible = !mIsPlaying
|
||||
binding?.playerContainer?.isVisible = mIsPlaying
|
||||
|
||||
if (mIsPlaying) {
|
||||
hidePlayIconAnim()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/green_39" />
|
||||
<corners android:radius="42dp" />
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ffff740b" />
|
||||
<corners android:radius="42dp" />
|
||||
</shape>
|
||||
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="20dp"
|
||||
app:tabTextColor="@color/black"
|
||||
app:tabSelectedTextColor="@color/green_39"
|
||||
app:tabIndicatorColor="@color/transparent"
|
||||
|
|
@ -37,6 +36,7 @@
|
|||
app:tabBackground="@color/transparent"
|
||||
app:tabRippleColor="@null"
|
||||
app:tabMode="fixed"
|
||||
android:background="@color/transparent"
|
||||
>
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -2,20 +2,49 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Total sacado até o momento: R$ 0,1"
|
||||
android:background="@drawable/bg_record_tab_cash"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/record_cash_title_hint"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp" />
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_cash"
|
||||
android:layout_marginStart="5dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_cash_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/cash00"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/yellow_00" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -2,20 +2,49 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Total sacado até o momento: R$ 0,1"
|
||||
android:background="@drawable/bg_record_tab_gold"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/record_cash_title_hint"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp" />
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/home_gold"
|
||||
android:layout_marginStart="5dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_gold_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="0"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/yellow_00" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -102,4 +102,14 @@
|
|||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_gravity="bottom"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/circle_pb"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateTint="@android:color/white"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
@ -95,5 +95,6 @@
|
|||
<color name="red_1b">#FF92521B</color>
|
||||
<color name="red_28">#FFFF2828</color>
|
||||
<color name="red_9c">#FFFF9C7C</color>
|
||||
<color name="yellow_0b">#FFFF740B</color>
|
||||
|
||||
</resources>
|
||||
|
|
@ -115,5 +115,8 @@
|
|||
<string name="participar_member_2">Quase 4 milhões de pessoas na jogada!</string>
|
||||
<string name="zero_buy_hint_title">Regras para Ganhar:</string>
|
||||
<string name="zero_buy_hint_content"><![CDATA[Número Sorteado = Segundos da Conclusão % Número de Participantes + 1%: Computes the remainder after division by team size.\\n· Gaste Moedas de Propaganda para participar.\n·Draw when ful l& Reembolso automático se não completar]]></string>
|
||||
<string name="record_cash_title">Dinheiro</string>
|
||||
<string name="record_gold_title">Moedas</string>
|
||||
<string name="record_cash_title_hint">Total sacado até o momento:</string>
|
||||
|
||||
</resources>
|
||||
Loading…
Reference in New Issue