Skip to content

Refactor Settings shared helpers#732

Open
tigercraft4 wants to merge 2 commits into
ryanbr:mainfrom
tigercraft4:refactor/settings-section-files
Open

Refactor Settings shared helpers#732
tigercraft4 wants to merge 2 commits into
ryanbr:mainfrom
tigercraft4:refactor/settings-section-files

Conversation

@tigercraft4

Copy link
Copy Markdown

Summary

Continues #665.

This is the first small SettingsScreen split: it moves shared Settings UI helpers and pure Settings helper logic into sibling files, without changing the section bodies or behavior.

Changes

  • Adds SettingsComponents.kt for reusable Settings card/form/disclosure/toggle/row helpers.
  • Adds SettingsLogic.kt for waist-stepper logic, strap status helpers, sex options, and advanced-disclosure prefs.
  • Leaves SettingsScreen.kt as the same screen assembler, now calling the extracted helpers with Settings* names to avoid package-level collisions with similar helpers in other screens.

SettingsScreen.kt drops from about 3121 lines to 2851 lines. This deliberately avoids a larger section move in the same PR.

Verification

  • JAVA_HOME=/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home ANDROID_HOME=$HOME/Library/Android/sdk ./gradlew --dependency-verification=off :app:compileFullDebugKotlin

I also attempted the focused unit tests:

  • ./gradlew --dependency-verification=off :app:testFullDebugUnitTest --tests 'com.noop.ui.SettingsDisclosurePrefsTest' --tests 'com.noop.ui.StrapStatusDetailTest'

That currently fails before running the focused tests because main has three fake DeviceRegistryDao implementations missing the new setModel(id, model) method. That is the existing Android unit-test unblocker covered by #725, not caused by this refactor.

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