* Add bluetooth monitor function to onboarding flow screen
* Adds function that checks bluetooth status in real time
* Add bluetooth monitor function to onboarding flow screen
* Refactor
* Comment button to manually check BT state
* Original commits
* feat(ui): Remove auto-trigger for Bluetooth enable prompt
* feat(ui): Remove auto-trigger for Bluetooth enable prompt
* feat(ui): Remove BluetoothStatusBanner. Pending approval on feature, will add in a new PR
* Refactor and fix conflicts
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit refactors the `MainViewModel` to use `StateFlow` instead of `mutableStateOf` for managing its observable properties. This change improves the way UI state is handled and observed, aligning with modern Android development best practices.
Additionally, `OnboardingState.kt` has been moved to the `onboarding` package for better organization.
This commit introduces a `MainViewModel` to manage the UI state for the onboarding flow. This change centralizes the onboarding state (including Bluetooth status, location status, error messages, and loading indicators) within the ViewModel, allowing it to survive configuration changes and simplifying state management within `MainActivity`.
Key changes:
- Created `MainViewModel.kt` to hold and manage onboarding-related UI state.
- Moved onboarding state variables (e.g., `onboardingState`, `bluetoothStatus`, `locationStatus`) from `MainActivity` to `MainViewModel`.
- Updated `MainActivity` to observe and update onboarding state through the `MainViewModel`.
- Created `OnboardingState.kt` to define the possible states of the onboarding process.
- Ensured that the onboarding process is not restarted on configuration changes by checking `mainViewModel.onboardingState` before initiating.