Przeglądaj źródła

+ WA888 change UI Main in progress

Dola TENG 2 lat temu
rodzic
commit
20efe4cb70

+ 2 - 0
.idea/misc.xml

@@ -67,6 +67,8 @@
         <entry key="..\:/PartTimeProject/Yuki/Yuki-Mobile/app/src/main/res/layout/view_square.xml" value="0.18802083333333333" />
         <entry key="..\:/PartTimeProject/Yuki/Yuki-Mobile/app/src/main/res/mipmap-anydpi-v26/ic_logo.xml" value="0.196" />
         <entry key="..\:/android/SBC_Main_Android/app/src/main/res/layout/fragment_report.xml" value="0.25416666666666665" />
+        <entry key="..\:/android/SBC_Main_Android/app/src/main/res/layout/layout_betting_header.xml" value="0.25416666666666665" />
+        <entry key="..\:/android/SBC_Main_Android/app/src/main/res/layout/layout_betting_statement.xml" value="0.25416666666666665" />
         <entry key="..\:/android/SBC_Main_Android/app/src/main/res/layout/layout_fragment_main_yuki.xml" value="0.25416666666666665" />
         <entry key="..\:/android/SBC_Main_Android/app/src/main/res/layout/layout_main_module.xml" value="0.264" />
         <entry key="..\:/android/Yuki-Mobile/app/src/main/res/layout/activity_login.xml" value="0.15489130434782608" />

+ 1 - 1
app/src/main/java/com/khmer9/yuki/adapter/BettingStatementAdapter.kt

@@ -9,7 +9,7 @@ import com.khmer9.yuki.screen.report.bettingStatement.ReportBettingViewHolder
 
 class BettingStatementAdapter : BaseListAdapter() {
     var printButtonListener: ((String, String, String, String, String, String) -> Unit)? = null
-    var detailButtonListener: ((String, String) -> Unit)? = null
+    var detailButtonListener: ((String, String, String) -> Unit)? = null
 
     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
         return ReportBettingViewHolder(

+ 27 - 22
app/src/main/java/com/khmer9/yuki/remote/ReportDataBettingModel.kt

@@ -62,38 +62,43 @@ data class StatementBetting(
     @Json(name = "_id")
     val id: String,
 
+    @Json(name = "module_name")
+    val moduleName: String,
+
+    @Json(name = "module_icon")
+    val moduleIcon: String,
+
+    @Json(name = "module_bet_id")
+    val moduleBetId: String,
+
     @Json(name = "no")
     val no: Int,
 
-    @Json(name = "time")
-    val date: String,
+    @Json(name = "group")
+    val group: Int? = 0,
 
     @Json(name = "total_amount")
-    val amount: Double,
+    val amount: Double? = 0.0,
 
-    @Json(name = "total_cast")
-    val cast: Double,
+    @Json(name = "amount_win")
+    val amountWin: Double? = null ?: 0.0,
 
-    @Json(name = "total_amount_win")
-    val winLose: Double,
+    @Json(name = "cast")
+    val cast: Double? = 0.0,
 
-    @Json(name = "bet_type")
-    val bet_type: List<BettingType>,
-
-    ) : BaseListItem() {
-    override fun getUnique(): String = id
-}
+    @Json(name = "currency_type")
+    val currencyType: Int,
 
-@JsonClass(generateAdapter = true)
-data class BettingType(
-    @Json(name = "_id")
-    val id: String,
+    @Json(name = "channel_type")
+    val channelType: String,
 
-    @Json(name = "name")
-    val name: String,
+    @Json(name = "status")
+    val status: Int,
 
-    @Json(name = "amount")
-    val amount: Double
-)
+    @Json(name = "time")
+    val date: String,
 
+    ) : BaseListItem() {
+    override fun getUnique(): String = id
+}
 //-------------------------------//End Report Betting Statement

+ 17 - 3
app/src/main/java/com/khmer9/yuki/remote/service/ApiService.kt

@@ -2,6 +2,8 @@ package com.khmer9.yuki.remote.service
 
 import com.khmer9.yuki.remote.*
 import com.khmer9.yuki.screen.detail.BettingDetailResponse
+import com.khmer9.yuki.screen.detail.BettingDetailYukiData
+import com.khmer9.yuki.screen.detail.BettingDetailYukiResponse
 import io.reactivex.Single
 import retrofit2.http.*
 
@@ -12,7 +14,7 @@ interface ApiService {
 
     //Report api
 
-    @POST("/v1/api/report/betting")
+    @POST("/v1/api/report/statement")
     fun remoteBettingScreen(@Body reportBettingRequest: ReportBettingRequest? = null): Single<ReportBettingResponse>
 
     @POST("/v1/api/report/withdraw")
@@ -56,6 +58,18 @@ interface ApiService {
     @POST("/v1/api/user/changepassword")
     fun updatePassword(@Field(value = "old_password") userName: String, @Field(value = "new_password") password: String): Single<UpdatePwdResponse>
 
-    @GET("/v1/api/betting/detail/")
-    fun getBettingDetail(@Query("invoice_no") invoiceNum: String): Single<BettingDetailResponse>
+    @GET("/v1/api/report/lotto_plus/invoice_detail")
+    fun getLottPlusInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>
+
+    @GET("/v1/api/report/lotto/invoice")
+    fun getLott80Invoice(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>
+
+    @GET("/v1/api/report/yuki/invoice_detail")
+    fun getYukiInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailYukiResponse>
+
+    @GET("/v1/api/report/6number/invoice")
+    fun get6NumberInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>
+
+    @GET("/v1/api/report/cock/invoice")
+    fun getCockInvoiceDetail(@Query("module_bet_id") invoiceNum: String): Single<BettingDetailResponse>
 }

+ 36 - 3
app/src/main/java/com/khmer9/yuki/screen/detail/BetsDetailListViewHolder.kt

@@ -10,13 +10,13 @@ import com.khmer9.yuki.R
 class BetsDetailListViewHolder(itemView: View, private val printButtonListener: ((String, String, String, String, String, String, String) -> Unit)? = null) : BaseListViewHolder(itemView) {
     override fun bindView(item: BaseListItem) {
         when (item) {
-            is BettingDetailObject -> {
+            is BettingDetailData -> {
                 val txtFightBet: TextView = itemView.findViewById(R.id.txt_fight_no)
                 val txtTime: TextView = itemView.findViewById(R.id.txt_time)
                 val txtAmount: TextView = itemView.findViewById(R.id.txt_amount)
                 val txtType: TextView = itemView.findViewById(R.id.txt_type)
 
-                val fightNo = "#" + item.no.toString()
+                /*val fightNo = "#" + item.no.toString()
                 try {
                     var datetime = item.time.split(" ")
                     var time = datetime[1]
@@ -39,7 +39,40 @@ class BetsDetailListViewHolder(itemView: View, private val printButtonListener:
                     }
                 } catch (e: Exception) {
                 }
-                txtType.text = item.betting
+                txtType.text = item.betting*/
+            }
+
+            is BettingDetailYukiData -> {
+                val txtFightBet: TextView = itemView.findViewById(R.id.txt_fight_no)
+                val txtTime: TextView = itemView.findViewById(R.id.txt_time)
+                val txtAmount: TextView = itemView.findViewById(R.id.txt_amount)
+                val txtType: TextView = itemView.findViewById(R.id.txt_type)
+
+                val fightNo = "#" + item.no.toString()
+                try {
+                    var datetime = item.time.split(" ")
+                    var time = datetime[1]
+                    var date = datetime[0]
+                    txtTime.text = date + System.getProperty("line.separator") + time
+                } catch (e: Exception) {
+                    txtTime.text = item.time
+                }
+
+                txtFightBet.text = fightNo
+                txtAmount.text = item.returnAmount
+
+                try {
+                    val amount = item.returnAmount.split("=")
+                    val winLose = amount[1].trim().toInt()
+                    if (winLose == 0) {
+                        txtAmount.setTextColor(Color.RED)
+                    } else {
+                        txtAmount.setTextColor(Color.rgb(48, 63, 159))
+                    }
+                } catch (e: Exception) {
+                }
+                
+                txtType.text = item.betType.name
             }
         }
     }

+ 106 - 2
app/src/main/java/com/khmer9/yuki/screen/detail/BetsDetailViewModel.kt

@@ -14,11 +14,115 @@ class BetsDetailViewModel(val apiService: ApiService, val prefHelper: PrefHelper
     private val _state = MutableLiveData(BetsDetailViewState())
     val state: LiveData<BetsDetailViewState> = _state
 
-    fun getBetsDetailData(invoiceNum: String) {
+    fun getLottPlusInvoiceDetail(invoiceNum: String) {
         if (_state.value!!.isProgress) return
         _state.value = prev().copy(isProgress = true)
         disposables.add(
-            apiService.getBettingDetail(invoiceNum)
+            apiService.getLottPlusInvoiceDetail(invoiceNum)
+                .timeout(60, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe({
+                    if (it.resultCode == "1") {
+                        _state.value = prev().copy(
+                            isProgress = false,
+                            error = null,
+                            betDetailData = it.data
+                        )
+                    } else {
+                        _state.value =
+                            prev().copy(isProgress = false, error = "[${it.message.description}]")
+                    }
+                }, {
+                    val message: String = "ប្រតិបត្តិការមិនជោគជ័យ\n" + it.getErrorCode()
+                    _state.value = prev().copy(isProgress = false, error = message)
+                })
+        )
+    }
+
+    fun getLott80InvoiceDetail(invoiceNum: String) {
+        if (_state.value!!.isProgress) return
+        _state.value = prev().copy(isProgress = true)
+        disposables.add(
+            apiService.getLott80Invoice(invoiceNum)
+                .timeout(60, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe({
+                    if (it.resultCode == "1") {
+                        _state.value = prev().copy(
+                            isProgress = false,
+                            error = null,
+                            betDetailData = it.data
+                        )
+                    } else {
+                        _state.value =
+                            prev().copy(isProgress = false, error = "[${it.message.description}]")
+                    }
+                }, {
+                    val message: String = "ប្រតិបត្តិការមិនជោគជ័យ\n" + it.getErrorCode()
+                    _state.value = prev().copy(isProgress = false, error = message)
+                })
+        )
+    }
+
+    fun getYukiInvoiceDetail(invoiceNum: String) {
+        if (_state.value!!.isProgress) return
+        _state.value = prev().copy(isProgress = true)
+        disposables.add(
+            apiService.getYukiInvoiceDetail(invoiceNum)
+                .timeout(60, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe({
+                    if (it.resultCode == "1") {
+                        _state.value = prev().copy(
+                            isProgress = false,
+                            error = null,
+                            betDetailYukiData = it.data
+                        )
+                    } else {
+                        _state.value =
+                            prev().copy(isProgress = false, error = "[${it.message.description}]")
+                    }
+                }, {
+                    val message: String = "ប្រតិបត្តិការមិនជោគជ័យ\n" + it.getErrorCode()
+                    _state.value = prev().copy(isProgress = false, error = message)
+                })
+        )
+    }
+
+    fun get6NumberInvoiceDetail(invoiceNum: String) {
+        if (_state.value!!.isProgress) return
+        _state.value = prev().copy(isProgress = true)
+        disposables.add(
+            apiService.get6NumberInvoiceDetail(invoiceNum)
+                .timeout(60, TimeUnit.SECONDS)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe({
+                    if (it.resultCode == "1") {
+                        _state.value = prev().copy(
+                            isProgress = false,
+                            error = null,
+                            betDetailData = it.data
+                        )
+                    } else {
+                        _state.value =
+                            prev().copy(isProgress = false, error = "[${it.message.description}]")
+                    }
+                }, {
+                    val message: String = "ប្រតិបត្តិការមិនជោគជ័យ\n" + it.getErrorCode()
+                    _state.value = prev().copy(isProgress = false, error = message)
+                })
+        )
+    }
+
+    fun getCockInvoiceDetail(invoiceNum: String) {
+        if (_state.value!!.isProgress) return
+        _state.value = prev().copy(isProgress = true)
+        disposables.add(
+            apiService.getCockInvoiceDetail(invoiceNum)
                 .timeout(60, TimeUnit.SECONDS)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())

+ 2 - 1
app/src/main/java/com/khmer9/yuki/screen/detail/BetsDetailViewState.kt

@@ -4,5 +4,6 @@ data class BetsDetailViewState(
     val initial: Boolean = false,
     val isProgress: Boolean = false,
     val error: String? = null,
-    var betDetailData: BettingDetailData? = null,
+    var betDetailData: List<BettingDetailData>? = null,
+    var betDetailYukiData: List<BettingDetailYukiData>? = null
 )

+ 63 - 26
app/src/main/java/com/khmer9/yuki/screen/detail/BettingDetailDataModel.kt

@@ -13,7 +13,7 @@ data class BettingDetailResponse(
     val message: BetDetailMessage,
 
     @Json(name = "data")
-    val data: BettingDetailData
+    val data: List<BettingDetailData>
 )
 
 @JsonClass(generateAdapter = true)
@@ -26,35 +26,84 @@ data class BetDetailMessage(
 
 @JsonClass(generateAdapter = true)
 data class BettingDetailData(
+    @Json(name = "_id")
+    val id: String,
+
+    @Json(name = "no")
+    val no: Int,
+
     @Json(name = "total_amount")
-    val totalAmount: String,
+    val totalAmount: Double,
 
     @Json(name = "total_amount_win")
-    val totalAmountWin: Double? = 0.0,
+    val totalAmountWin: Double,
 
     @Json(name = "total_cast")
-    val totalCast: Double? = 0.0,
+    val totalCast: Double,
+
+    @Json(name = "bet_type")
+    val betType: BetType,
+
+    @Json(name = "is_release_result")
+    val isReleaseResult: Boolean,
+
+    @Json(name = "bet_result")
+    val betResult: BetResult,
+
+    @Json(name = "time")
+    val time: String,
+) : BaseListItem() {
+    override fun getUnique(): String = id
+}
+
+@JsonClass(generateAdapter = true)
+data class BetResult(
+    @Json(name = "is_win")
+    val isWin: Boolean?,
+
+    @Json(name = "name")
+    val name: String?,
+)
+
+@JsonClass(generateAdapter = true)
+data class BetType(
+    @Json(name = "name")
+    val name: String,
 
-    @Json(name = "count")
-    val count: Int,
+    @Json(name = "color")
+    val color: String,
 
-    @Json(name = "list")
-    val bettingDetailList: List<BettingDetailObject>?
+    @Json(name = "payout")
+    val payout: Double,
 )
 
+////////////// YUKI DETAIL
+
 @JsonClass(generateAdapter = true)
-data class BettingDetailObject(
+data class BettingDetailYukiResponse(
+    @Json(name = "code")
+    val resultCode: String,
+
+    @Json(name = "message")
+    val message: BetDetailMessage,
+
+    @Json(name = "data")
+    val data: List<BettingDetailYukiData>
+)
+
+@JsonClass(generateAdapter = true)
+data class BettingDetailYukiData(
     @Json(name = "_id")
     val id: String,
 
     @Json(name = "no")
     val no: Int,
 
-    @Json(name = "betting")
-    val betting: String,
+    @Json(name = "bet_type")
+    val betType: BetType,
 
-    @Json(name = "bet_color")
-    val betColor: String,
+    @Json(name = "return_amount")
+    val returnAmount: String,
 
     @Json(name = "is_release_result")
     val isReleaseResult: Boolean,
@@ -62,20 +111,8 @@ data class BettingDetailObject(
     @Json(name = "bet_result")
     val betResult: BetResult,
 
-    @Json(name = "return_amount")
-    val amount: String,
-
     @Json(name = "time")
     val time: String,
 ) : BaseListItem() {
     override fun getUnique(): String = id
-}
-
-@JsonClass(generateAdapter = true)
-data class BetResult(
-    @Json(name = "is_win")
-    val isWin: Boolean?,
-
-    @Json(name = "name")
-    val name: String?,
-)
+}

+ 50 - 11
app/src/main/java/com/khmer9/yuki/screen/detail/BettingDetailFragment.kt

@@ -1,11 +1,10 @@
 package com.khmer9.yuki.screen.detail
 
-import android.graphics.Color
 import android.os.Bundle
 import android.view.View
-import androidx.core.view.isVisible
 import androidx.recyclerview.widget.DefaultItemAnimator
 import androidx.recyclerview.widget.LinearLayoutManager
+import com.gdtlib.lib.adapter.BaseListItem
 import com.khmer9.yuki.R
 import com.khmer9.yuki.app.App
 import com.khmer9.yuki.app.ShareActivity
@@ -22,8 +21,17 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
     private lateinit var sharePref: PrefHelper
     private lateinit var currency: String
     private lateinit var betsDetailViewModel: BetsDetailViewModel
+
     private val ARG_PARAM1 = "INVOICE_ID"
     private val ARG_PARAM2 = "no"
+    private val ARG_PARAM3 = "module"
+
+    private val APONG = "Apong"
+    private val COCKFIGHT = "CockFight"
+    private val LOTTO80 = "Lotto80"
+    private val LOTTOPLUS = "LottoPlus"
+    private val YUKI = "Yuki"
+
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -57,9 +65,35 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
             }
         }
 
-        requireArguments().getString(ARG_PARAM1)?.let {
-            betsDetailViewModel.getBetsDetailData(it)
-            //mtxtInvoiceNo.text = " #$it"
+        requireArguments().getString(ARG_PARAM3)?.let {
+            val invoiceId = requireArguments().getString(ARG_PARAM1)
+            when {
+                it.equals(APONG, ignoreCase = true) -> {
+                    if (invoiceId != null) {
+                        betsDetailViewModel.get6NumberInvoiceDetail(invoiceId)
+                    }
+                }
+                it.equals(COCKFIGHT, ignoreCase = true) -> {
+                    if (invoiceId != null) {
+                        betsDetailViewModel.getCockInvoiceDetail(invoiceId)
+                    }
+                }
+                it.equals(LOTTO80, ignoreCase = true) -> {
+                    if (invoiceId != null) {
+                        betsDetailViewModel.getLott80InvoiceDetail(invoiceId)
+                    }
+                }
+                it.equals(LOTTOPLUS, ignoreCase = true) -> {
+                    if (invoiceId != null) {
+                        betsDetailViewModel.getLottPlusInvoiceDetail(invoiceId)
+                    }
+                }
+                it.equals(YUKI, ignoreCase = true) -> {
+                    if (invoiceId != null) {
+                        betsDetailViewModel.getYukiInvoiceDetail(invoiceId)
+                    }
+                }
+            }
         }
 
         requireArguments().getString(ARG_PARAM2)?.let {
@@ -79,8 +113,8 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
     }
 
     private fun getCurrentBets(it: BetsDetailViewState) {
-        if (it.betDetailData?.bettingDetailList != null) {
-            try {
+        if (it.betDetailData != null) {
+            /*try {
                 when (user.currencyType) {
                     1 -> {//dollar
                         tv_turn_over.text = "${it.betDetailData?.totalCast} $"
@@ -96,9 +130,9 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
                     }
                 }
             } catch (e: Exception) {
-            }
+            }*/
 
-            try {
+            /*try {
                 if (it.betDetailData?.totalAmountWin!! > 0) {
                     tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
                     tv_total_win_lose.setTextColor(Color.parseColor("#303F9F"))
@@ -109,10 +143,15 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
             } catch (e: Exception) {
                 tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
                 tv_total_win_lose.setTextColor(Color.parseColor("#303F9F"))
-            }
+            }*/
+
+            adapter.submitList(it.betDetailData as MutableList<BaseListItem>)
+        }
 
-            adapter.submitList(it.betDetailData?.bettingDetailList)
+        if (it.betDetailYukiData != null) {
+            adapter.submitList(it.betDetailYukiData as MutableList<BaseListItem>)
         }
+
         adapter.notifyDataSetChanged()
     }
 

+ 2 - 1
app/src/main/java/com/khmer9/yuki/screen/report/StatementFragment.kt

@@ -172,7 +172,7 @@ class StatementFragment : BaseFragment(R.layout.fragment_report) {
             adapterTb1Header = BettingStatementHeaderAdapter(state.statementListTurnOver, state.statementListAmountWinLose)
 
             adapterTb1.submitList(state.statementList)
-            adapterTb1.detailButtonListener = { invoiceId, invoiceNo ->
+            adapterTb1.detailButtonListener = { invoiceId, invoiceNo, moduleName ->
                 if (!invoiceId.isNullOrEmpty()) {
                     (requireActivity() as? ShareActivity)?.apply {
                         supportFragmentManager.beginTransaction()
@@ -186,6 +186,7 @@ class StatementFragment : BaseFragment(R.layout.fragment_report) {
                                 arguments = Bundle().apply {
                                     putString("INVOICE_ID", invoiceId)
                                     putString("no", invoiceNo)
+                                    putString("module", moduleName)
                                 }
                             })
                             .addToBackStack(null)

+ 12 - 9
app/src/main/java/com/khmer9/yuki/screen/report/bettingStatement/ReportBettingViewHolder.kt

@@ -20,7 +20,7 @@ import java.text.DecimalFormat
 class ReportBettingViewHolder(
     itemView: View,
     private val printButtonListener: ((String, String, String, String, String, String) -> Unit)? = null,
-    private val detailButtonListener: ((String, String) -> Unit)? = null
+    private val detailButtonListener: ((String, String, String) -> Unit)? = null
 ) : BaseListViewHolder(itemView) {
 
     fun currencyFormat(amount: Double): String? {
@@ -43,14 +43,17 @@ class ReportBettingViewHolder(
         }
 
         if (item is StatementBetting) {
-            tvId.text = "#" + item.no
+            tvId.text = item.moduleName
 
             var datetime = item.date.split(" ")
             var time = datetime[1]
             var date = datetime[0]
             tvPayout.text = date + System.getProperty("line.separator") + time
 
-            if (item.winLose > 0) {
+            var amountWin = 0.0
+            if (item.amountWin != null) amountWin = item.amountWin
+
+            if (item.amountWin != null && item.amountWin > 0) {
                 tvBetAmount.setTextColor(Color.parseColor("#303F9F"))
                 tvBetAmount.setTypeface(null, Typeface.BOLD)
 
@@ -64,10 +67,10 @@ class ReportBettingViewHolder(
                 tvCast.setTypeface(null, Typeface.BOLD)
             }
 
-            tvWinLost.text = "លម្អិត"
-            tvWinLost.setSafeOnClickListener {
+            tvWinLost.text = "${item.no}/${item.group}"
+            tvId.setSafeOnClickListener {
                 it.btnClick().subscribe {
-                    detailButtonListener?.invoke(item.id, item.no.toString())
+                    detailButtonListener?.invoke(item.moduleBetId, item.no.toString(), item.moduleName)
                 }
             }
 
@@ -76,15 +79,15 @@ class ReportBettingViewHolder(
             when (user.currencyType) {
                 1 -> {//dollar
                     tvBetType.text = "${currencyFormat(item.amount!!)} $"
-                    tvBetAmount.text = "${currencyFormat(item.winLose)} $"
+                    tvBetAmount.text = "${currencyFormat(amountWin)} $"
                 }
                 2 -> {//riel
                     tvBetType.text = "${currencyFormat(item.amount!!)} ៛"
-                    tvBetAmount.text = "${currencyFormat(item.winLose)} ៛"
+                    tvBetAmount.text = "${currencyFormat(amountWin)} ៛"
                 }
                 3 -> {//baht
                     tvBetType.text = "${currencyFormat(item.amount!!)} ฿"
-                    tvBetAmount.text = "${currencyFormat(item.winLose)} ฿"
+                    tvBetAmount.text = "${currencyFormat(amountWin)} ฿"
                 }
             }
         }

+ 2 - 2
app/src/main/res/layout/layout_betting_header.xml

@@ -167,7 +167,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="center"
-            android:text="@string/date"
+            android:text="@string/group"
             android:textColor="@color/color_black"
             android:textSize="12sp"
             android:textStyle="bold" />
@@ -177,7 +177,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="center"
-            android:text="@string/detail"
+            android:text="@string/date"
             android:textColor="@color/color_black"
             android:textSize="12sp"
             android:textStyle="bold" />

+ 9 - 9
app/src/main/res/layout/layout_betting_statement.xml

@@ -23,9 +23,10 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
+                android:background="@color/color_blue_800"
                 android:gravity="center"
                 android:padding="2dp"
-                android:textColor="@color/text_black"
+                android:textColor="@color/color_white"
                 android:textSize="12sp"
                 tools:text="13540" />
         </LinearLayout>
@@ -62,26 +63,25 @@
             tools:text="1Kx2.3=0" />
 
         <TextView
-            android:id="@+id/tv_payout"
+            android:id="@+id/tv_win_lose"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:gravity="center"
-            android:textColor="@color/color_black"
+            android:padding="2dp"
+            android:textColor="@color/text_black"
             android:textSize="12sp"
-            tools:text="15-09-2022" />
+            tools:text="@string/detail" />
 
         <TextView
-            android:id="@+id/tv_win_lose"
+            android:id="@+id/tv_payout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:background="@color/color_blue_800"
             android:gravity="center"
-            android:padding="2dp"
-            android:textColor="@color/color_white"
+            android:textColor="@color/color_black"
             android:textSize="12sp"
-            tools:text="@string/detail" />
+            tools:text="15-09-2022" />
 
     </LinearLayout>
 

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -60,4 +60,5 @@
     <string name="bet">ចាក់</string>
     <string name="cast">សងត្រឡប់</string>
     <string name="total_cast">សរុបសងត្រឡប់</string>
+    <string name="group">លេខហ្គេម/ក្រុម</string>
 </resources>