Commit Graph
5 Commits
Author SHA1 Message Date
Mohamad Hamade 0611baa681 fix: center align toolbar item in ChatHeader
- passed modifier.fillmaxHeight so the content inside the row can actually be centered
2025-07-17 13:49:31 +03:00
Mohamad Hamade d730acbb79 Refactor: Migrate MainViewModel to use StateFlow
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.
2025-07-16 01:13:42 +03:00
Mohamad Hamade 17472a1854 Refactor: Remove unused tripleClickCount state variable
The `tripleClickCount` mutable state variable in the `ChatHeader` composable was not being used and has been removed to simplify the code
2025-07-15 13:18:29 +03:00
Mohamad Hamade 245181d736 Refactor: Introduce MainViewModel for onboarding state management
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.
2025-07-15 02:24:41 +03:00
Mohamad Hamade 0a33bd734d Bugfix: Handled single or triple clicked at once instead of executing them as separate events
This commit introduces a new `singleOrTripleClickable` Modifier extension function.

This function allows distinguishing between single and triple clicks on a Composable element.

The `ChatHeader` was updated to utilize this new Modifier for handling clicks on the "bitchat*" title, where a single click shows app info and a triple click triggers a separate action.
2025-07-14 22:16:19 +03:00