|
@@ -1,11 +1,10 @@
|
|
package com.khmer9.yuki.screen.detail
|
|
package com.khmer9.yuki.screen.detail
|
|
|
|
|
|
-import android.graphics.Color
|
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
import android.view.View
|
|
import android.view.View
|
|
-import androidx.core.view.isVisible
|
|
|
|
import androidx.recyclerview.widget.DefaultItemAnimator
|
|
import androidx.recyclerview.widget.DefaultItemAnimator
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
+import com.gdtlib.lib.adapter.BaseListItem
|
|
import com.khmer9.yuki.R
|
|
import com.khmer9.yuki.R
|
|
import com.khmer9.yuki.app.App
|
|
import com.khmer9.yuki.app.App
|
|
import com.khmer9.yuki.app.ShareActivity
|
|
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 sharePref: PrefHelper
|
|
private lateinit var currency: String
|
|
private lateinit var currency: String
|
|
private lateinit var betsDetailViewModel: BetsDetailViewModel
|
|
private lateinit var betsDetailViewModel: BetsDetailViewModel
|
|
|
|
+
|
|
private val ARG_PARAM1 = "INVOICE_ID"
|
|
private val ARG_PARAM1 = "INVOICE_ID"
|
|
private val ARG_PARAM2 = "no"
|
|
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?) {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
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 {
|
|
requireArguments().getString(ARG_PARAM2)?.let {
|
|
@@ -79,8 +113,8 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
|
|
}
|
|
}
|
|
|
|
|
|
private fun getCurrentBets(it: BetsDetailViewState) {
|
|
private fun getCurrentBets(it: BetsDetailViewState) {
|
|
- if (it.betDetailData?.bettingDetailList != null) {
|
|
|
|
- try {
|
|
|
|
|
|
+ if (it.betDetailData != null) {
|
|
|
|
+ /*try {
|
|
when (user.currencyType) {
|
|
when (user.currencyType) {
|
|
1 -> {//dollar
|
|
1 -> {//dollar
|
|
tv_turn_over.text = "${it.betDetailData?.totalCast} $"
|
|
tv_turn_over.text = "${it.betDetailData?.totalCast} $"
|
|
@@ -96,9 +130,9 @@ class BettingDetailFragment : BaseFragment(R.layout.betting_detail) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
- try {
|
|
|
|
|
|
+ /*try {
|
|
if (it.betDetailData?.totalAmountWin!! > 0) {
|
|
if (it.betDetailData?.totalAmountWin!! > 0) {
|
|
tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
|
|
tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
|
|
tv_total_win_lose.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) {
|
|
} catch (e: Exception) {
|
|
tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
|
|
tv_turn_over.setTextColor(Color.parseColor("#303F9F"))
|
|
tv_total_win_lose.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()
|
|
adapter.notifyDataSetChanged()
|
|
}
|
|
}
|
|
|
|
|