Controller functionality - #24
Open
iloveswiming909 wants to merge 96 commits into
Open
Conversation
Apply Odin 2 Mini detection patch.
Add debug build workflow
…ality # Conflicts: # app/src/main/java/com/aure/clustertune/ui/AccentColorPicker.kt # app/src/main/java/com/aure/clustertune/ui/SettingsScreen.kt # app/src/main/java/com/aure/clustertune/ui/TunerScreen.kt # app/src/main/java/com/aure/clustertune/ui/designsystem/component/CtModalScaffold.kt # app/src/main/java/com/aure/clustertune/ui/designsystem/component/CtNumericField.kt # app/src/main/java/com/aure/clustertune/ui/designsystem/component/CtSlider.kt # app/src/main/java/com/aure/clustertune/ui/tuner/TunerPolicyComponents.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While i was working on the odin 2 mini support I ended up improving controller functionality to make my life easier. This pull request is independant of the odin 2 mini fixes and can be accpeted independantly. Again for disclosure I am new to coding so this was made with heavy Claude Opus 4.8 and 5 assistance. Here is the summary:
Summary
Makes the tuner fully operable with a game controller / D-pad. Every slider, profile row and dialog can be reached and driven without touching the screen, which is how the app is used on a handheld. No change for touch users, and nothing outside the UI layer is touched.
A note on the commits
This branch was developed iteratively and has a long, messy commit history; it is not arranged into reviewable steps. Please squash-merge. The description below is organised by area so the whole change can be reviewed as one diff rather than commit by commit.
What changes
A single hover-then-adjust contract (CtAdjustable) shared by every slider-like control, so they all behave the same way:
D-pad moves focus between controls; the focused one shows a hover outline.
A / Center / Enter enters adjust mode, which grows the slider knob (not the whole control) so it is obvious the next presses change a value.
Left / right step the value; up / down are swallowed while adjusting so focus can't slip away mid-edit.
B / Back leaves adjust mode only — it no longer falls through to the screen's back handler and closes the whole screen.
Applied to the tuner frequency cards, the shared CtSlider, the numeric fields, and the accent-colour hue slider (which had no controller support before — it was reachable but inert).
Profile rows (ProfileChoiceRow) get focus targeting and a visible focus state; previously focus landed on them invisibly because they were only clickable.
Dialog focus (CtModalScaffold) keeps D-pad focus inside the dialog instead of letting it escape to the navigation rail with no way back.
Two robustness fixes found along the way:
BackHandler is installed only when a LocalOnBackPressedDispatcherOwner is present — overlay windows don't have one, and calling it there crashes.
android:enableOnBackInvokedCallback="true" is set, without which BackHandler delivery is unreliable on Android 13+.
Scope
UI only — ui/designsystem/component/, ui/tuner/, ui/TunerScreen.kt, ui/SettingsScreen.kt, ui/AccentColorPicker.kt. No changes to the execution layer, sysfs handling, or device integration.
Testing
Manually verified on an AYN Odin 2 Mini with its built-in controller: focus traversal across all sliders and profile rows, adjust-mode entry/exit, up/down containment while adjusting, and B returning to hover rather than closing the screen. Touch interaction unchanged.