Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Versions after 2.17 are `MAJOR.MINOR.PATCH` (2.17 is followed by 2.17.1 or 2.18.
`docs/testing.md`, "Versions and releases"); the headings below keep the numbers as they
were released.

## 2.27.2 — 2026-11-20

- The Settings dialog follows two brass rules it missed (#292): Cancel on the left and Save on
the right, two equal halves across the window (they were small, pressed to the left and in the
order Save, Cancel on Android TV); check boxes and radio buttons get 6dp after their text too,
so the Proto UDP text no longer touches the TCP ring and the focus frame of TCP no longer
lies on its last letter.

## 2.27.1 — 2026-11-19

- Check boxes and radio buttons of the brass dialogs show on and off under the remote's focus
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
applicationId "com.openipc.decoder"
minSdk 21
targetSdk 36
versionCode 64
versionName "2.27.1"
versionCode 65
versionName "2.27.2"
// Keep only these locales of the libraries' resources, as in the other OpenIPC apps
resourceConfigurations += ['en', 'ru', 'zh-rCN']

Expand Down
39 changes: 37 additions & 2 deletions android/app/src/main/java/com/openipc/decoder/Brass.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,39 @@ static void style(AlertDialog dialog) {
}
}

/**
* The buttons of a settings window (brass, 2026-11-20, as camex 4.3.1): Cancel on the left,
* Save on the right, two equal halves across the window with 6dp around each. The dialog's
* own button bar is reused; on Android TV it puts the positive button first and packs the
* buttons to the left, so it is reordered here. Call after {@link #style}.
*/
static void halves(AlertDialog dialog) {
Button cancel = dialog.getButton(AlertDialog.BUTTON_NEGATIVE);
Button save = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
if (cancel == null || save == null || cancel.getParent() != save.getParent()
|| !(save.getParent() instanceof LinearLayout)) return;
LinearLayout bar = (LinearLayout) save.getParent();
for (int i = 0; i < bar.getChildCount(); i++) {
View v = bar.getChildAt(i);
if (v != cancel && v != save) v.setVisibility(View.GONE);
}
bar.removeView(cancel);
bar.removeView(save);
bar.setOrientation(LinearLayout.HORIZONTAL);
ViewGroup.LayoutParams blp = bar.getLayoutParams();
if (blp != null) {
blp.width = ViewGroup.LayoutParams.MATCH_PARENT;
bar.setLayoutParams(blp);
}
int m = Math.round(6 * dp(dialog.getContext()));
for (Button b : new Button[]{cancel, save}) {
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0,
ViewGroup.LayoutParams.WRAP_CONTENT, 1);
lp.setMargins(m, m, m, m);
bar.addView(b, lp);
}
}

/** A dialog button as a brass key: serif capitals in dark ink, a little apart. */
private static void key(Context c, Button b) {
b.setBackground(keyStates(c));
Expand Down Expand Up @@ -200,8 +233,10 @@ private static void styleTree(Context c, View v) {
b.setButtonDrawable(b instanceof android.widget.RadioButton
? R.drawable.brass_radio : R.drawable.brass_check);
int pad = Math.round(6 * dp(c));
b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(), b.getPaddingRight(),
b.getPaddingBottom());
// 6dp before the text and 6dp after it: the focus ring of a box as wide as its text
// would lie on its last letter, and a radio's text would touch the next ring (#292)
b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(),
Math.max(b.getPaddingRight(), pad), b.getPaddingBottom());
// the remote's focus (focus_ring.xml): views made with the activity's context miss
// the dialog theme's checkboxStyle
b.setBackgroundResource(R.drawable.focus_ring);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ protected void onMeasure(int widthSpec, int heightSpec) {
Brass.frame(dialog);
dialog.show();
Brass.style(dialog);
Brass.halves(dialog);
}

/** The state line of the Network screen. */
Expand Down
Loading