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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ 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.3 — 2026-11-20

- Cancel and Save in every window follow the brass rule now (#294), not only in Settings: the
camera URL dialog and the Reset confirmation (Cancel / Clear settings) have Cancel on the left
and the other on the right, two equal halves across the window; on Android TV they were small,
pressed to the left and in the order Save, Cancel. Cancel keeps the first focus in Reset.

## 2.27.2 — 2026-11-20

- The Settings dialog follows two brass rules it missed (#292): Cancel on the left and Save on
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 65
versionName "2.27.2"
versionCode 66
versionName "2.27.3"
// Keep only these locales of the libraries' resources, as in the other OpenIPC apps
resourceConfigurations += ['en', 'ru', 'zh-rCN']

Expand Down
14 changes: 9 additions & 5 deletions android/app/src/main/java/com/openipc/decoder/Brass.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,23 @@ static void style(AlertDialog dialog) {
Button b = dialog.getButton(which);
if (b != null) key(c, b);
}
halves(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}.
* Cancel and Save of every 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 (#292, #294).
* 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. A dialog with only one of the two
* (OK) keeps its bar. The button with the focus keeps it.
*/
static void halves(AlertDialog dialog) {
private 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();
View focused = bar.findFocus();
for (int i = 0; i < bar.getChildCount(); i++) {
View v = bar.getChildAt(i);
if (v != cancel && v != save) v.setVisibility(View.GONE);
Expand All @@ -198,6 +201,7 @@ static void halves(AlertDialog dialog) {
lp.setMargins(m, m, m, m);
bar.addView(b, lp);
}
if (focused != null) focused.requestFocus();
}

/** A dialog button as a brass key: serif capitals in dark ink, a little apart. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ 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
17 changes: 11 additions & 6 deletions android/app/src/main/res/drawable/focus_ring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
focus_ring.xml — the D-pad focus of a check box, switch or radio button on a brass screen
(res/drawable/focus_ring.xml): the amber frame of a focused brass button, nothing otherwise

Version: 1.3.0
Date: 2026-11-18
Version: 1.4.2
Date: 2026-11-19

The master copy, after vtesse 2.1.0; rules are in brass/README.md. Wire it through the theme:
<item name="android:checkboxStyle">@style/Check</item>
<style name="Check" parent="android:Widget.Material.CompoundButton.CheckBox">
The master copy, after vtesse 2.1.0; rules are in brass/README.md. Wire it through the theme,
with the brass box and ring (brass_check.xml, brass_radio.xml, since 1.4.0):
<item name="android:checkboxStyle">@style/BrassCheck</item>
<item name="android:radioButtonStyle">@style/BrassRadio</item>
<style name="BrassCheck" parent="android:Widget.Material.CompoundButton.CheckBox">
<item name="android:background">@drawable/focus_ring</item>
<item name="android:button">@drawable/brass_check</item>
<item name="android:buttonTint">@null</item>
</style>
(the same for switchStyle and radioButtonStyle where the screen has them)
(BrassRadio: the same with RadioButton and brass_radio; a switch keeps its own look with
this background through switchStyle)
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
Expand Down
Loading