|
|
|
|
@ -11,7 +11,6 @@ import net.pokeranalytics.android.model.realm.handhistory.Card |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.ComputedAction |
|
|
|
|
import net.pokeranalytics.android.util.RANDOM_PLAYER |
|
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
|
|
data class ChipColor(val fillColor: Int, val borderColor: Int) { |
|
|
|
|
companion object { |
|
|
|
|
@ -153,7 +152,15 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
when (config.currentStep) { |
|
|
|
|
is Street -> { |
|
|
|
|
when (config.frameType) { |
|
|
|
|
ReplayerConfiguration.FrameType.STATE -> {} |
|
|
|
|
ReplayerConfiguration.FrameType.STATE -> { |
|
|
|
|
if (config.currentStep == Street.SUMMARY) { |
|
|
|
|
val amount = 666.0 |
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
drawChipText(amount, config.chipText(i), canvas, context) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ReplayerConfiguration.FrameType.GATHER_ANIMATION -> { |
|
|
|
|
lastCommittedAmount(i, config)?.let { amount -> |
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
@ -162,13 +169,19 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ReplayerConfiguration.FrameType.DISTRIBUTION_ANIMATION -> { |
|
|
|
|
Timber.d("won pots = ${config.handHistory.winnerPots}") |
|
|
|
|
val winnerPots = config.handHistory.winnerPots.firstOrNull { it.position == i } |
|
|
|
|
winnerPots?.let { pot -> |
|
|
|
|
val color = colorForAmount(pot.amount) |
|
|
|
|
val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
} |
|
|
|
|
val amount = 666.0 |
|
|
|
|
|
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
drawChipCircle(circle, color, canvas, context) |
|
|
|
|
|
|
|
|
|
// Timber.d("won pots = ${config.handHistory.winnerPots}") |
|
|
|
|
// val winnerPots = config.handHistory.winnerPots.firstOrNull { it.position == i } |
|
|
|
|
// winnerPots?.let { pot -> |
|
|
|
|
// val color = colorForAmount(pot.amount) |
|
|
|
|
// val circle = config.animatedChipCircleFromPot(i) |
|
|
|
|
// drawChipCircle(circle, color, canvas, context) |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -256,14 +269,15 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun drawChip(amount: Double, chipText: ReplayerConfiguration.TextPoint, chipCircle: ReplayerConfiguration.Circle, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
val color = colorForAmount(amount) |
|
|
|
|
drawChipCircle(chipCircle, color, canvas, context) |
|
|
|
|
drawChipText(amount, chipText, canvas, context) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun drawChipText(amount: Double, chipText: ReplayerConfiguration.TextPoint, canvas: Canvas, context: Context) { |
|
|
|
|
this.textPaint.textSize = chipText.fontSize |
|
|
|
|
this.textPaint.color = context.getColor(R.color.white) |
|
|
|
|
canvas.drawText(amount.formatted, chipText.x, chipText.y, this.textPaint) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun colorForAmount(amount: Double): ChipColor { |
|
|
|
|
|