Skip to content

Tmp/new charts - #6

Closed
gerhardol wants to merge 4 commits into
masterfrom
tmp/new-charts
Closed

gerhardol wants to merge 4 commits into
masterfrom
tmp/new-charts

Conversation

@gerhardol

Copy link
Copy Markdown
Owner

No description provided.

Update code with api-13 to remove deprecated calls.
(suppress for <api-33).

Support HR transmitter that do not support battery or firmware.
This occurs for instance for Garmin watches set to send HR
over bluetooth.
- Enabled depreciation warnings
No update for wear, requires som GMS updates first

- fix some gradle 10 syntax in builds.gradle and
gradle.properties

- use ivy repo for ant+ lib

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate issues affect compilation, lint, dependency resolution, formatting, and chart behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Migrates workout and heart-rate charts from GraphView to AndroidChart while modernizing BLE APIs and build configuration.

Changes:

  • Replaces graph rendering and adds chart legends and HR-zone visualization.
  • Refactors chart data and pace/velocity formatting.
  • Updates BLE APIs, dependencies, compiler settings, lint baselines, and attribution.
File summaries
File Change Final review note
wear/lint-baseline.xml Updates lint metadata. —
hrdevice/src/org/runnerup/hr/BtHRBase.java Renames Bluetooth UUID constants. —
hrdevice/src/org/runnerup/hr/AndroidBLEHRProvider.java Adds modern BLE callbacks and descriptor handling. —
hrdevice/lint-baseline.xml Updates lint metadata. —
hrdevice/build.gradle Changes ANT+ AAR resolution. Critical (1 vote): The Ivy dependency lacks a revision and fails when ANT+ is enabled; provide a valid revision.
gradle.properties Removes obsolete Gradle and Android properties. —
common/lint-baseline.xml Updates lint metadata. —
build.gradle Updates repositories, compiler settings, and Spotless. —
app/src/mapbox/org/runnerup/util/MapWrapper.java Uses preferred velocity formatting. —
app/src/main/org/runnerup/view/HRZonesBar.java Revises HR-zone sizing and rendering. Moderate (1 vote): The fallback inset can still clip labels; clamp using the actual label width.
app/src/main/org/runnerup/view/HRSettingsActivity.java Replaces the live HR graph. —
app/src/main/org/runnerup/view/AccountActivity.java Improves intent error logging. —
app/src/main/org/runnerup/util/LineGraphSeries.java Adds graph-series support. —
app/src/main/org/runnerup/util/GraphWrapper.java Replaces workout graphs with combined AndroidChart charts. Critical (1 vote): List.reversed() requires Java 21, but the project compiles with Java 17. Moderate (3 votes): Valid velocity/pace data is dropped for no-GPS activities. Moderate (2 votes): The full-height chart clips its legend, including the equivalent path at line 247. Moderate (1 vote): Elevation can retain heart-rate axis formatting.
app/src/main/org/runnerup/util/Formatter.java Refactors pace and velocity formatting. Moderate (3 votes): Pace targets are formatted incorrectly without the reciprocal conversion; use a separate m/s helper for velocity.
app/src/main/org/runnerup/util/DataPoint.java Adds a chart data-point model. —
app/res/values/dimens.xml Adds an HR chart dimension. Critical (1 vote): The dimension is unused and will trigger release lint; apply it or remove it.
app/res/layout/detail.xml Updates the graph layout container. —
app/proguard.txt Removes GraphView rules. —
app/lint-baseline.xml Updates lint metadata and findings. —
app/build.gradle Replaces the GraphView dependency. —
app/assets/about.html Updates chart-library attribution. —
Review details

Suppressed comments (3)

app/src/main/org/runnerup/util/GraphWrapper.java:247

  • The legend is inserted at index 0, so it is rendered above the chart, contradicting the comment that it should be at the bottom and changing the intended layout. Append it after the chart instead.
    graphTab.addView(scroll, 0);

app/src/main/org/runnerup/util/GraphWrapper.java:476

  • When velocity, heart rate, and elevation are all present, velocity enables the left axis and heart rate enables the right axis. Elevation then reaches this branch with the right axis already enabled, leaves axis null, and never installs its formatter, so the right-axis labels remain formatted as heart rate instead of elevation.
        dataSet.setAxisDependency(YAxis.AxisDependency.RIGHT);
        if (!chart.getAxisRight().isEnabled()) {
          axis = chart.getAxisRight();
        }

app/src/main/org/runnerup/view/HRZonesBar.java:157

  • When the percentage does not fit to the right of the bar, this fallback adds extraInsideInset to an end-aligned position. That inset is measured from a wider placeholder than the actual label, so it moves the label back to the right of the bar and can still clip it on narrow screens instead of placing it inside the bar; clamp the label using only its actual width.
      float percentInsideOffset =
          Math.max(
              barOffset + borderSize,
              barOffset + chartWidth - percentWidth - borderSize + extraInsideInset);
  • Files reviewed: 21/22 changed files
  • Comments generated: 6
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/res/values/dimens.xml
Comment thread app/src/main/org/runnerup/util/GraphWrapper.java
Comment thread hrdevice/build.gradle
return switch (dimension) {
case DISTANCE -> formatDistance(target, Math.round(value));
case TIME -> formatElapsedTime(target, Math.round(value));
case PACE -> formatPace(target, value);
Comment thread app/src/main/org/runnerup/util/GraphWrapper.java
Comment thread app/src/main/org/runnerup/util/GraphWrapper.java
@gerhardol gerhardol closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants