fix(map): make the filter panel scroll, and tighten it up

The panel is taller than a phone screen, and it was a LinearLayout
child with WRAP_CONTENT and no weight - so the excess was simply
clipped at the bottom edge. Everything from the accuracy multiplier
down was unreachable, which is where Apply, Reset, Export Raw and
Export Normalized had gone. Nothing was missing from the build; it
was drawn off-screen.

Wrap it in a ScrollView carrying the layout weight, so it shares the
screen with the map and scrolls to the rest. setFiltersExpanded now
hides the scroller rather than the panel inside it, or the collapsed
state would leave an empty scroller holding half the screen.

Then cut roughly 145dp of height out of the panel so most of it fits
without scrolling at all: the threshold readout goes from five lines
to two, the normalization summary from six to two (the level and
percentage are already on the line above it), button rows 48dp ->
40dp, the slider 42dp -> 28dp, and the section labels and paddings
lose a few dp each.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
n0tst3v3
2026-08-19 09:27:12 -06:00
co-authored by Claude Opus 5
parent 5d98f474ae
commit 655b01be50
@@ -31,6 +31,7 @@ private float phoneHeading;
private boolean mapReady; private boolean mapReady;
private LinearLayout filterPanel; private LinearLayout filterPanel;
private ScrollView filterScroll;
private TextView filterHeader; private TextView filterHeader;
private boolean filtersExpanded = false; private boolean filtersExpanded = false;
@@ -211,10 +212,10 @@ protected void onCreate(Bundle state) {
); );
filterPanel.setPadding( filterPanel.setPadding(
dp(10), dp(8),
dp(6), dp(2),
dp(10), dp(8),
dp(8) dp(4)
); );
filterPanel.setBackgroundColor( filterPanel.setBackgroundColor(
@@ -223,11 +224,34 @@ protected void onCreate(Bundle state) {
buildFilterPanel(); buildFilterPanel();
root.addView( /*
* The panel is taller than the screen on a phone, and a LinearLayout
* child with WRAP_CONTENT and no weight simply gets clipped at the
* bottom edge -- which is where Apply/Reset and both Export buttons
* were disappearing to. Inside a ScrollView with a weight it shares
* the screen with the map and scrolls to reach the rest.
*/
filterScroll =
new ScrollView(this);
filterScroll.setBackgroundColor(
Color.WHITE
);
filterScroll.addView(
filterPanel, filterPanel,
new ScrollView.LayoutParams(
ScrollView.LayoutParams.MATCH_PARENT,
ScrollView.LayoutParams.WRAP_CONTENT
)
);
root.addView(
filterScroll,
new LinearLayout.LayoutParams( new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT 0,
1
) )
); );
@@ -652,14 +676,14 @@ private void buildFilterPanel() {
normalizationSeekBar, normalizationSeekBar,
new LinearLayout.LayoutParams( new LinearLayout.LayoutParams(
-1, -1,
dp(42) dp(28)
) )
); );
normalizationValueText = normalizationValueText =
new TextView(this); new TextView(this);
normalizationValueText.setTextSize(13); normalizationValueText.setTextSize(12);
normalizationValueText.setTextColor( normalizationValueText.setTextColor(
Color.DKGRAY Color.DKGRAY
); );
@@ -668,7 +692,7 @@ private void buildFilterPanel() {
dp(4), dp(4),
dp(0), dp(0),
dp(4), dp(4),
dp(6) dp(2)
); );
filterPanel.addView( filterPanel.addView(
@@ -685,9 +709,9 @@ private void buildFilterPanel() {
normalizationStatsText.setPadding( normalizationStatsText.setPadding(
dp(4), dp(4),
dp(2), dp(1),
dp(4), dp(4),
dp(8) dp(4)
); );
filterPanel.addView( filterPanel.addView(
@@ -1002,23 +1026,20 @@ private void updateNormalizationControls() {
); );
normalizationStatsText.setText( normalizationStatsText.setText(
"Current thresholds:\n" + "Max speed " +
"Maximum movement speed: " +
MapFormat.number( MapFormat.number(
normalizer.maxSpeedKmh() normalizer.maxSpeedKmh()
) + ) +
" km/h\n" + " km/h • duplicate " +
"Duplicate tolerance: " +
MapFormat.number( MapFormat.number(
normalizer.duplicateDistance() normalizer.duplicateDistance()
) + ) +
" m\n" + " m\n" +
"Same-time tolerance: " + "Same-time " +
MapFormat.number( MapFormat.number(
normalizer.sameTimeDistance() normalizer.sameTimeDistance()
) + ) +
" m\n" + " m • accuracy ×" +
"GPS accuracy multiplier: " +
MapFormat.number( MapFormat.number(
normalizer.accuracyMultiplier() normalizer.accuracyMultiplier()
) )
@@ -1036,7 +1057,10 @@ private void setFiltersExpanded(
filtersExpanded = expanded; filtersExpanded = expanded;
filterPanel.setVisibility( // The ScrollView is the child with the layout weight, so it is the one
// that has to go away -- hiding the panel inside it would leave the
// empty scroller still holding half the screen.
filterScroll.setVisibility(
expanded expanded
? View.VISIBLE ? View.VISIBLE
: View.GONE : View.GONE
@@ -1056,14 +1080,14 @@ private TextView filterLabel(
new TextView(this); new TextView(this);
label.setText(text); label.setText(text);
label.setTextSize(14); label.setTextSize(13);
label.setTextColor(Color.DKGRAY); label.setTextColor(Color.DKGRAY);
label.setPadding( label.setPadding(
dp(2), dp(2),
dp(6), dp(3),
dp(2), dp(2),
dp(2) dp(1)
); );
return label; return label;
@@ -1085,7 +1109,7 @@ private LinearLayout.LayoutParams weightParams() {
return new LinearLayout.LayoutParams( return new LinearLayout.LayoutParams(
0, 0,
dp(48), dp(40),
1 1
); );
} }
@@ -1362,28 +1386,23 @@ private void updateNormalizationSummary() {
if (normalizationStatsText == null) if (normalizationStatsText == null)
return; return;
// The level and the slider percentage are already on the line above
// this one, so the summary only carries what normalization actually did.
normalizationStatsText.setText( normalizationStatsText.setText(
"Level: " + "Kept " +
normalizer.levelName() + normalizer.retainedCount() +
" (" + " of " +
normalizer.getAggressiveness() + normalizer.examinedCount() +
"%)\n" + " points • max " +
"Maximum movement speed: " +
MapFormat.number( MapFormat.number(
normalizer.maxSpeedKmh() normalizer.maxSpeedKmh()
) + ) +
" km/h\n" + " km/h\n" +
"Raw points examined: " + "Removed " +
normalizer.examinedCount() +
"\n" +
"Points retained: " +
normalizer.retainedCount() +
"\n" +
"Duplicates suppressed: " +
normalizer.duplicateCount() + normalizer.duplicateCount() +
"\n" + " duplicate • " +
"GPS jumps rejected: " + normalizer.rejectedCount() +
normalizer.rejectedCount() " GPS jump"
); );
} }