Skip to content

fix: brass check boxes and radio buttons show on and off under the remote's focus (2.27.1) - #291

Merged
compot-dev merged 1 commit into
v2from
fix/brass-check-290
Nov 19, 2026
Merged

compot-dev merged 1 commit into
v2from
fix/brass-check-290

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #290. Seen by the owner on a SberBox (Android 13, Decoder 2.26.0): in Settings, Allow remote access on and focused showed a solid amber square with no tick; a chosen radio button with the focus showed a solid amber circle with no dot.

Cause: the system Material check box / radio button tinted amber (buttonTint); under focus their state layer fills the mark's cut-out with the same amber.

Fix (agreed with the brand project; the drawables go to its brass template as 1.4.0):

  • res/drawable/brass_check.xml (selector) with brass_check_on.xml (an amber box, a dark tick) and brass_check_off.xml (an empty dark box, a dim frame); brass_radio.xml with brass_radio_on.xml (an amber ring, an amber dot) and brass_radio_off.xml (an empty dark ring, a dim frame). Vector drawables, colours as hex (the brass palette), API 21+.
  • BrassCheck / BrassRadio styles: android:button the drawable, android:buttonTint @null; focus_ring.xml stays the row's background. Brass.style sets the same on views made with the activity's context.
  • 2.27.1 (versionCode 64), CHANGELOG. tests/e2e.sh with SHOTS=1 also takes a screenshot with the focus on a check box.

Tests (local, Docker): build, unit tests, lint (13 as before); e2e TRANSPORT=TCP API 21 20/20, API 34 20/20; SHOTS=1 API 34: the focused check box shows its tick inside the amber frame, radio buttons read; API 21: the drawables render (that SHOTS run missed a picture from the emulator's software decoder, as noted in the script).

…mote's focus (2.27.1)

The system Material check box and radio button, tinted amber, became a solid
amber box or circle with no tick or dot under the remote's focus (a SberBox,
Android 13). The app's own drawables now (brass_check, brass_radio; no
buttonTint): checked an amber box with a dark tick or an amber ring with an
amber dot, unchecked an empty dark box or ring with a dim frame; focus_ring
stays around the row. Wired through the BrassDialog theme and Brass.style.

tests/e2e.sh (SHOTS): a screenshot with the focus on a check box.

Closes #290
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Keep brass checkbox and radio states visible under remote focus

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Replace tinted system controls with brass drawables so checked states remain visible under remote
 focus.
• Apply the drawables through dialog styles and runtime styling while preserving the row focus ring.
• Add a focused-checkbox screenshot and release the fix as 2.27.1.
Merge Risk 🟢 Low

Blast radius 🔴 High 💥 2 capabilities

  • 2 affected capabilities span independent functional scopes: brass_dialog_presentation, release_identity_reporting.
  • The changed code is a shared presentation rule used by the Network settings and camera settings dialogs, with the same user outcome—readable and focusable checkbox/radio state—across those entry points.
  • These are related surfaces within the bounded Brass dialog presentation feature, not independent deployment or storage capabilities.
  • This behavior is independent of Brass dialog presentation: it concerns the externally reported identity of the built application and diagnostic User-Agent/version output, not a dialog interaction or stored setting.
Sources

android/app/build.gradle[29-30]

        versionCode 64
        versionName "2.27.1"
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before: Android's existing compound-button drawable was tinted amber and was applied by the system/theme.
  • After: the same checked state selects one of two app-owned vector drawables, while the existing focus background remains separate.
  • The new correctness condition is that checked and unchecked states must map to the intended visual asset without changing the control's logical state.
  • This is a direct state-to-resource transformation using existing dialog traversal and focus infrastructure; no new state machine, ordering protocol, persistence invariant, or algorithm is introduced.
Sources

android/app/src/main/res/drawable/brass_check.xml[11-14]

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@drawable/brass_check_on" />
    <item android:drawable="@drawable/brass_check_off" />
</selector>
Potential damage 🟢 Low 🩹 Reversible

  • A visual-state or layout defect could mislead a user operating the remote or require reopening the dialog, but the underlying setting is not persistently corrupted by this change.
  • Replacing the APK with the prior version restores the old rendering; no persistent-state repair or external compensation is required.
  • Equal business importance is assumed because no Business Criticality Map was supplied.
  • Revert the APK to restore the previous drawable behavior.
  • If a user saves an unintended setting after being misled, the setting can be corrected through the same dialog; no automatic repair mechanism is needed.
Sources

android/app/src/main/res/drawable/brass_check.xml[11-14]

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@drawable/brass_check_on" />
    <item android:drawable="@drawable/brass_check_off" />
</selector>
Assessed commit 0b5ce73
Diagram

graph TD
  D["Brass dialogs"] --> T["BrassDialog theme"] --> S["Control styles"] --> C["State selectors"] --> V["On off vectors"]
  D --> B["Runtime styling"] --> C
  S --> F["Row focus ring"]
  B --> F
Loading
High-Level Assessment

Use the proposed untinted state drawables in both styling paths. Adjusting the system control's tint alone would leave its focused rendering dependent on platform behavior, while replacing the separate focus ring would conflate focus with checked state.

Files changed (11) +103 / -4

Bug fix (8) +89 / -2
Brass.javaStyle activity-context controls with untinted brass marks +7/-2

Style activity-context controls with untinted brass marks

• Replaces amber button tinting with the checkbox or radio selector during runtime dialog styling. Adds left padding and keeps the existing row focus-ring background.

android/app/src/main/java/com/openipc/decoder/Brass.java

brass_check.xmlSelect checkbox artwork by checked state +14/-0

Select checkbox artwork by checked state

• Adds a selector that chooses the checked or unchecked brass checkbox vector.

android/app/src/main/res/drawable/brass_check.xml

brass_check_off.xmlDraw the unchecked brass checkbox +11/-0

Draw the unchecked brass checkbox

• Adds an empty dark box with a dim frame for the unchecked state.

android/app/src/main/res/drawable/brass_check_off.xml

brass_check_on.xmlDraw a visible tick in the checked checkbox +14/-0

Draw a visible tick in the checked checkbox

• Adds an amber box with a contrasting dark tick for the checked state.

android/app/src/main/res/drawable/brass_check_on.xml

brass_radio.xmlSelect radio artwork by checked state +14/-0

Select radio artwork by checked state

• Adds a selector that chooses the selected or unselected brass radio vector.

android/app/src/main/res/drawable/brass_radio.xml

brass_radio_off.xmlDraw the unselected brass radio button +11/-0

Draw the unselected brass radio button

• Adds an empty dark circle with a dim outline for the unselected state.

android/app/src/main/res/drawable/brass_radio_off.xml

brass_radio_on.xmlDraw the selected brass radio button +12/-0

Draw the selected brass radio button

• Adds an amber outline and center dot to distinguish the selected state.

android/app/src/main/res/drawable/brass_radio_on.xml

styles.xmlUse untinted brass drawables in themed controls +6/-0

Use untinted brass drawables in themed controls

• Assigns the new selectors to BrassCheck and BrassRadio, clears button tint, and retains their focus-ring backgrounds.

android/app/src/main/res/values/styles.xml

Tests (1) +4 / -0
e2e.shCapture a screenshot of the focused checkbox +4/-0

Capture a screenshot of the focused checkbox

• When SHOTS is enabled, moves focus to Allow remote access and saves a screenshot for visual inspection of its checked mark.

tests/e2e.sh

Documentation (1) +8 / -0
CHANGELOG.mdDocument the 2.27.1 control-visibility fix +8/-0

Document the 2.27.1 control-visibility fix

• Adds release notes explaining why focused system controls obscured their checked marks and how the brass drawables resolve it.

CHANGELOG.md

Other (1) +2 / -2
build.gradleBump the app to 2.27.1 +2/-2

Bump the app to 2.27.1

• Increments versionCode from 63 to 64 and versionName from 2.27.0 to 2.27.1.

android/app/build.gradle

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Check boxes get different padding depending on how they are built 🐞 Bug ⚙ Maintainability
Description
Brass.styleTree adds a 6dp left padding to every CompoundButton it styles, but the XML
BrassCheck/BrassRadio styles and the BrassDialog theme wiring set no padding. Check boxes and
radio buttons created through the theme therefore lay out differently from those restyled in Java,
so the same row can look offset depending on its construction path.
Code

android/app/src/main/java/com/openipc/decoder/Brass.java[R202-204]

+            int pad = Math.round(6 * dp(c));
+            b.setPadding(Math.max(b.getPaddingLeft(), pad), b.getPaddingTop(), b.getPaddingRight(),
+                    b.getPaddingBottom());
Evidence
The Java path sets the padding and the XML style does not, so the two paths produce different
layouts for the same control. The PR adds the button drawable in both places, but the padding is
only in one.

android/app/src/main/java/com/openipc/decoder/Brass.java[195-209]
android/app/src/main/res/values/styles.xml[18-31]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The 6dp left padding for brass check boxes and radio buttons is applied only in `Brass.styleTree`, while the `BrassCheck`/`BrassRadio` styles used by the theme do not set it. Controls built through the theme and those restyled in Java therefore differ in layout.
## Fix Focus Areas
- android/app/src/main/java/com/openipc/decoder/Brass.java[195-209]
- android/app/src/main/res/values/styles.xml[18-31]
## Recommended Fix
Decide on one padding value. Either add `<item name="android:paddingStart">` (or `paddingLeft`) of 6dp to both `BrassCheck` and `BrassRadio` and remove the Java `setPadding` call, or keep the Java call and add a comment saying the theme path is intentionally unpadded. Verify on the device that both construction paths render the same.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Amber and dark tones are hardcoded in drawables 🐞 Bug ⚙ Maintainability
Description
The new vector drawables hardcode #FFB347, #120D0A, #B09873, #2A1C10 and #8C6A2A instead
of referencing @color/amber and the other palette entries. A later palette change in colors.xml
will not reach the check boxes and radio buttons, and they can drift from the rest of the brass UI.
Code

android/app/src/main/res/drawable/brass_check_on.xml[R9-10]

+    <path android:fillColor="#FFB347" android:strokeColor="#8C6A2A" android:strokeWidth="1"
+        android:pathData="M6,3h12a3,3 0,0 1,3 3v12a3,3 0,0 1,-3 3h-12a3,3 0,0 1,-3 -3v-12a3,3 0,0 1,3 -3z" />
Evidence
focus_ring.xml uses @color/amber, and colors.xml defines amber as #ffb347. The new
drawables repeat that value as a literal, so the palette is defined in two places.

android/app/src/main/res/drawable/brass_check_on.xml[7-10]
android/app/src/main/res/values/colors.xml[19]
android/app/src/main/res/drawable/focus_ring.xml[20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The brass check and radio drawables hardcode hex colours that duplicate `@color/amber` from `colors.xml`. A palette change would not reach these drawables.
## Fix Focus Areas
- android/app/src/main/res/drawable/brass_check_on.xml[7-10]
- android/app/src/main/res/drawable/brass_radio_on.xml[7-11]
- android/app/src/main/res/values/colors.xml[19]
## Recommended Fix
Add named colour resources for the brass tones in `colors.xml` (for example `brass_tick`, `brass_frame_dim`) and reference them as `@color/...` in the drawables. If the brand template must keep literal hex values, note in the drawables which palette entry each one mirrors.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev

Copy link
Copy Markdown
Collaborator Author

Qodo review on 0b5ce73 — both left as they are:

  1. Different padding depending on how a check box is built — in Decoder every check box and radio button of a dialog goes through Brass.style, which sets the same drawable, no tint and the same 6dp gap; the theme's BrassCheck / BrassRadio alone never style one of ours, so all of them look the same.
  2. Hardcoded colours in the drawables — on purpose: these XML files become the brand project's brass template (1.4.0) for all our apps, so they carry the palette themselves and do not depend on which colours each app's colors.xml keeps (Decoder's has no ink_dark or display tone). The values are the brass palette's.

@compot-dev
compot-dev merged commit 7aaadbf into v2 Nov 19, 2026
7 checks passed
@compot-dev
compot-dev deleted the fix/brass-check-290 branch November 19, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Brass check boxes and radio buttons: on or off cannot be told under the remote's focus

1 participant