|
|
|
@ -5,11 +5,9 @@ import android.util.AttributeSet |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.widget.FrameLayout |
|
|
|
import android.widget.FrameLayout |
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout |
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout |
|
|
|
import io.realm.Realm |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.row_hand_history_view.view.* |
|
|
|
import kotlinx.android.synthetic.main.row_hand_history_view.view.* |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.model.handhistory.Street |
|
|
|
import net.pokeranalytics.android.model.handhistory.Street |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.Card |
|
|
|
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
|
|
|
|
|
|
|
|
@ -52,38 +50,36 @@ class HandHistoryRowView : FrameLayout { |
|
|
|
|
|
|
|
|
|
|
|
rowHandHistory.cardsLayout.removeAllViews() |
|
|
|
rowHandHistory.cardsLayout.removeAllViews() |
|
|
|
|
|
|
|
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
handHistory.cardViews(context, rowHandHistory.cardsLayout).forEach { view -> |
|
|
|
realm.executeTransaction { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val list = listOf(Card.newInstance(it, null, Card.Suit.CLOVER), |
|
|
|
|
|
|
|
Card.newInstance(Realm.getDefaultInstance(), 12, Card.Suit.HEART) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.forEach { card -> |
|
|
|
|
|
|
|
val view = card.view(context, LayoutInflater.from(context), rowHandHistory.cardsLayout) |
|
|
|
|
|
|
|
rowHandHistory.cardsLayout.addView(view) |
|
|
|
rowHandHistory.cardsLayout.addView(view) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LayoutInflater.from(context).inflate(R.layout.view_card_separator, rowHandHistory.cardsLayout) |
|
|
|
rowHandHistory.amount.text = handHistory.potSizeForStreet(Street.SUMMARY).formatted() |
|
|
|
|
|
|
|
|
|
|
|
val list2 = listOf(Card.newInstance(it, null, Card.Suit.CLOVER), |
|
|
|
|
|
|
|
Card.newInstance(Realm.getDefaultInstance(), 12, Card.Suit.HEART) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list2.forEach { card -> |
|
|
|
|
|
|
|
val view = card.view(context, LayoutInflater.from(context), rowHandHistory.cardsLayout) |
|
|
|
|
|
|
|
rowHandHistory.cardsLayout.addView(view) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handHistory.cardViews(context).forEach { view -> |
|
|
|
// val realm = Realm.getDefaultInstance() |
|
|
|
|
|
|
|
// realm.executeTransaction { |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// val list = listOf(Card.newInstance(it, null, Card.Suit.CLOVER), |
|
|
|
|
|
|
|
// Card.newInstance(Realm.getDefaultInstance(), 12, Card.Suit.HEART) |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// list.forEach { card -> |
|
|
|
|
|
|
|
// val view = card.view(context, LayoutInflater.from(context), rowHandHistory.cardsLayout) |
|
|
|
// rowHandHistory.cardsLayout.addView(view) |
|
|
|
// rowHandHistory.cardsLayout.addView(view) |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// |
|
|
|
rowHandHistory.amount.text = handHistory.potSizeForStreet(Street.SUMMARY).formatted() |
|
|
|
// LayoutInflater.from(context).inflate(R.layout.view_card_separator, rowHandHistory.cardsLayout) |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// val list2 = listOf(Card.newInstance(it, null, Card.Suit.CLOVER), |
|
|
|
|
|
|
|
// Card.newInstance(Realm.getDefaultInstance(), 12, Card.Suit.HEART) |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// list2.forEach { card -> |
|
|
|
|
|
|
|
// val view = card.view(context, LayoutInflater.from(context), rowHandHistory.cardsLayout) |
|
|
|
|
|
|
|
// rowHandHistory.cardsLayout.addView(view) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// Date |
|
|
|
// Date |
|
|
|
// rowHandHistory.transactionDateDay.text = handHistory.date.getShortDayName() |
|
|
|
// rowHandHistory.transactionDateDay.text = handHistory.date.getShortDayName() |
|
|
|
|