The person who posted it Ben TrengroveAndroid Developer Communication Engineer
Today, as part of the January 24th Bill of Materials, we’re releasing version 1.6 of Jetpack’s modern, native UI Toolkit for Android, a text editor for use with apps like Threads, Reddit, and Dropbox. This release focuses mostly on performance improvements, as we continue to improve and improve the API. We are improving the efficiency of core components.
To take advantage of today’s release, upgrade your BOM Write version to 2024.01.01
Performance continues to be our top priority, and this release of Compose has significant performance improvements across the board. We are seeing more. ~20% improvement in scrolling performance And a ~12% improvement in launch time by our standards, and that’s on top of the updates released on August 23rd. As with that release, most apps will see these benefits simply by upgrading to the latest version, with no additional code changes required.
The scrolling performance and startup time improvements come from our continued focus on memory allocations and lazy startup, to ensure that the framework is only running when it’s needed. These improvements can be seen across all APIs in text, especially the text, clickable, lazy lists, and graphics APIs, including vectors, and are partially due to the Modifier.Node refactor work that has been going on for several releases.
There is also a new guide for you to create your own custom modifiers with Modifier.Node.
Setting up the stability of external components
Compose compiler 1.5.5 introduced a new compiler option to provide a configuration file that your application considers stable. This option allows you to mark any class as stable, including your own modules, external library classes, and standard library classes, without having to modify or package these modules in a stable package class. Note that the standard stability term applies; This is another convenient way to let the Compose compiler know that your application should be considered stable. See our documentation for more information on how to use stability configuration.
Generated code execution
The code generated by the Compose compiler plugin has also been improved. Small tweaks in this code can lead to big performance improvements as the code is generated in each compiled function. Write state objects to determine which combinations to recompile when the compiler tracks a value change. However, many state values are only read once, and some state values are never read but still change frequently! This modification allows the compiler to bypass the tracer when it is not required.
Compiler 1.5.6 enables intrinsic memory by default. This mode changes keep in mind We already have any parameters for processing that are used as keys to take data into account during compilation. keep in mind. This will speed up the calculation that determines whether an expression to remember needs to be reevaluated, but only if you put a breakpoint in it. keep in mind During debugging, the function can no longer be called, because the compiler has removed its use keep in mind And replaced with a different code.
Integrated objects are not being skipped
We’re investing in automating the code you write to make it more efficient. We want to make it easier for you to code with the code you know, eliminating the need to dive deep into it.
This text editor release adds support for what we call a test modeStrong jump modeHe said. Strong skip mode relaxes some of the rules where some changes can skip resets, moving the balance towards what developers expect. With strong skip mode enabled, compounds with unstable parameters can also skip reprocessing if identical instances of objects are passed to the parameters. Additionally, a strong skipping mode remembers lambdas in settings that contain unstable values in addition to the current default behavior of only remembering stable captures. Hard jump mode is currently experimental and disabled by default because we don’t consider it ready for production yet. We are evaluating the results before planning to turn it on by default in text editor 1.7. Check out our guide to testing hard jump mode and help us find any issues.
Changes to default fonts
This release does it now Includes FontPadding Composition False By default. Includes FontPadding It’s a primitive property that adds extra padding based on the font parameters at the bottom of the first line and the bottom of the last line of text. Defaulting this setting to false makes it easier to match the default text position to design specifications created by custom design tools. After upgrading to the January 24th release, you may notice small changes to your text layout and screenshot tests. For more information about this setting, see Editing a text blog and the developer documentation.
Support for offline font scaling
The January 24th release uses a non-standard font size for better text readability and accessibility. A non-standard font scale prevents large text elements on the screen from becoming too large by applying a non-linear warping curve. This scaling strategy means that large text is not scaled the same as small text.
drag and drop
Compose Foundation adds support for drag-and-drop at the platform level, allowing content to be dragged between applications on a device running in multi-window mode. The API is 100% compatible with the View APIs, meaning that drag and drop from a view can be done to a text editor and vice versa. See the code sample for using this API.
Other features landed in this release include:
- Support b LookheadScope In the lazy details.
- Fixed combinations that are inactive but remain in the lazy list for reuse are not filtered out of semantic trees by default.
- Spline-based keyframes in animation.
- Added support for mouse selection, including text.
We’re grateful for bug reports and feature requests submitted to our issue tracker – they help us write and build the APIs you need. Keep giving your feedback, and help us make writing better!
Wondering what’s next? Check out our roadmap to see the features we’re thinking and working on right now. We can’t wait to see what they build next!