refactor(android): use BottomSheetDialogFragment instead of BottomSheetDialog#342
Merged
refactor(android): use BottomSheetDialogFragment instead of BottomSheetDialog#342
Conversation
…etDialog - Create TrueSheetDialogFragment in core/ for better lifecycle management - Refactor TrueSheetViewController to use the new fragment - Add TrueSheetDialogFragmentDelegate for fragment callbacks - Maintain all existing functionality (detents, animations, keyboard, stacking)
- Move setupSheetDetents and setupDimmedBackground to onDialogShow - Clear FLAG_DIM_BEHIND in fragment's onCreateDialog - Fix footer positioning with post and isPresented check - Rename setDraggable to updateDraggable to fix JVM signature clash
- Add animate parameter to configureDetents - Use setPeekHeight with animate flag when sheet is presented - Remove unnecessary footerView.post wrapper
- Restore translationY logic in animator for child sheets - Remove duplicate setStateForDetentIndex call in onDialogShow - Position sheet off-screen before animation starts - Clean up debug logging
- Re-apply isHideable after dialog show to fix dismissible - Move isAnimating check to early return in onSlide - Clean up debug logging
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
🚀 This pull request is included in v3.5.1-beta.1. See Release 3.5.1-beta.1 for release notes. |
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.
Summary
Refactors Android implementation to use
BottomSheetDialogFragmentinstead ofBottomSheetDialogfor better lifecycle management and flexibility.Changes
New Files
TrueSheetDialogFragment.ktincore/: CustomBottomSheetDialogFragmentthat handles:Modified Files
TrueSheetViewController.kt: Refactored to use the new fragmentTrueSheetDialogFragmentDelegatefor callbacksFragmentManager.show()Key Implementation Details
TrueSheetAnimatorhandles presentation animation withtranslationYsinceonSlidedoesn't fire for all sheet configurationsisHideableis re-applied after dialog show to fixdismissiblepropkeyboardDidChangeHeightconfigureDetentsacceptsanimateparam for content size changesTesting