1.6.0
Changes since 1.5.12
Highlights
An overview of highlights for this release is also available in the Compose Multiplatform documentation: What's new in 1.6.0.
Common
- Resource library improvements (an example project)
- Experimental support is available for tests in common code
- Support Kotlin 2.0.0-Beta4
iOS, Desktop, Web
- Support
LineHeightStyle.Trim
- Add a way to use fonts installed on the system
- Add support for text decoration line styles via PlatformTextStyle
iOS
- Native-like caret behaviour by long/single taps in textfields(1, 2)
- Basic accessibility support
- Popups/Dialogs can now be displayed outside a ViewController over native components
- Allow selecting
Text
inSelectionContainer
by double and triple tap
Web
- Compose for Web (Wasm) artifacts are available in Maven Central Warning: Kotlin 1.9.21 has an issue with web target. Use Kotlin 1.9.22.
Desktop
- Proper clipping of
SwingPanel
interop (under an experimental flag, see the link) - Popups/Dialogs can now be displayed outside the main window or panel and over native components (under an experimental flag, see the link)
Breaking changes
Common
- Resource library (
compose.components.resources
) changes- resources from
*Main\resources
should be moved to*Main\composeResources\drawable
,commonMain\composeResources\font
or*Main\composeResources\files
depending on the resource type painterResource("resource.xml")
should be replaced bypainterResource(Res.drawable.resource)
- resources from
google()
maven repository is now required. Add this tobuild.gradle.kts
:If the project doesn't have it, there will be an errorrepositories { ... google() }
Could not find androidx.annotation:annotation:...
orCould not find org.jetbrains.compose.collection-internal:collection
.- Text with
lineHeight
set is trimmed by default - Text with
fontSize
set withoutlineHeight
insideMaterialTheme
has different line height
iOS/Desktop/Web
- Deprecate
public ComposeScene
in favour of@InternalComposeUiApi MultiLayerComposeScene
- Hide deprecated DropdownMenu overloads
Desktop
Web (k/js)
- Libraries which depend on earlier Compose Multiplatform version are not compatible with 1.6.0 anymore. This is because decoys generation was disabled. Projects which apply Compose Compiler plugin manually need to remove this argument:
plugin:androidx.compose.compiler.plugins.kotlin:generateDecoys=true
.
Features
Common
iOS
- Adjust overscroll effect params to match iOS animations
- Add ability to change opacity for compose view
- Introduce
@Composable fun UIKitViewController
- Remove iOS experimental flag in gradle.properties
Desktop
- Support select till the end of the file / till the start of the file keyboard actions on Windows
- Add LinuxArm64 target to Compose runtime
- Add dedicated feature flags class for desktop
Web
HTML library
Gradle Plugin
Fixes
iOS/Desktop/Web
- Fix "DropdownMenu performs onDismissRequest twice"
- Use a large rectangle for the picture bounds in RenderNodeLayer.drawLayer to prevent clipping
- Fix closing scene during scroll animation
- Fix "Using
painterResource(:DrawableResource)
outside desktop Window can produceUnsatisfiedLinkError
" - Fix "Rect::makeLTRB expected l <= r" crashes
- Fix "
TextLayoutResult#getLineForVerticalPosition
returns wrong value + slow performance" - Run all effects before sending synthetic events
Font
constructor with lazy data loading- Optimise
TextLayoutResult#getLineForOffset
- Fix "SwingPanel/UIKitView doesn't apply Modifier.offset if it's after Modifier.size"
- DatePicker. Fix empty row
- DatePicker. Fix selection of the current day
- Fix
LayoutCoordinates.localToWindow
coordinates conversion for non-full Compose components
iOS
- Fixed unexpected fling animation over scrolling content
- Fix UIKitView z-order
- Fix missing case for loading
SystemFont
on iOS - Fix selection container crash
- Fix
WindowInfo.containerSize
withoutplatformLayers
flag - Disable encoding on separate thread for iOS
- Synchronise IME insets with iOS keyboard
Desktop
- Protect against
MouseInfo.getPointerInfo()
returning null inWindowDraggableArea
- Support Rtl in
SplitPane
- Fix a native crash on
makeGL
- Add Arial and Consolas as backup fonts on Linux and mention font name when one fails to load
- Fix blurry app icon in the system application switcher
- Insert a new line on
NumPadEnter
- Don't restart the drag gesture when the
onDrag(matcher=
changes - Fix "Resizing window on desktop sometimes triggers onClick handlers of Composables"
- Fix "
ComposePanel
doesn't calculate its preferredSize correctly when it's called before doLayout" - Fix input methods on JBR, disable input methods when we lose focus
- Fix "BasicTextField could not input any Chinese character when using JBR"
- Take into account
enabled
inscrollable
for mouse input - Fix NPE for getComponentAfter/Before in ComposePanel
- Transparency support for D3D (previously it supported via fallback on OpenGL)
Web
- Add a
SystemThemeObserver
implementation for wasmJs - Fix keyboard events with meta key on wasm/js targets
- Added WASM to
components.uiToolingPreview
library - Fix "The cursor is invisible in compose web"
- Use an alternative implementation of
Image.toBitmap
Gradle Plugin
Dependencies
This version of Compose Multiplatform is based on the next Jetpack Compose libraries:
See the announce of Jetpack Compose 1.6. Notes:
Changes to default font padding
affects only Android target.Added support for selection by mouse, including text.
concerns only Android. Other targets supported it before 1.6.- Some of the features are not ported yet (they will be ported in the next versions):
- BasicTextField2
- Support for nonlinear font scaling
- Multipaltform Drag and drop. It works only for Android right now. For desktop there is the old API
Modifier.onExternalDrag
- MultiParagraph.fillBoundingBoxes
See the announce of Material 1.2.