Add Bluetooth device UI and cast autoplay toggle#480
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private val disableCastAutoplay: StateFlow<Boolean> = userPreferencesRepository.disableCastAutoplayFlow | ||
| .stateIn( | ||
| scope = viewModelScope, | ||
| started = SharingStarted.WhileSubscribed(5000), | ||
| initialValue = false |
There was a problem hiding this comment.
Respect cast auto-play preference
The new disableCastAutoplay flag is never populated from preferences: it is wrapped in stateIn(SharingStarted.WhileSubscribed) and not collected anywhere, so the state flow never starts and always stays at the default false. As a result, even after the user disables “Auto-play on cast connect/disconnect” in Settings, the transfer logic at cast handoff (shouldAutoPlayOnCast/shouldResumePlaying) still sees false and keeps auto-playing whenever playback was active. Consider eagerly collecting this flow or using SharingStarted.Eagerly so the stored preference is reflected.
Useful? React with 👍 / 👎.
This commit refactors several UI components within the CastBottomSheet for a cleaner and more dynamic presentation. Key changes include: - Redesigned `DeviceItem` to use a `Row` and `Column` layout instead of `ListItem`, improving alignment and spacing. - Refined the `InfoTile` design with animated colors for the active state and a smooth corner shape. - Adjusted padding, spacers, and corner rounding throughout the bottom sheet for a more polished look.
Summary
Testing
Codex Task