From 0f01b836c62393f90bb167216507f15974588c24 Mon Sep 17 00:00:00 2001 From: n0tst3v3 Date: Wed, 19 Aug 2026 09:39:38 -0600 Subject: [PATCH] fix(map): un-clip the date buttons, link every popup's coordinates Date/time buttons carry a two-line label ("From\nAug 19, 2026") but sat in a fixed dp(40) row, so the date line was cut off and only From/To was readable. My own compaction pass tightened that row from 48dp to 40dp and made it worse. They now measure wrap-content, at 11sp, with all-caps off (Buttons upper-case by default, which is what pushed the date past the edge) and 4dp side padding instead of the stock ~16dp. Historical, normalized and removed points now render their coordinates as the same tappable geo: link the live device popup already used - MapActivity's WebViewClient hands geo: to the maps app, so all four popups behave the same. Factored into gpsLink(). Drops the "View: Normalized" line from the device popup; the filter panel already says which view is active. Co-Authored-By: Claude Opus 5 --- .../com/wytehat/btlogger/MapActivity.java | 46 +++++++++++++++---- .../com/wytehat/btlogger/MapHtmlBuilder.java | 45 +++++++++--------- 2 files changed, 59 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/wytehat/btlogger/MapActivity.java b/app/src/main/java/com/wytehat/btlogger/MapActivity.java index 3fce641..368809b 100644 --- a/app/src/main/java/com/wytehat/btlogger/MapActivity.java +++ b/app/src/main/java/com/wytehat/btlogger/MapActivity.java @@ -511,12 +511,12 @@ private void buildFilterPanel() { row1.addView( startDateButton, - weightParams() + tallWeightParams() ); row1.addView( endDateButton, - weightParams() + tallWeightParams() ); filterPanel.addView(row1); @@ -536,12 +536,12 @@ private void buildFilterPanel() { row2.addView( startTimeButton, - weightParams() + tallWeightParams() ); row2.addView( endTimeButton, - weightParams() + tallWeightParams() ); filterPanel.addView(row2); @@ -1103,13 +1103,28 @@ private TextView filterLabel( private Button makeFilterButton( String text) { - Button button = - new Button(this); + Button button = + new Button(this); - button.setText(text); - button.setTextSize(13); + button.setText(text); + button.setTextSize(11); - return button; + /* + * These carry a two-line label ("From\nAug 19, 2026"). Buttons + * upper-case their text by default, which is what pushed the date + * past the edge, and the stock horizontal padding costs another + * ~32dp of the half-width the button actually gets. + */ + button.setTransformationMethod(null); + + button.setPadding( + dp(4), + dp(2), + dp(4), + dp(2) + ); + + return button; } private LinearLayout.LayoutParams weightParams() { @@ -1121,6 +1136,19 @@ private LinearLayout.LayoutParams weightParams() { ); } +/** + * Equal width, but tall enough for the text it holds -- the date and + * time buttons carry two lines and a fixed height clips the second. + */ +private LinearLayout.LayoutParams tallWeightParams() { + + return new LinearLayout.LayoutParams( + 0, + LinearLayout.LayoutParams.WRAP_CONTENT, + 1 + ); +} + private void showDatePicker( final boolean start) { diff --git a/app/src/main/java/com/wytehat/btlogger/MapHtmlBuilder.java b/app/src/main/java/com/wytehat/btlogger/MapHtmlBuilder.java index 625cb75..59a6a2b 100644 --- a/app/src/main/java/com/wytehat/btlogger/MapHtmlBuilder.java +++ b/app/src/main/java/com/wytehat/btlogger/MapHtmlBuilder.java @@ -304,6 +304,21 @@ public final class MapHtmlBuilder { // Popups // ------------------------------------------------------------------ + /** + * Coordinates as a tappable geo: link. MapActivity's WebViewClient + * intercepts geo: and hands it to the maps app, so every popup that + * shows a position should use this rather than plain text. + */ + private static String gpsLink(double latitude, double longitude) { + + return "GPS: " + + latitude + ", " + longitude + + ""; + } + private static String devicePopup( DeviceRecord record, double latitude, @@ -325,19 +340,7 @@ public final class MapHtmlBuilder { .append(MapFormat.htmlText(record.displayName())) .append("
"); - html.append("GPS: ") - .append(latitude) - .append(", ") - .append(longitude) - .append(""); + html.append(gpsLink(latitude, longitude)); if (record.accuracy > 0) { @@ -393,8 +396,6 @@ public final class MapHtmlBuilder { if (options.normalizedMode) { - html.append("
View: Normalized"); - html.append("
Normalization: ") .append(MapFormat.htmlText( HistoryNormalizer.levelName(options.aggressiveness))); @@ -426,10 +427,10 @@ public final class MapHtmlBuilder { .append(MapFormat.htmlText(MapFormat.date(time))); } - html.append("
GPS: ") - .append(decision.point.latitude) - .append(", ") - .append(decision.point.longitude); + html.append("
") + .append(gpsLink( + decision.point.latitude, + decision.point.longitude)); html.append("
Distance from previous accepted point: ") .append(MapFormat.number(decision.distanceMeters)) @@ -499,10 +500,8 @@ public final class MapHtmlBuilder { .append(MapFormat.htmlText(MapFormat.date(time))); } - html.append("
GPS: ") - .append(point.latitude) - .append(", ") - .append(point.longitude); + html.append("
") + .append(gpsLink(point.latitude, point.longitude)); double accuracy = HistoryNormalizer.pointDouble(point, "accuracy", -1);