-
Notifications
You must be signed in to change notification settings - Fork 488
Add Real-Time Bluetooth State Monitoring to OnboardingFlowScreen #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
love this PR thank you |
You're welcome, looking to put out more PR |
@@ -0,0 +1,33 @@ | |||
package com.bitchat.android.ui | |||
|
|||
import androidx.compose.foundation.layout.Row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this file used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to improve the user experience after onboarding. Currently, when users turn off their Bluetooth, they’re redirected back to the BluetoothCheckScreen. Instead, I’d like to display a banner at the top of the chat screen indicating that Bluetooth is turned off. This way, users can still view their messages while being informed of the issue. The banner should automatically disappear once Bluetooth is turned back on. Its for a different PR, obviously cause this PR was closed so it got added, not sure
It looks like there is an unused file in the PR. I have a small change request, if you agree: when I'm in the app, and I turn of bluetooth, I see the "bitchat wants to turn on bluetooth" toggle [1] instead of the user the "bluetooth required" screen [2]. only pressing the "enable bluetooth" button should show the toggle IMO. |
I'm not sure I got that correctly, can you explain that again? |
So I took my time to read your message again and again, I think what you're trying to say is that you don't want the dialog that shows up saying 'bitchat wants to to turn on bluetooth" instead it should be the BluetoothCheckScreen composable, which when the user clicks on the enable button should then trigger the alert that "Bitchat wants to turn on Bluetooth" |
Update: Bluetooth no longer auto triggers. It works only on button press. Before: Screenrecorder-2025-07-14-15-57-12-966.mp4After: Screenrecorder-2025-07-14-15-58-02-664.mp4Please review and let me know your thoughts. |
awesome, appreciate that you've made the requested changes and sorry for the delay! |
Description
This pull request introduces real-time Bluetooth state monitoring to the OnboardingFlowScreen composable in MainActivity. The feature ensures the UI updates dynamically when the user enables or disables Bluetooth, enhancing the onboarding experience by providing immediate feedback and seamless progression through the onboarding flow.
Key Changes
1. New monitorBluetoothState Function in BluetoothStatusManager:
Registers a BroadcastReceiver for BluetoothAdapter.ACTION_STATE_CHANGED.
Updates bluetoothStatus and calls BluetoothStatusManager.handleBluetoothStatus on state changes.
Returns BroadcastReceiver for unregistration.
2. Updated OnboardingFlowScreen Composable:
Uses monitorBluetoothState in a DisposableEffect to manage the receiver lifecycle.
Adds callbacks (onBluetoothStatusChange, onStateChange, onBluetoothLoadingChange) to update state reactively.
Auto-calls checkBluetoothAndProceed when Bluetooth is enabled in BLUETOOTH_CHECK state.
Before
Screenrecorder-2025-07-11-10-39-06-608.mp4
After
Screenrecorder-2025-07-11-10-43-39-469.mp4
Motivation
Previously, BluetoothCheckScreen required manual retries to detect Bluetooth state changes. Real-time monitoring ensures immediate UI updates and automatic progression when Bluetooth is enabled, enhancing UX.
Please review and provide feedback!