v1.13: drop session marker, single-color weekly marker, weekday reset
- Remove the pace marker from the 5-hour (session) bar entirely.
- Weekly bar marker is now a single color (white), no green→purple tiers.
- Marker is a clean rounded tick; removed the white-halo/tier styling.
- Remove the '% over/under pace' text everywhere (widget + app).
- Weekly reset label now shows the weekday ('Resets Friday 3:00 PM'),
never 'tomorrow'.
versionCode 14 / versionName 1.13. Includes rebuilt signed release APK.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -113,31 +113,28 @@ class MainActivity : AppCompatActivity() {
|
||||
else
|
||||
"Off-peak · ${peak.windowLabel}"
|
||||
|
||||
// ── Session (5-hour) bar + pace ──────────────────────────────────────
|
||||
val sessionPct = data.progressPercent
|
||||
val sessionPace = if (data.fiveHourUtilization >= 0f)
|
||||
PaceCalc.compute(data.fiveHourUtilization, data.utilizationResetAtEpoch, PaceCalc.SESSION_WINDOW_MS)
|
||||
else null
|
||||
// ── Session (5-hour) bar — no pace marker ────────────────────────────
|
||||
binding.barSession.setImageBitmap(
|
||||
BarRenderer.render(sessionPct, sessionPace?.markerPct, SESSION_FILL, sessionPace?.tierColor)
|
||||
BarRenderer.render(data.progressPercent, null, SESSION_FILL, null)
|
||||
)
|
||||
binding.tvSessionPace.text = paceSentence(data.fiveHourUtilization, sessionPace)
|
||||
|
||||
// ── Weekly (7-day) bar + pace ────────────────────────────────────────
|
||||
// ── Weekly (7-day) bar — single-color pace marker ────────────────────
|
||||
if (data.weeklyUtilization >= 0f) {
|
||||
val wPct = data.weeklyUtilization.toInt()
|
||||
val weeklyPace = PaceCalc.compute(data.weeklyUtilization, data.weeklyResetAtEpoch, PaceCalc.WEEKLY_WINDOW_MS)
|
||||
binding.barWeekly.setImageBitmap(
|
||||
BarRenderer.render(wPct, weeklyPace?.markerPct, WEEKLY_FILL, weeklyPace?.tierColor)
|
||||
BarRenderer.render(wPct, weeklyPace?.markerPct, WEEKLY_FILL, if (weeklyPace != null) MARKER_COLOR else null)
|
||||
)
|
||||
binding.tvWeeklyUsage.text = "$wPct% this week"
|
||||
binding.tvWeeklyPace.text = paceSentence(data.weeklyUtilization, weeklyPace)
|
||||
} else {
|
||||
binding.barWeekly.setImageBitmap(BarRenderer.render(0, null, WEEKLY_FILL, null))
|
||||
binding.tvWeeklyUsage.text = "—"
|
||||
binding.tvWeeklyPace.text = ""
|
||||
}
|
||||
|
||||
// Pace text removed per design — bars carry the signal.
|
||||
binding.tvSessionPace.visibility = View.GONE
|
||||
binding.tvWeeklyPace.visibility = View.GONE
|
||||
|
||||
binding.tvUsage.text = when {
|
||||
data.fiveHourUtilization >= 0f -> {
|
||||
val pct = data.fiveHourUtilization.toInt()
|
||||
@@ -153,7 +150,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
binding.tvReset.text = formatReset(data.effectiveResetEpoch)
|
||||
binding.tvWeeklyReset.text = formatReset(data.weeklyResetAtEpoch)
|
||||
binding.tvWeeklyReset.text = formatResetDay(data.weeklyResetAtEpoch)
|
||||
binding.tvUpdated.text = if (data.lastUpdated > 0)
|
||||
"Last updated: ${SimpleDateFormat("h:mm a, MMM d", Locale.US).format(Date(data.lastUpdated))}"
|
||||
else ""
|
||||
@@ -162,12 +159,6 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.tvError.visibility = if (data.errorMessage.isNotBlank()) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
/** "20% over pace · will likely hit limit" — empty when no projection is available yet. */
|
||||
private fun paceSentence(usedPct: Float, pace: PaceCalc.Pace?): String {
|
||||
if (pace == null) return ""
|
||||
return "${PaceCalc.shortTag(usedPct, pace)} · ${pace.label}"
|
||||
}
|
||||
|
||||
private fun formatReset(epochMs: Long): String {
|
||||
if (epochMs <= 0) return ""
|
||||
val now = System.currentTimeMillis()
|
||||
@@ -181,9 +172,19 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
/** Weekly reset shown with the weekday name ("Resets Friday 3:00 PM"), never "tomorrow". */
|
||||
private fun formatResetDay(epochMs: Long): String {
|
||||
if (epochMs <= 0) return ""
|
||||
if (epochMs <= System.currentTimeMillis()) return "Resets soon"
|
||||
val day = SimpleDateFormat("EEEE", Locale.US).format(Date(epochMs))
|
||||
val timeStr = SimpleDateFormat("h:mm a", Locale.US).format(Date(epochMs))
|
||||
return "Resets $day $timeStr"
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val SESSION_FILL = 0xFFCC785C.toInt()
|
||||
private const val WEEKLY_FILL = 0xFF7B8FCC.toInt()
|
||||
private const val MARKER_COLOR = 0xFFFFFFFF.toInt() // single-color weekly pace marker
|
||||
private const val PEAK_ON = 0xFFCC785C.toInt()
|
||||
private const val PEAK_OFF = 0xFF666666.toInt()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user