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 <noreply@anthropic.com>
This commit is contained in:
n0tst3v3
2026-08-19 09:39:38 -06:00
co-authored by Claude Opus 5
parent be517f56a5
commit 0f01b836c6
2 changed files with 59 additions and 32 deletions
@@ -511,12 +511,12 @@ private void buildFilterPanel() {
row1.addView( row1.addView(
startDateButton, startDateButton,
weightParams() tallWeightParams()
); );
row1.addView( row1.addView(
endDateButton, endDateButton,
weightParams() tallWeightParams()
); );
filterPanel.addView(row1); filterPanel.addView(row1);
@@ -536,12 +536,12 @@ private void buildFilterPanel() {
row2.addView( row2.addView(
startTimeButton, startTimeButton,
weightParams() tallWeightParams()
); );
row2.addView( row2.addView(
endTimeButton, endTimeButton,
weightParams() tallWeightParams()
); );
filterPanel.addView(row2); filterPanel.addView(row2);
@@ -1107,7 +1107,22 @@ private Button makeFilterButton(
new Button(this); new Button(this);
button.setText(text); button.setText(text);
button.setTextSize(13); button.setTextSize(11);
/*
* 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; return button;
} }
@@ -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( private void showDatePicker(
final boolean start) { final boolean start) {
@@ -304,6 +304,21 @@ public final class MapHtmlBuilder {
// Popups // 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 "<a href='geo:"
+ latitude + "," + longitude
+ "?q=" + latitude + "," + longitude
+ "'>GPS: "
+ latitude + ", " + longitude
+ "</a>";
}
private static String devicePopup( private static String devicePopup(
DeviceRecord record, DeviceRecord record,
double latitude, double latitude,
@@ -325,19 +340,7 @@ public final class MapHtmlBuilder {
.append(MapFormat.htmlText(record.displayName())) .append(MapFormat.htmlText(record.displayName()))
.append("</b><br>"); .append("</b><br>");
html.append("<a href='geo:") html.append(gpsLink(latitude, longitude));
.append(latitude)
.append(",")
.append(longitude)
.append("?q=")
.append(latitude)
.append(",")
.append(longitude)
.append("'>GPS: ")
.append(latitude)
.append(", ")
.append(longitude)
.append("</a>");
if (record.accuracy > 0) { if (record.accuracy > 0) {
@@ -393,8 +396,6 @@ public final class MapHtmlBuilder {
if (options.normalizedMode) { if (options.normalizedMode) {
html.append("<br><b>View: Normalized</b>");
html.append("<br>Normalization: ") html.append("<br>Normalization: ")
.append(MapFormat.htmlText( .append(MapFormat.htmlText(
HistoryNormalizer.levelName(options.aggressiveness))); HistoryNormalizer.levelName(options.aggressiveness)));
@@ -426,10 +427,10 @@ public final class MapHtmlBuilder {
.append(MapFormat.htmlText(MapFormat.date(time))); .append(MapFormat.htmlText(MapFormat.date(time)));
} }
html.append("<br>GPS: ") html.append("<br>")
.append(decision.point.latitude) .append(gpsLink(
.append(", ") decision.point.latitude,
.append(decision.point.longitude); decision.point.longitude));
html.append("<br>Distance from previous accepted point: ") html.append("<br>Distance from previous accepted point: ")
.append(MapFormat.number(decision.distanceMeters)) .append(MapFormat.number(decision.distanceMeters))
@@ -499,10 +500,8 @@ public final class MapHtmlBuilder {
.append(MapFormat.htmlText(MapFormat.date(time))); .append(MapFormat.htmlText(MapFormat.date(time)));
} }
html.append("<br>GPS: ") html.append("<br>")
.append(point.latitude) .append(gpsLink(point.latitude, point.longitude));
.append(", ")
.append(point.longitude);
double accuracy = double accuracy =
HistoryNormalizer.pointDouble(point, "accuracy", -1); HistoryNormalizer.pointDouble(point, "accuracy", -1);