|
@@ -3,7 +3,6 @@ package com.cocking.fight.screen.report
|
|
|
import android.annotation.SuppressLint
|
|
|
import android.graphics.Color
|
|
|
import android.view.View
|
|
|
-import android.widget.ImageView
|
|
|
import android.widget.TextView
|
|
|
import androidx.core.content.ContextCompat
|
|
|
import com.gdtlib.lib.adapter.BaseListItem
|
|
@@ -80,53 +79,41 @@ class ReportListViewHolder(
|
|
|
}
|
|
|
|
|
|
when (betType) {
|
|
|
- /*K.Meron -> {
|
|
|
- tvWinResult.setTextColor(Color.RED)
|
|
|
- }
|
|
|
- K.Wala -> {
|
|
|
- tvWinResult.setTextColor(Color.BLUE)
|
|
|
- }*/
|
|
|
- K.Tie -> {
|
|
|
+ /*K.Cancel -> {
|
|
|
tvWinResult.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.draw
|
|
|
+ R.color.cancel
|
|
|
)
|
|
|
)
|
|
|
}
|
|
|
- K.Cancel -> {
|
|
|
+ else -> {
|
|
|
tvWinResult.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.cancel
|
|
|
+ R.color.color_blue_800
|
|
|
)
|
|
|
)
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
tvResultName.text = item.resultName
|
|
|
when (item.resultName) {
|
|
|
- /*K.Meron -> {
|
|
|
- tvResultName.setTextColor(Color.RED)
|
|
|
- }
|
|
|
- K.Wala -> {
|
|
|
- tvResultName.setTextColor(Color.BLUE)
|
|
|
- }*/
|
|
|
- K.Tie -> {
|
|
|
+ /*K.Cancel -> {
|
|
|
tvResultName.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.draw
|
|
|
+ R.color.cancel
|
|
|
)
|
|
|
)
|
|
|
}
|
|
|
- K.Cancel -> {
|
|
|
- tvResultName.setTextColor(
|
|
|
+ else -> {
|
|
|
+ tvWinResult.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.cancel
|
|
|
+ R.color.color_blue_800
|
|
|
)
|
|
|
)
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
val winLose = if (item.amountWin.isNullOrEmpty()) {
|
|
|
"0"
|
|
@@ -135,7 +122,12 @@ class ReportListViewHolder(
|
|
|
}
|
|
|
tvResultAmount.text = "$betCast=$winLose"
|
|
|
if (item.is_win == true) {
|
|
|
- tvResultAmount.setTextColor(Color.BLACK)
|
|
|
+ tvResultAmount.setTextColor(
|
|
|
+ ContextCompat.getColor(
|
|
|
+ itemView.context,
|
|
|
+ R.color.color_blue_800
|
|
|
+ )
|
|
|
+ )
|
|
|
} else {
|
|
|
tvResultAmount.setTextColor(Color.RED)
|
|
|
}
|
|
@@ -163,55 +155,25 @@ class ReportListViewHolder(
|
|
|
}
|
|
|
|
|
|
when (betType) {
|
|
|
- /*K.Meron -> {
|
|
|
- tvResultName.setTextColor(Color.RED)
|
|
|
- }
|
|
|
- K.Wala -> {
|
|
|
- tvResultName.setTextColor(Color.BLUE)
|
|
|
- }*/
|
|
|
- K.Tie -> {
|
|
|
+ K.Cancel -> {
|
|
|
tvResultName.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.draw
|
|
|
+ R.color.cancel
|
|
|
)
|
|
|
)
|
|
|
}
|
|
|
- K.Cancel -> {
|
|
|
+ else -> {
|
|
|
tvResultName.setTextColor(
|
|
|
ContextCompat.getColor(
|
|
|
itemView.context,
|
|
|
- R.color.cancel
|
|
|
+ R.color.color_blue_800
|
|
|
)
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
is ReportThree -> {//Statement
|
|
|
- val imgC1 = itemView.findViewById<ImageView>(R.id.img_c1)
|
|
|
- val tvC2 = itemView.findViewById<TextView>(R.id.tv_c2)
|
|
|
- val tvC3 = itemView.findViewById<TextView>(R.id.tv_c3)
|
|
|
- val tvC4 = itemView.findViewById<TextView>(R.id.tv_c4)
|
|
|
- tvC2.text = item.type
|
|
|
- tvC3.text = item.date
|
|
|
- when (item.type) {
|
|
|
- "BETTED" -> {
|
|
|
- imgC1.setImageResource(R.drawable.bet)
|
|
|
- if (item.amount < 0) {//lost
|
|
|
- tvC4.text = currencyFormat(item.amount.toInt())
|
|
|
- tvC4.setTextColor(Color.RED)
|
|
|
- } else {//win
|
|
|
- tvC4.text = currencyFormat(item.amount.toInt())
|
|
|
- tvC4.setTextColor(Color.BLUE)
|
|
|
- }
|
|
|
- }
|
|
|
- "WITHDREW" -> {
|
|
|
- imgC1.setImageResource(R.drawable.withdraw)
|
|
|
- }
|
|
|
- "DEPOSITED" -> {
|
|
|
- imgC1.setImageResource(R.drawable.deposit)
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|