Repository navigation
3.0.0-beta03
Pre-releaseThis release introduces the standalone salt-adaptive-window module and an adaptive modal Sheet, fixes Linux window interactions, and updates Compose Multiplatform and Navigation 3.
The changes below are relative to 3.0.0-beta02.
Adaptive Window
Added salt-adaptive-window, a shared window-information API for Android, Desktop, and iOS:
- Read the current window's size in dp, size class, and device form factor through
LocalSaltAdaptiveWindow.current. - Classify window widths as Compact, Medium, or Expanded, responding to resizing, rotation, and split-screen changes.
- Track each Desktop window independently and use the current window's dimensions on iOS.
- Obtain window information automatically, without adding a Provider at the application or theme level.
- Override window information with
ProvideSaltAdaptiveWindowfor previews and controlled scenarios.
The module is included transitively by salt-ui, so no additional dependency is needed. It can also be used independently:
implementation("io.github.moriafly:salt-adaptive-window:3.0.0-beta03")Window size and device form factor are exposed separately. A tablet in a narrow split-screen window can still be Compact; layouts should follow the available window space.
Adaptive Sheet
Added com.moriafly.salt.ui.sheet.Sheet, supporting bottom and centered floating presentations.
By default, Sheet uses Floating when its owning window is at least 600 dp wide and 480 dp high, and Bottom otherwise. The presentation mode can also be selected explicitly.
Sizing and Interaction
- Supports Content, Medium, Large, fixed-height, and fractional height detents.
- Supports dragging between detents and dragging to dismiss in Bottom mode.
- Offers expand-first and scroll-first nested scrolling.
- Supports titles, actions, safe areas, and keyboard avoidance.
- Provides Inset and EdgeToEdge content layouts for handling bottom padding in scrolling content.
- Uses interruptible spring animations, including reopening during dismissal.
- Overlaps outgoing and incoming animations when replacing sheets, with scrims and input coordinated by the owning window.
Dismissal and State
- Independently controls dismissal through outside clicks, Back / Escape, dragging, and the close button.
- Uses
visibleandonDismissRequestfor visibility, allowing callers to reject dismissal requests. - Adds
SheetState.isHiddenandawaitHidden()so navigation can wait for the exit to finish before removing a page. - Clears saveable content state and resets the selected detent after a complete dismissal by default.
- Supports
retainStateWhenHidden = trueto restore saveable state and the selected detent after temporary hiding, such as when returning to a parent sheet. Ordinaryremembervalues and composition effects are still disposed.
Keep the Sheet call in composition and control visibility through visible so its exit animation can finish. Only one Sheet per owning window may have visible = true. To replace one, hide the current sheet and show the next in the same state update.
On Desktop with compose.layers.type=COMPONENT or WINDOW, dismissing a Sheet immediately removes its native Popup to release background input, so these backends do not retain the visual exit animation.
Existing BottomSheetScaffold and BottomSheetDialog remain available and require no migration.
Desktop Window Fixes
- Fixed clicks failing to restore window focus after switching applications on Linux X11.
- Fixed Linux window dragging and resizing while overlays are visible.
- Fixed cursor updates stopping after leaving a Linux window's resize edge.
- Fixed Sheet scrims covering Linux window shadows and rounded corners.
- Limited
CaptionBarHitTestto one active instance per SaltUI window to prevent conflicting regions.
Custom caption bars should keep CaptionBarHitTest at window level inside a SaltWindow or SaltDialogWindow, avoiding duplicate declarations in overlapping page-animation branches. Duplicate instances, or use outside a SaltUI window scope, now throw an exception.
Controls and Samples
- Added a
sizeparameter toPillButtonandBasicPillButton, inheritingLocalControlSizeby default and aligning their height, icons, and spacing with buttons of the same size. - Migrated sample navigation to
SaltNavigator. - Added examples for Sheet configuration, draft confirmation, parent-sheet state retention, and overlapping replacements.
- Included
salt-adaptive-windowin snapshot publishing.
Dependency Updates
- Compose Multiplatform:
1.12.1→1.12.2. - Corresponding Jetpack Compose dependencies:
1.12.1→1.12.2. - Compose Multiplatform Navigation 3 integration:
1.1.2→1.2.0-rc01.
Documentation Updates
- Updated the dependency examples and version compatibility table in the README.
- Moved the Sheet and adaptive-window documentation to the Moriafly documentation site and added them to the SaltUI navigation.
- Updated the adaptive-window documentation to describe automatic window information, window dimensions, preview overrides, and Sheet's adaptive presentation rules.
Sheet documentation · Adaptive window documentation
New APIs are marked @UnstableSaltUiApi or @UnstableSaltAdaptiveWindowApi and remain subject to revision before the stable release.