Skip to content

Polish cast bottom sheet UI 10156410954991940331#532

Merged
theovilardo merged 12 commits intomasterfrom
polish-cast-bottom-sheet-ui-10156410954991940331
Dec 15, 2025
Merged

Polish cast bottom sheet UI 10156410954991940331#532
theovilardo merged 12 commits intomasterfrom
polish-cast-bottom-sheet-ui-10156410954991940331

Conversation

@theovilardo
Copy link
Owner

No description provided.

theovilardo and others added 12 commits December 14, 2025 23:04
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.
@theovilardo theovilardo merged commit 1883788 into master Dec 15, 2025
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@lostf1sh lostf1sh deleted the polish-cast-bottom-sheet-ui-10156410954991940331 branch January 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant