From dc63fffb6787f37781087caad11a1ac0d093917c Mon Sep 17 00:00:00 2001 From: n0tst3v3 Date: Wed, 19 Aug 2026 00:50:25 -0600 Subject: [PATCH] fix(map): make filter panel compact and scrollable --- .../com/wytehat/btlogger/MapActivity.java | 80 +++++++++++-------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/wytehat/btlogger/MapActivity.java b/app/src/main/java/com/wytehat/btlogger/MapActivity.java index c35f08f..2d63920 100644 --- a/app/src/main/java/com/wytehat/btlogger/MapActivity.java +++ b/app/src/main/java/com/wytehat/btlogger/MapActivity.java @@ -22,6 +22,7 @@ import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.LinearLayout; +import android.widget.ScrollView; import android.widget.Spinner; import android.widget.TextView; @@ -48,6 +49,8 @@ implements SensorEventListener { private LinearLayout filterPanel; + private ScrollView filterScroll; + private Spinner categorySpinner; private Spinner deviceSpinner; @@ -207,7 +210,6 @@ implements SensorEventListener { dp(4) ); - filterPanel.setVisibility(View.GONE); /* * Category. @@ -387,13 +389,30 @@ implements SensorEventListener { filterPanel.addView(showAll); - root.addView( - filterPanel, - new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT - ) - ); + /* + * Bounded to a third of the screen and scrollable, so every + * control stays reachable on short screens. + */ + filterScroll = new ScrollView(this); + + filterScroll.setVisibility(View.GONE); + + filterScroll.addView( + filterPanel, + new android.widget.FrameLayout.LayoutParams( + android.widget.FrameLayout.LayoutParams.MATCH_PARENT, + android.widget.FrameLayout.LayoutParams.WRAP_CONTENT + ) + ); + + root.addView( + filterScroll, + new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + 0, + 1 + ) + ); /* * WebView map. @@ -436,13 +455,13 @@ implements SensorEventListener { } ); - root.addView( - web, - new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - 0, - 1 - ) + root.addView( + web, + new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + 0, + 2 + ) ); setContentView(root); @@ -476,19 +495,12 @@ implements SensorEventListener { @Override public void onClick(View view) { - if (filterPanel.getVisibility() - == View.VISIBLE) { - - filterPanel.setVisibility( - View.GONE - ); - - } else { - - filterPanel.setVisibility( - View.VISIBLE - ); - } + filterScroll.setVisibility( + filterScroll.getVisibility() + == View.VISIBLE + ? View.GONE + : View.VISIBLE + ); } } ); @@ -646,8 +658,8 @@ implements SensorEventListener { /* * Collapse after applying. */ - filterPanel.setVisibility( - View.GONE + filterScroll.setVisibility( + View.GONE ); } } @@ -696,10 +708,10 @@ implements SensorEventListener { private LinearLayout.LayoutParams compactParams() { - return new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - dp(42) - ); + return new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + dp(38) + ); } private TextView smallLabel(String text) {