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:
co-authored by
Claude Opus 5
parent
be517f56a5
commit
0f01b836c6
@@ -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) {
|
||||
|
||||
|
||||
@@ -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 "<a href='geo:"
|
||||
+ latitude + "," + longitude
|
||||
+ "?q=" + latitude + "," + longitude
|
||||
+ "'>GPS: "
|
||||
+ latitude + ", " + longitude
|
||||
+ "</a>";
|
||||
}
|
||||
|
||||
private static String devicePopup(
|
||||
DeviceRecord record,
|
||||
double latitude,
|
||||
@@ -325,19 +340,7 @@ public final class MapHtmlBuilder {
|
||||
.append(MapFormat.htmlText(record.displayName()))
|
||||
.append("</b><br>");
|
||||
|
||||
html.append("<a href='geo:")
|
||||
.append(latitude)
|
||||
.append(",")
|
||||
.append(longitude)
|
||||
.append("?q=")
|
||||
.append(latitude)
|
||||
.append(",")
|
||||
.append(longitude)
|
||||
.append("'>GPS: ")
|
||||
.append(latitude)
|
||||
.append(", ")
|
||||
.append(longitude)
|
||||
.append("</a>");
|
||||
html.append(gpsLink(latitude, longitude));
|
||||
|
||||
if (record.accuracy > 0) {
|
||||
|
||||
@@ -393,8 +396,6 @@ public final class MapHtmlBuilder {
|
||||
|
||||
if (options.normalizedMode) {
|
||||
|
||||
html.append("<br><b>View: Normalized</b>");
|
||||
|
||||
html.append("<br>Normalization: ")
|
||||
.append(MapFormat.htmlText(
|
||||
HistoryNormalizer.levelName(options.aggressiveness)));
|
||||
@@ -426,10 +427,10 @@ public final class MapHtmlBuilder {
|
||||
.append(MapFormat.htmlText(MapFormat.date(time)));
|
||||
}
|
||||
|
||||
html.append("<br>GPS: ")
|
||||
.append(decision.point.latitude)
|
||||
.append(", ")
|
||||
.append(decision.point.longitude);
|
||||
html.append("<br>")
|
||||
.append(gpsLink(
|
||||
decision.point.latitude,
|
||||
decision.point.longitude));
|
||||
|
||||
html.append("<br>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("<br>GPS: ")
|
||||
.append(point.latitude)
|
||||
.append(", ")
|
||||
.append(point.longitude);
|
||||
html.append("<br>")
|
||||
.append(gpsLink(point.latitude, point.longitude));
|
||||
|
||||
double accuracy =
|
||||
HistoryNormalizer.pointDouble(point, "accuracy", -1);
|
||||
|
||||
Reference in New Issue
Block a user