|
|
|
|
@ -112,26 +112,34 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
val chipCircle = config.chipCircle(i) |
|
|
|
|
this.fillPaint.color = context.getColor(R.color.green) |
|
|
|
|
canvas.drawCircle(chipCircle.x, chipCircle.y, chipCircle.radius, this.fillPaint) |
|
|
|
|
this.chipBorderPaint.color = context.getColor(R.color.white) |
|
|
|
|
val chipBorderStrokeWidth = chipCircle.radius / 3f |
|
|
|
|
this.chipBorderPaint.strokeWidth = chipBorderStrokeWidth |
|
|
|
|
|
|
|
|
|
chipBorderPaint.pathEffect = DashPathEffect(floatArrayOf(chipCircle.radius * 0.6f, chipCircle.radius * 0.44f), 0f) |
|
|
|
|
canvas.drawCircle(chipCircle.x, chipCircle.y, chipCircle.radius - chipBorderStrokeWidth / 2, this.chipBorderPaint) |
|
|
|
|
|
|
|
|
|
val chipText = config.chipText(i) |
|
|
|
|
this.textPaint.textSize = chipText.fontSize |
|
|
|
|
this.textPaint.color = context.getColor(R.color.white) |
|
|
|
|
canvas.drawText("2000", chipText.x, chipText.y, this.textPaint) |
|
|
|
|
drawChip(2000.0, chipText, chipCircle, canvas, context) |
|
|
|
|
|
|
|
|
|
drawStreet(Street.RIVER, config, canvas, context) |
|
|
|
|
|
|
|
|
|
drawPot(100.0, 200.0, config, canvas, context) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun drawChip(amount: Double, chipText: ReplayerConfiguration.TextPoint, chipCircle: ReplayerConfiguration.Circle, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
this.fillPaint.color = context.getColor(R.color.green) |
|
|
|
|
canvas.drawCircle(chipCircle.x, chipCircle.y, chipCircle.radius, this.fillPaint) |
|
|
|
|
this.chipBorderPaint.color = context.getColor(R.color.white) |
|
|
|
|
val chipBorderStrokeWidth = chipCircle.radius / 3f |
|
|
|
|
this.chipBorderPaint.strokeWidth = chipBorderStrokeWidth |
|
|
|
|
|
|
|
|
|
chipBorderPaint.pathEffect = DashPathEffect(floatArrayOf(chipCircle.radius * 0.6f, chipCircle.radius * 0.44f), 0f) |
|
|
|
|
canvas.drawCircle(chipCircle.x, chipCircle.y, chipCircle.radius - chipBorderStrokeWidth / 2, this.chipBorderPaint) |
|
|
|
|
|
|
|
|
|
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 drawCards(playerIndex: Int, config: ReplayerConfiguration, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
val playerSetup = config.handHistory.playerSetupForPosition(playerIndex) |
|
|
|
|
@ -235,8 +243,13 @@ class TableDrawer(bitmap: Bitmap) : Canvas(bitmap) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//////// |
|
|
|
|
fun setPot(pot: Double, totalPot: Double) { |
|
|
|
|
fun drawPot(pot: Double, totalPot: Double, config: ReplayerConfiguration, canvas: Canvas, context: Context) { |
|
|
|
|
|
|
|
|
|
drawChip(pot, config.potTextPoint, config.potChipCircle, canvas, context) |
|
|
|
|
val tpTextPoint = config.totalPotTextPoint |
|
|
|
|
this.textPaint.textSize = tpTextPoint.fontSize |
|
|
|
|
this.textPaint.color = context.getColor(R.color.white) |
|
|
|
|
canvas.drawText(totalPot.formatted, config.totalPotTextPoint.x, config.totalPotTextPoint.y, this.textPaint) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|