Skip to content

Add per-control appearance customization#1672

Open
Nightwalker743 wants to merge 7 commits into
utkarshdalal:masterfrom
Nightwalker743:feature/on-screen-control-appearance
Open

Add per-control appearance customization#1672
Nightwalker743 wants to merge 7 commits into
utkarshdalal:masterfrom
Nightwalker743:feature/on-screen-control-appearance

Conversation

@Nightwalker743

@Nightwalker743 Nightwalker743 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds more customization for on-screen controls.

This lets users customize each control’s color, pressed color, opacity, and line thickness. Buttons also get a per-button shooter mode look-through toggle.

Also added a live preview, copy/apply/reset appearance actions, and made sure copied profiles/layouts preserve the new appearance settings.

These were requested features from a few different threads:
https://discord.com/channels/1378308569287622737/1517555219955716308
https://discord.com/channels/1378308569287622737/1522259263169232896
https://discord.com/channels/1378308569287622737/1518119934784180375

Recording

https://drive.google.com/file/d/1Hh_61uJzpyi4u8LkgsW_ghpG-xdvZ4rH/view?usp=sharing

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Adds per‑control appearance customization for on‑screen controls with live preview and a per‑button shooter look‑through toggle. Copy/apply/reset now include control size, and profile/layout copy preserves these settings.

  • New Features

    • New ControlAppearanceEditor to set color, pressed color, opacity (inherit or override), and line thickness per control, with live preview.
    • Copy/apply/reset appearance across controls now also includes size; profile/layout copy preserves appearance and bindings.
  • Bug Fixes

    • Corrected rectangular control preview sizing; look‑through only activates when enabled.
    • Preserved selected‑control highlight with custom colors.
    • Fixed range and trackpad appearance previews, including active trackpad color.

Written for commit 9e95b10. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added a “Control Appearance” editor with live previews for multiple control types, including preset/HEX colors, active/pressed color, opacity (with inherited/global default), stroke width, and shooter “look through”.
    • Added preview, apply-all, and copy-appearance actions (with confirmation/error toasts).
    • Added profile element duplication that preserves control bindings and button appearance.
  • Bug Fixes
    • Improved save/discard to restore bindings across the full binding set, shape/text edits, and per-control appearance reliably.
    • Refined touch handling and UI refresh timing; improved range scroller active-segment interaction and rendering updates.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds control appearance editing and preview support, persists appearance fields, updates native rendering and touch behavior, refactors profile copying, and adds localized strings for appearance controls.

Changes

Control Appearance Feature

Layer / File(s) Summary
ControlElement appearance model and persistence
app/src/main/java/com/winlator/inputcontrols/ControlElement.java, app/src/main/java/com/winlator/inputcontrols/ControlsProfile.java
Adds appearance state, accessors, color helpers, serialization, and JSON loading.
Native appearance rendering and interaction
app/src/main/java/com/winlator/inputcontrols/ControlElement.java, app/src/main/java/com/winlator/inputcontrols/RangeScroller.java, app/src/main/java/com/winlator/widget/InputControlsView.java
Updates rendering, range-button active styling, shooter behavior, touch invalidation, and active-index tracking.
Appearance editor and preview UI
app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt
Adds appearance capture/apply logic, per-control previews, color editing, and appearance-copy selection.
Element editor save and restore flow
app/src/main/java/app/gamenative/ui/component/dialog/ElementEditorDialog.kt
Adds appearance editing state, centralized saving, text and shape tracking, unsaved-change handling, and discard restoration.
Profile element copy refactor
app/src/main/java/app/gamenative/ui/screen/xserver/InputControlsProfileCopy.kt, app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt
Adds reusable profile element copying and delegates duplicate-profile handling to it.
Localized appearance strings
app/src/main/res/values*/strings.xml
Adds appearance, preview, copy, apply, and toast resources across locales.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ElementEditorDialog
  participant ControlAppearance
  participant ControlElement
  participant InputControlsView
  User->>ElementEditorDialog: edit appearance values
  ElementEditorDialog->>ControlAppearance: capture current appearance
  ControlAppearance->>ControlElement: apply appearance for preview
  ControlElement->>InputControlsView: invalidate
  User->>ElementEditorDialog: save changes
  ElementEditorDialog->>ControlElement: persist edited properties
Loading
sequenceDiagram
  participant XServerScreen
  participant InputControlsProfileCopy
  participant ControlsProfile
  participant InputControlsView
  XServerScreen->>InputControlsProfileCopy: copy profile elements
  InputControlsProfileCopy->>ControlsProfile: load and clear elements
  InputControlsProfileCopy->>InputControlsProfileCopy: recreate elements and bindings
  InputControlsProfileCopy->>InputControlsView: invalidate view
Loading

Suggested reviewers: utkarshdalal, phobos665

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: per-control appearance customization.
Description check ✅ Passed The PR includes the required Description, Recording, Type of Change, and Checklist sections with filled details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Nightwalker743 Nightwalker743 force-pushed the feature/on-screen-control-appearance branch from 036a8c8 to c9e18bd Compare July 5, 2026 17:48
@Nightwalker743 Nightwalker743 marked this pull request as ready for review July 5, 2026 17:51

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 23 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt">

<violation number="1" location="app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt:69">
P2: The color preset list is defined with raw hex literals inside the composable module. To stay consistent with the project's theme convention and the team's review guidance, these preset values should be declared as named constants in the shared theme (e.g., `ui/theme/Color.kt`) and referenced here. This makes palette updates easier and keeps UI colors centralized.</violation>

<violation number="2" location="app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt:523">
P2: Hardcoded preview text "DJ" should be extracted to strings.xml for localization. Even though it is preview placeholder text, it is displayed to the user in the shooter mode appearance preview, and the rest of this file consistently uses string resources for all user-facing text.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread app/src/main/res/values-de/strings.xml Outdated
}
}

private val controlColorPresets = listOf(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The color preset list is defined with raw hex literals inside the composable module. To stay consistent with the project's theme convention and the team's review guidance, these preset values should be declared as named constants in the shared theme (e.g., ui/theme/Color.kt) and referenced here. This makes palette updates easier and keeps UI colors centralized.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt, line 69:

<comment>The color preset list is defined with raw hex literals inside the composable module. To stay consistent with the project's theme convention and the team's review guidance, these preset values should be declared as named constants in the shared theme (e.g., `ui/theme/Color.kt`) and referenced here. This makes palette updates easier and keeps UI colors centralized.</comment>

<file context>
@@ -0,0 +1,619 @@
+    }
+}
+
+private val controlColorPresets = listOf(
+    0xffffff, 0xf44336, 0xff9800, 0xffeb3b,
+    0x4caf50, 0x03a9f4, 0x3f51b5, 0x9c27b0
</file context>

contentAlignment = Alignment.Center
) {
Text(
text = "DJ",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Hardcoded preview text "DJ" should be extracted to strings.xml for localization. Even though it is preview placeholder text, it is displayed to the user in the shooter mode appearance preview, and the rest of this file consistently uses string resources for all user-facing text.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt, line 523:

<comment>Hardcoded preview text "DJ" should be extracted to strings.xml for localization. Even though it is preview placeholder text, it is displayed to the user in the shooter mode appearance preview, and the rest of this file consistently uses string resources for all user-facing text.</comment>

<file context>
@@ -0,0 +1,619 @@
+        contentAlignment = Alignment.Center
+    ) {
+        Text(
+            text = "DJ",
+            color = drawColor,
+            style = MaterialTheme.typography.labelMedium,
</file context>

Comment thread app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/app/gamenative/ui/component/dialog/ElementEditorDialog.kt (1)

1089-1122: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Avoid resetting the element type on discard
element.type = originalType calls reset() and clears persisted state like iconId for non-SHOOTER_MODE elements; use setTypeWithoutReset(originalType) so cancel restores the original element state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/app/gamenative/ui/component/dialog/ElementEditorDialog.kt`
around lines 1089 - 1122, The discard handler in ElementEditorDialog is
resetting too much state by assigning element.type directly, which clears
persisted fields like iconId for non-SHOOTER_MODE elements. Update the
cancel/discard flow in the TextButton onClick block to restore the original type
with setTypeWithoutReset(originalType) instead of direct type assignment, while
keeping the rest of the original state restoration logic unchanged.
🧹 Nitpick comments (4)
app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt (1)

92-539: 🚀 Performance & Scalability | 🔵 Trivial

Preview composables look correct; some duplication in RangeButtonPreview.

The horizontal/vertical branches of RangeButtonPreview (Lines 291-436) duplicate a large amount of near-identical path-building logic. Since this is preview-only rendering, it's not urgent, but could be extracted into a shared orientation-agnostic helper to reduce duplication.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt`
around lines 92 - 539, The `RangeButtonPreview` composable contains heavily
duplicated path-building logic in its horizontal and vertical orientation
branches. Refactor this preview rendering by extracting the common
outline/active-segment drawing steps into a shared orientation-agnostic helper,
keeping `RangeButtonPreview` focused on choosing dimensions and delegating to
that helper. Preserve the existing behavior for `active`, `segmentCount`, and
the orientation-specific segment layout while reducing the repeated `Path`
construction in `RangeButtonPreview`.
app/src/main/res/values/strings.xml (1)

397-419: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Generic string names risk future collisions.

preview, active, and apply_all are very generic top-level keys for a large shared strings file. They don't currently collide with existing keys, but as the file grows, similarly generic names are more likely to clash or be reused unintentionally. Consider more specific names like control_preview, control_active_label, control_apply_all for durability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/res/values/strings.xml` around lines 397 - 419, The strings in
the control appearance section use overly generic resource names that could
collide later; rename the shared keys near the control appearance strings to
more specific identifiers. Update the entries for preview, active, and apply_all
to names scoped to this feature, such as control_preview, control_active_label,
and control_apply_all, and make sure all references elsewhere in the app are
updated to match the new string resource names.
app/src/main/java/com/winlator/inputcontrols/ControlElement.java (2)

774-936: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Correctly consumes activeColor/normalColor/oldColor; visually affected by the default-color issue noted above.

Segment logic itself (active-boundary detection, outline gap, active-segment overlay) is sound; the lack of default press feedback stems from getAppearanceDrawColor (see comment on Lines 34-37/516-532/701-714).

One minor inconsistency: the vertical branch clips with inputControlsView.getPath() (Line 869) while the horizontal branch consistently uses the local path variable (Line 800) — same object, so harmless, but worth aligning for clarity.

🧹 Minor consistency fix
                     canvas.save();
                     path.addRoundRect(boundingBox.left, startY, boundingBox.right, boundingBox.bottom, radius, radius, Path.Direction.CW);
-                    canvas.clipPath(inputControlsView.getPath());
+                    canvas.clipPath(path);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/winlator/inputcontrols/ControlElement.java` around
lines 774 - 936, The RANGE_BUTTON drawing code in ControlElement has a minor
consistency issue: the vertical branch uses inputControlsView.getPath() for
clipping while the horizontal branch uses the local path variable. Update the
vertical branch to clip with the same local Path instance already reset and used
in this case, keeping the clipping flow consistent and easier to maintain
without changing behavior.

1001-1012: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Cache the tint filter in drawIcon() PorterDuffColorFilter is created on every icon draw; reuse one per tint color instead of allocating during rendering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/winlator/inputcontrols/ControlElement.java` around
lines 1001 - 1012, The drawIcon() method in ControlElement is allocating a new
PorterDuffColorFilter on every render, which should be avoided. Reuse the tint
filter per tintColor instead of creating it each time drawIcon() runs, and keep
the existing paint/color-filter flow in drawIcon() and its caller path intact
while adding a cache keyed by the tint value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/com/winlator/inputcontrols/ControlElement.java`:
- Around line 34-37: The pressed-but-not-selected state in ControlElement still
uses buttonActiveColor directly, so when both defaults are 0x00ffffff the active
feedback becomes invisible. Update the relevant color selection logic in
ControlElement (including the pressed rendering paths in the draw/update
methods) to fall back to the regular button color or another visible default
when buttonActiveColor is unset or matches the transparent default, while
preserving custom active colors when provided.

---

Outside diff comments:
In `@app/src/main/java/app/gamenative/ui/component/dialog/ElementEditorDialog.kt`:
- Around line 1089-1122: The discard handler in ElementEditorDialog is resetting
too much state by assigning element.type directly, which clears persisted fields
like iconId for non-SHOOTER_MODE elements. Update the cancel/discard flow in the
TextButton onClick block to restore the original type with
setTypeWithoutReset(originalType) instead of direct type assignment, while
keeping the rest of the original state restoration logic unchanged.

---

Nitpick comments:
In
`@app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt`:
- Around line 92-539: The `RangeButtonPreview` composable contains heavily
duplicated path-building logic in its horizontal and vertical orientation
branches. Refactor this preview rendering by extracting the common
outline/active-segment drawing steps into a shared orientation-agnostic helper,
keeping `RangeButtonPreview` focused on choosing dimensions and delegating to
that helper. Preserve the existing behavior for `active`, `segmentCount`, and
the orientation-specific segment layout while reducing the repeated `Path`
construction in `RangeButtonPreview`.

In `@app/src/main/java/com/winlator/inputcontrols/ControlElement.java`:
- Around line 774-936: The RANGE_BUTTON drawing code in ControlElement has a
minor consistency issue: the vertical branch uses inputControlsView.getPath()
for clipping while the horizontal branch uses the local path variable. Update
the vertical branch to clip with the same local Path instance already reset and
used in this case, keeping the clipping flow consistent and easier to maintain
without changing behavior.
- Around line 1001-1012: The drawIcon() method in ControlElement is allocating a
new PorterDuffColorFilter on every render, which should be avoided. Reuse the
tint filter per tintColor instead of creating it each time drawIcon() runs, and
keep the existing paint/color-filter flow in drawIcon() and its caller path
intact while adding a cache keyed by the tint value.

In `@app/src/main/res/values/strings.xml`:
- Around line 397-419: The strings in the control appearance section use overly
generic resource names that could collide later; rename the shared keys near the
control appearance strings to more specific identifiers. Update the entries for
preview, active, and apply_all to names scoped to this feature, such as
control_preview, control_active_label, and control_apply_all, and make sure all
references elsewhere in the app are updated to match the new string resource
names.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f45c24a0-cc01-4aab-9f5e-de8e7011cd49

📥 Commits

Reviewing files that changed from the base of the PR and between 928892a and c9e18bd.

📒 Files selected for processing (23)
  • app/src/main/java/app/gamenative/ui/component/dialog/ControlAppearanceEditor.kt
  • app/src/main/java/app/gamenative/ui/component/dialog/ElementEditorDialog.kt
  • app/src/main/java/app/gamenative/ui/screen/xserver/InputControlsProfileCopy.kt
  • app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt
  • app/src/main/java/com/winlator/inputcontrols/ControlElement.java
  • app/src/main/java/com/winlator/inputcontrols/ControlsProfile.java
  • app/src/main/java/com/winlator/inputcontrols/RangeScroller.java
  • app/src/main/java/com/winlator/widget/InputControlsView.java
  • app/src/main/res/values-da/strings.xml
  • app/src/main/res/values-de/strings.xml
  • app/src/main/res/values-es/strings.xml
  • app/src/main/res/values-fr/strings.xml
  • app/src/main/res/values-it/strings.xml
  • app/src/main/res/values-ja/strings.xml
  • app/src/main/res/values-ko/strings.xml
  • app/src/main/res/values-pl/strings.xml
  • app/src/main/res/values-pt-rBR/strings.xml
  • app/src/main/res/values-ro/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-uk/strings.xml
  • app/src/main/res/values-zh-rCN/strings.xml
  • app/src/main/res/values-zh-rTW/strings.xml
  • app/src/main/res/values/strings.xml

Comment on lines +34 to +37
public static final int DEFAULT_BUTTON_COLOR = 0x00ffffff;
public static final int DEFAULT_BUTTON_ACTIVE_COLOR = 0x00ffffff;
public static final float INHERIT_BUTTON_OPACITY = -1.0f;
public static final float DEFAULT_BUTTON_STROKE_SCALE = 1.0f;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'DEFAULT_BUTTON_ACTIVE_COLOR|DEFAULT_BUTTON_COLOR|buttonActiveColorCustom|getAppearanceDrawColor' --type=java --type=kt

Repository: utkarshdalal/GameNative

Length of output: 188


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the target file structure first.
ast-grep outline app/src/main/java/com/winlator/inputcontrols/ControlElement.java --view expanded || true

echo '--- FILE SIZE ---'
wc -l app/src/main/java/com/winlator/inputcontrols/ControlElement.java

echo '--- CONSTANTS / HELPERS / DRAW ---'
rg -n 'DEFAULT_BUTTON_ACTIVE_COLOR|DEFAULT_BUTTON_COLOR|buttonActiveColorCustom|getAppearanceDrawColor|getEditorSelectionDrawColor|getRuntimeSelectedDrawColor|drawActiveSegmentOutline|activeStrokeWidth|activeSegment|secondaryColor' app/src/main/java/com/winlator/inputcontrols/ControlElement.java

echo '--- RELEVANT SECTIONS ---'
sed -n '1,130p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
echo '--- MIDDLE ---'
sed -n '480,560p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
echo '--- DRAW ---'
sed -n '680,740p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java

echo '--- SEARCH WHOLE REPO FOR RELATED FIX ---'
rg -n 'default selected-control coloring|buttonActiveColorCustom|getSecondaryColor\(\)|DEFAULT_BUTTON_ACTIVE_COLOR|drawActiveSegmentOutline|active segment outline' app/src/main/java

Repository: utkarshdalal/GameNative

Length of output: 24195


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline app/src/main/java/com/winlator/inputcontrols/ControlElement.java --view expanded || true
wc -l app/src/main/java/com/winlator/inputcontrols/ControlElement.java
rg -n 'DEFAULT_BUTTON_ACTIVE_COLOR|DEFAULT_BUTTON_COLOR|buttonActiveColorCustom|getAppearanceDrawColor|getEditorSelectionDrawColor|getRuntimeSelectedDrawColor|drawActiveSegmentOutline|activeStrokeWidth|activeSegment|secondaryColor' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
sed -n '1,130p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
sed -n '480,560p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
sed -n '680,740p' app/src/main/java/com/winlator/inputcontrols/ControlElement.java
rg -n 'default selected-control coloring|buttonActiveColorCustom|getSecondaryColor\(\)|DEFAULT_BUTTON_ACTIVE_COLOR|drawActiveSegmentOutline|active segment outline' app/src/main/java

Repository: utkarshdalal/GameNative

Length of output: 24046


Default active color still needs a fallback ControlElement.java:35, 516-529, 706-710 still leaves the pressed-but-not-selected path using buttonActiveColor directly, and both defaults are 0x00ffffff. Without a custom active color, controls render the same color on press, so the new active-segment feedback stays invisible.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/winlator/inputcontrols/ControlElement.java` around
lines 34 - 37, The pressed-but-not-selected state in ControlElement still uses
buttonActiveColor directly, so when both defaults are 0x00ffffff the active
feedback becomes invisible. Update the relevant color selection logic in
ControlElement (including the pressed rendering paths in the draw/update
methods) to fall back to the regular button color or another visible default
when buttonActiveColor is unset or matches the transparent default, while
preserving custom active colors when provided.

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.

1 participant