Skip to content

close #1041 Refactor preference handling to use type-safe enums and constant keys.#1479

Draft
chaneylc wants to merge 1 commit into
mainfrom
issue-1041-magic-numbers-refactor
Draft

close #1041 Refactor preference handling to use type-safe enums and constant keys.#1479
chaneylc wants to merge 1 commit into
mainfrom
issue-1041-magic-numbers-refactor

Conversation

@chaneylc

Copy link
Copy Markdown
Member

Description

Change Type

  • ADDITION (non-breaking change that adds functionality)
  • CHANGE (fix or feature that alters existing functionality)
  • FIX (non-breaking change that resolves an issue)
  • OTHER (use only for changes like tooling, build system, CI, docs, etc.)

Release Note


Refactor preference handling to use type-safe enums and constant keys.

Specific changes include:
- Replaced hardcoded string values with specialized enums for `TransferSource`, `LocationCollectionMode`, `GeoNavLoggingMode`, `AppThemeType`, `SkipEntriesMode`, and `MoveToUniqueIdMode`.
- Migrated manual index-to-enum logic in `ThemeViewModel` and `ThemedActivity` to centralized `fromIndex` and `fromValue` helper methods.
- Standardized default preference values across `CollectActivity`, `GeoNavHelper`, and various preference fragments.
- Updated `LocationPreferencesFragment` to dynamically manage UI visibility based on enum-driven logic.
- Improved readability in `RangeBoxView` by replacing magic numbers with descriptive enum flags for entry navigation.
- Refactored `BrapiFilterCache` to use an enum for cache clear intervals with defined millisecond constants.
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