Skip to content

Commit 0c2ab4f

Browse files
committed
fix: align menu items width consistently
- revert popup to WRAP_CONTENT so all items share natural width - set minWidth on URL EditText to ensure adequate space
1 parent 62734e2 commit 0c2ab4f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ private void createMenu(View menu) {
356356
LinearLayout layout = new LinearLayout(this);
357357
layout.setOrientation(LinearLayout.VERTICAL);
358358

359-
int menuWidth = (int) (getResources().getDisplayMetrics().widthPixels * 0.5);
360-
PopupWindow popup = new PopupWindow(layout, menuWidth,
359+
PopupWindow popup = new PopupWindow(layout, LinearLayout.LayoutParams.WRAP_CONTENT,
361360
LinearLayout.LayoutParams.WRAP_CONTENT, true);
362361
popup.showAtLocation(menu, Gravity.TOP | Gravity.START, 0, 0);
363362

@@ -485,6 +484,7 @@ private EditText createEdit(String title) {
485484
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
486485
text.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
487486
text.setSingleLine(true);
487+
text.setMinWidth(dp(250));
488488
text.setImeOptions(EditorInfo.IME_ACTION_DONE);
489489
text.setSelection(text.getText().length());
490490
focusChange(text);

0 commit comments

Comments
 (0)