-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(ui): add foldable device support with auto split-screen #10358
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
Open
someonesocial
wants to merge
18
commits into
thunderbird:main
Choose a base branch
from
someonesocial:feature/foldable-auto-split-final
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(ui): add foldable device support with auto split-screen #10358
someonesocial
wants to merge
18
commits into
thunderbird:main
from
someonesocial:feature/foldable-auto-split-final
Conversation
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
…d lifecycle behavior
…uild.gradle.kts" This reverts commit b49111d.
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
Adds automatic split-screen layout switching for foldable devices. Users can select "When device is unfolded" in the split-screen settings, and the app will automatically adapt the layout based on the device's fold state.
Motivation
Foldable devices like Galaxy Z Fold series offer both compact (folded) and tablet-like (unfolded) form factors. Users need a way to automatically switch between single-pane and split-view layouts based on the device's current state, providing the optimal experience for each form factor.
Changes
Core Components Added
WindowInfoTrackerStateFlow<FoldableState>for reactive updatescore/ui/compose/common/src/main/kotlin/.../window/FOLDED: Device is foldedUNFOLDED: Device is unfolded or half-openedUNKNOWN: Not a foldable device or state cannot be determinedSettings Integration
WHEN_UNFOLDEDtoSplitViewModeenum incore/preference/apiMainActivityTests & Documentation
Dependencies
androidx.window:window:1.3.0togradle/libs.versions.tomlTechnical Details
Architecture
core:ui:compose:common(not in legacy modules) ✓State Flow
How It Works
FoldableStateObservermonitors device state using WindowManagerFoldableStatevia StateFlowrecreate()to switch layoutsTesting
Unit Tests
testSubjectnaming, AssertK assertionsManual Testing Checklist
Build & Quality Checks
Backward Compatibility
✅ Fully backward compatible
Performance Considerations
Known Limitations
recreate()for simplicity)Security & Privacy
Accessibility & i18n
Checklist
Code Quality
core:*modules, notlegacy:*✓Documentation
Testing
Process
Related Issues
No existing issue - community contribution
Documentation
docs/developer/foldable-device-support.mdFoldableStateObserver.ktNotes for Reviewers
This is my first open source contribution to Thunderbird Android.
What I focused on:
Questions/Areas for feedback:
I'm ready to address any feedback and make changes as needed. Thank you for reviewing! 🙏
Implementation Details:
core:ui:compose:common,core:preference:api,legacy:ui:legacyandroidx.window:window:1.3.0