✨ Draw the hit timer chart with Grafima - #1125
Open
LeoColman wants to merge 1 commit into
Open
Conversation
Moves the last chart off GraphView, so com.jjoe64 leaves the project altogether: the dependency, its bundle and its licensee exception are all gone. MPAndroidChart stays for the three Stats charts. Two things the swap needed that were not obvious: Grafima animates, and GraphView did not, because it sat in an AndroidView outside Compose's clock. An animation that never settles keeps Compose busy, which stalled the timer's own recomposition and hung two ComposeHitTimerTest cases on a 20s timeout. There is no flag to turn animation off, so the specs are snapped. That is also the behaviour we want: the marker tracks a running timer, and a morph would always draw where the hold was, not where it is. The x axis labels come from each LineDataPoint's own label rather than from axisConfig's formatter, so they are rounded to whole seconds. Setting xLabelFormatter looks like it should work and does nothing. The hold markers lose their size-15 emphasis: dot radius belongs to the chart, not to a series, so colour is what separates them from the curves now. Same treatment as the withdrawal charts. Vertical gridlines are switched back on to match what GraphView drew, since reading where ten seconds falls is the point. holdPointOn and the two study series drop GraphView's DataPoint for a SubjectiveHighPoint, which has value equality, so WhyTenSecondsTest can stop comparing rendered strings. Release APK 11,076,168 -> 11,049,255 bytes (-26,913, -0.24%). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0167SJeKBmjmzhj9gNWcZYfs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the hit timer's "Why 10 seconds?" chart from GraphView to Grafima. This
was the last
com.jjoe64usage, so the dependency, its entry in thegraph-viewbundle and its licensee exception all leave with it. MPAndroidChartstays behind for the three Stats charts.
Before / after
Both at rest, so the hold markers sit at 0 seconds on each curve.
What changes visually:
than of a series, so the markers cannot be size-15 against default curve dots
any more. They are separated by colour instead, the same treatment the
withdrawal charts already use.
the three measured points rather than every 5 seconds. Grafima picks its own
tick counts.
seconds falls is the entire point of the chart.
Two things worth knowing for the next migration
Grafima animates, GraphView did not. The old chart lived in an
AndroidView,outside Compose's clock. Once the chart moved inside it, an animation that never
settles kept Compose busy, which stalled the timer's own recomposition:
ComposeHitTimerTest's "Start" and "Reset" both failed on a 20s timeout waitingfor the countdown to advance. There is no flag to disable animation, so the
specs are
snap(). That is also the behaviour we want here, since the markertracks a running timer and a morph spec would always draw where the hold was.
The x axis labels come from each
LineDataPoint's own label, not fromaxisConfig's formatter. They were rendering as10.0because the label wasseconds.toString(). SettingxLabelFormatterlooks like the fix and doesnothing at all.
Other
holdPointOnand the two study series drop GraphView'sDataPointfor aSubjectiveHighPointwith value equality, which letsWhyTenSecondsTeststopcomparing rendered strings.
Release APK 11,076,168 -> 11,049,255 bytes (-26,913, -0.24%), measured by
building both sides. Nice counterweight to the +32 KB Grafima cost in #1124.
Verification
./gradlew test detekt licenseegreenassembleFdroidReleasegreen through R8; nocom/jjoe64entries left in the APKcurves while a hold runs
The two screenshots live on the
assets/hittimer-grafimabranch so they stayout of this diff and out of
main. Delete that branch whenever this merges.🤖 Generated with Claude Code
https://claude.ai/code/session_0167SJeKBmjmzhj9gNWcZYfs