Polish cast bottom sheet UI 10156410954991940331#532
Merged
theovilardo merged 12 commits intomasterfrom Dec 15, 2025
Merged
Conversation
This commit updates several imports in the `CastBottomSheet.kt` file. It also introduces a `density` local variable to avoid repeated calls to `LocalDensity.current`. Additionally, a coroutine scope is added to the `onDrag` gesture handler for snapping the sheet offset.
Refactored the CastBottomSheet layout to fix scrolling synchronization issues and improve visual spacing. - Replaced laggy `animateFloatAsState` collapse logic with direct scroll-driven offset calculations for a 1:1 "sticky header" feel. - Reduced `headerExpandedHeight` to 168.dp and aligned header content to the bottom to eliminate excessive vertical gaps. - Fixed a bug where the bottom sheet would close and reopen upon layout updates by adding an `isVisible` check in `CastSheetContainer`. - Used a fixed-height `Spacer` in `LazyColumn` to ensure stable content sizing during scroll.
Corrected the `LaunchedEffect` logic in `CastSheetContainer`. Previously, if the sheet's content layout updated (changing `sheetHeightPx`) during the entry animation, the animation was cancelled and not restarted because of an `isVisible` check. This caused the sheet to remain stuck in a hidden state (offset = height) while the scrim was visible. The fix ensures `sheetOffset.animateTo(0f)` is called whenever the sheet height stabilizes, unless the sheet is being actively dismissed. This guarantees the sheet always reaches its visible state.
Polished the CastBottomSheet UI and interaction: - Fixed a visual glitch where the sheet flashed at the top of the screen before animating in by managing content alpha during initialization. - Removed excessive top padding between the header and the title for a more compact layout. - Implemented `NestedScrollConnection` to allow swipe-to-dismiss from anywhere on the sheet, including the scrollable device list, ensuring a seamless user experience. - Refactored drag logic to be shared between the header and the nested scroll connection.
Resolved a syntax error in the previous commit and refined the CastBottomSheet UI. - Corrected the `nestedScroll` import and usage. - Aligned the collapsed "Connect device" title to `Alignment.BottomStart` to ensure it remains visible and correctly positioned when the header collapses. - Verified that the alpha cross-fade logic prevents text overlap between the expanded and collapsed states.
- Makes the "active device" section a sticky header in the `CastBottomSheet`. - Adjusts the layout by removing the initial spacer and reordering the refresh indicator. - Updates the background color of the sheet to `surfaceContainerLow`. - Modifies the styling of the header title and section header for better visual presentation.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.