Skip to content

Commit 675cc5d

Browse files
committed
fix: compact main menu width, expand Settings for full URL
- Set PopupWindow to WRAP_CONTENT for compact main menu - Remove weight-based stretching from camera buttons - Dynamically expand popup to MATCH_PARENT when entering Settings - Shrink popup back to WRAP_CONTENT when leaving Settings - Includes all audit fixes: watchdog guard, decoderFailed, non-blocking offer, output buffer drain loop - Bump version to 1.14
1 parent 7fb740d commit 675cc5d

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

app/src/main/java/com/openipc/decoder/Decoder.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ private void createMenu(View menu) {
467467
LinearLayout layout = new LinearLayout(this);
468468
layout.setOrientation(LinearLayout.VERTICAL);
469469

470-
PopupWindow popup = new PopupWindow(layout, LinearLayout.LayoutParams.MATCH_PARENT,
470+
// compact width for the main menu; expanded to full screen in Settings mode
471+
PopupWindow popup = new PopupWindow(layout, LinearLayout.LayoutParams.WRAP_CONTENT,
471472
LinearLayout.LayoutParams.WRAP_CONTENT, true);
472473
popup.showAtLocation(menu, Gravity.TOP | Gravity.START, 0, 0);
473474

@@ -521,7 +522,8 @@ private void createMenu(View menu) {
521522
camButtons[i].setGravity(Gravity.CENTER);
522523
camButtons[i].setPadding(dp(4), dp(4), dp(4), dp(4));
523524
camRow.addView(camButtons[i], new LinearLayout.LayoutParams(
524-
0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f));
525+
LinearLayout.LayoutParams.WRAP_CONTENT,
526+
LinearLayout.LayoutParams.WRAP_CONTENT));
525527

526528
if (i == mActive) highlightItem(camButtons[i]);
527529

@@ -628,14 +630,18 @@ private void createMenu(View menu) {
628630
exit.setOnClickListener(v -> finishAndRemoveTask());
629631

630632
settings.setOnClickListener(v -> {
631-
boolean show = header.getVisibility() == View.VISIBLE;
632-
header.setVisibility(show ? View.GONE : View.VISIBLE);
633-
settings.setVisibility(show ? View.VISIBLE : View.GONE);
634-
camRow.setVisibility(show ? View.VISIBLE : View.GONE);
635-
webui.setVisibility(show ? View.VISIBLE : View.GONE);
636-
carouselToggle.setVisibility(show ? View.VISIBLE : View.GONE);
633+
boolean closing = header.getVisibility() == View.VISIBLE;
634+
header.setVisibility(closing ? View.GONE : View.VISIBLE);
635+
settings.setVisibility(closing ? View.VISIBLE : View.GONE);
636+
camRow.setVisibility(closing ? View.VISIBLE : View.GONE);
637+
webui.setVisibility(closing ? View.VISIBLE : View.GONE);
638+
carouselToggle.setVisibility(closing ? View.VISIBLE : View.GONE);
637639
carouselPanel.setVisibility(View.GONE);
638-
exit.setVisibility(show ? View.VISIBLE : View.GONE);
640+
exit.setVisibility(closing ? View.VISIBLE : View.GONE);
641+
// expand to full width for the URL field; shrink back for the main menu
642+
popup.update(closing ? LinearLayout.LayoutParams.WRAP_CONTENT
643+
: LinearLayout.LayoutParams.MATCH_PARENT,
644+
LinearLayout.LayoutParams.WRAP_CONTENT);
639645
});
640646
}
641647

0 commit comments

Comments
 (0)