Rende usabili calendario, overlay ospite e stato diretta del cartellone.

Il calendario non deve più scorrere in orizzontale, il logo a destra non copre il nome e una diretta YouTube o in collegamento compare come In diretta.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-06 09:55:08 +02:00
co-authored by Cursor
parent b09e83db09
commit c3ef8e91a6
13 changed files with 296 additions and 108 deletions
@@ -114,34 +114,38 @@ class CompactScoreboardElement : OverlayElement {
val accentColor = if (isHome) compact.homeAccentColor else compact.awayAccentColor
val logoUrl = if (isHome) compact.homeLogoUrl else compact.awayLogoUrl
val logo = OverlayLogoCache.get(logoUrl)
val rawName = if (isHome) compact.homeTeamName else compact.awayTeamName
val name = ellipsize(rawName.trim(), labelPaint, maxWidth * 0.55f)
val rawName = (if (isHome) compact.homeTeamName else compact.awayTeamName).trim()
val barHalfH = logoSize * 0.45f
val textY = centerY + labelPaint.textSize * 0.35f
if (isHome) {
var x = rectLeft
accentBarPaint.color = accentColor
canvas.drawRect(x, centerY - logoSize * 0.45f, x + barW, centerY + logoSize * 0.45f, accentBarPaint)
canvas.drawRect(x, centerY - barHalfH, x + barW, centerY + barHalfH, accentBarPaint)
x += barW + gap
if (logo != null) {
val dest = RectF(x, centerY - logoSize / 2f, x + logoSize, centerY + logoSize / 2f)
canvas.drawBitmap(logo, null, dest, logoPaint)
x += logoSize + gap
}
canvas.drawText(name, x, centerY + labelPaint.textSize * 0.35f, labelPaint)
val name = ellipsize(rawName, labelPaint, (rectRight - x).coerceAtMost(maxWidth))
canvas.drawText(name, x, textY, labelPaint)
} else {
// Specchio del lato casa: barra, logo, poi nome a sinistra del logo.
var x = rectRight
accentBarPaint.color = accentColor
canvas.drawRect(x - barW, centerY - logoSize * 0.45f, x, centerY + logoSize * 0.45f, accentBarPaint)
canvas.drawRect(x - barW, centerY - barHalfH, x, centerY + barHalfH, accentBarPaint)
x -= barW + gap
labelPaint.textAlign = Paint.Align.RIGHT
canvas.drawText(name, x, centerY + labelPaint.textSize * 0.35f, labelPaint)
labelPaint.textAlign = Paint.Align.LEFT
x -= gap
if (logo != null) {
x -= logoSize
val dest = RectF(x, centerY - logoSize / 2f, x + logoSize, centerY + logoSize / 2f)
canvas.drawBitmap(logo, null, dest, logoPaint)
x -= gap
}
val name = ellipsize(rawName, labelPaint, (x - rectLeft).coerceAtMost(maxWidth))
labelPaint.textAlign = Paint.Align.RIGHT
canvas.drawText(name, x, textY, labelPaint)
labelPaint.textAlign = Paint.Align.LEFT
}
}