Фонд «Композиции»
androidx.compose.foundation
androidx.compose.foundation.layout
androidx.compose.foundation.жесты
androidx.compose.foundation.selection
androidx.compose.foundation.lazy
androidx.compose.foundation.interaction
androidx.compose.foundation.text
( См. справочную документацию API для всех пакетов Compose )
| Последнее обновление | Стабильный релиз | Кандидат на релиз | Бета-версия | Альфа-релиз |
|---|---|---|---|---|
| 22 октября 2025 г. | 1.9.4 | - | 1.10.0-бета01 | - |
Структура
Compose — это комбинация из 7 идентификаторов групп Maven в androidx . Каждая группа содержит определённый набор функций, каждый из которых сопровождается собственным набором заметок о выпуске.
В этой таблице объясняются группы и ссылки на каждый набор заметок о выпуске.
| Группа | Описание |
|---|---|
| compose.animation | Создавайте анимацию в своих приложениях Jetpack Compose, чтобы обогатить пользовательский опыт. |
| compose.компилятор | Преобразуйте функции @Composable и включите оптимизацию с помощью плагина компилятора Kotlin. |
| compose.foundation | Создавайте приложения Jetpack Compose с помощью готовых строительных блоков и расширяйте базу для создания собственных элементов системы проектирования. |
| сочинить.материал | Создавайте пользовательские интерфейсы Jetpack Compose с помощью готовых компонентов Material Design. Это высокоуровневая точка входа в Compose, предназначенная для предоставления компонентов, соответствующих описанным на сайте www.material.io. |
| compose.material3 | Создавайте пользовательские интерфейсы Jetpack Compose с компонентами Material Design 3 — следующим этапом развития Material Design. Material 3 включает в себя обновлённые темы и компоненты, а также функции персонализации Material You, такие как динамическая подсветка, и разработан для соответствия новому визуальному стилю и пользовательскому интерфейсу Android 12. |
| compose.runtime | Основные строительные блоки модели программирования Compose и управления состоянием, а также основная среда выполнения для целевого плагина компилятора Compose. |
| compose.ui | Основные компоненты пользовательского интерфейса, необходимые для взаимодействия с устройством, включая макет, рисование и ввод. |
Объявление зависимостей
Чтобы добавить зависимость от Compose, необходимо добавить репозиторий Google Maven в свой проект. Подробнее см. в репозитории Google Maven .
Добавьте зависимости для необходимых артефактов в файл build.gradle вашего приложения или модуля:
Groovy
dependencies { implementation "androidx.compose.foundation:foundation:1.9.4" } android { buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Kotlin
dependencies { implementation("androidx.compose.foundation:foundation:1.9.4") } android { buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Дополнительные сведения о зависимостях см. в разделе Добавление зависимостей сборки .
Обратная связь
Ваши отзывы помогают улучшить Jetpack. Сообщите нам, если вы обнаружите новые проблемы или у вас есть идеи по улучшению этой библиотеки. Пожалуйста, ознакомьтесь с уже существующими проблемами в этой библиотеке, прежде чем создавать новую. Вы можете проголосовать за существующую проблему, нажав на кнопку со звёздочкой.
Более подробную информацию см. в документации по системе отслеживания проблем .
Версия 1.10
Версия 1.10.0-beta01
22 октября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-beta01 . Версия 1.10.0-beta01 содержит следующие коммиты .
Изменения API
- Обновляет все API косвенного касания, чтобы использовать имя API косвенного указателя для соответствия API ввода указателя. ( I238ce , b/451607214 )
- Аннотированный
PagerState.currentPageOffsetFractionс@FrequentlyChangingValue. ( Idfaab )
Исправления ошибок
- Исправлено поведение бегущей строки для направлений макета RTL. ( Ib8be3 )
Версия 1.10.0-альфа05
8 октября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-alpha05 . Версия 1.10.0-alpha05 содержит следующие коммиты .
Изменения API
-
PaddingValuesтеперь поддерживает сложение и вычитание для упрощения общих вычислений заполнения. ( I327e1 , b/244468479 )
Исправления ошибок
-
ComposeFoundationFlags.isPausableCompositionInPrefetchEnabledвключен по умолчанию. Это оптимизация производительности, которая позволяет лучше распределить работу, необходимую во время предварительной выборки. Например, мы можем выполнить компоновку только для частей следующего элементаLazyColumnв одном кадре пользовательского интерфейса, а затем продолжить компоновку оставшейся части в следующих кадрах. ( I4c7fe )
Версия 1.10.0-альфа04
24 сентября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-alpha04 . Версия 1.10.0-alpha04 содержит следующие коммиты .
Изменения API
- Добавлена реализация
ScrollIndicatorStateдляPagerState. ( I113b7 ) - Добавлена реализация
ScrollIndicatorStateдляLazyStaggeredGridState. ( I1028e ) - Добавлена реализация
ScrollIndicatorStateдляLazyGridState. ( I9e50c ) - Добавлена реализация
ScrollIndicatorStateдляLazyListState. ( I5ee29 ) - Добавлена реализация
ScrollIndicatorStateдляScrollState. ( I27f66 ) - Ввести свойство
scrollIndicatorStateв интерфейсScrollableState( Idca93 ) - Флаг
isWindowInsetsModifierLocalNodeImplementationEnabledбыл удален ( I15e8f , b/440964232 ) - Предоставьте модификатор
scrollableArea(), который можно использовать, чтобы сделать компонент прокручиваемым с поведением обрезки содержимого по его границам и автоматической обработки направления прокрутки содержимого на основе ориентации, RTL и флагаreverseScrolling. ( I9471b , b/316559454 )
Версия 1.10.0-альфа03
10 сентября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-alpha03 . Версия 1.10.0-alpha03 содержит следующие коммиты .
Изменения API
- Удаляет
ComposeFoundationFlags.isNonComposedClickableEnabled( I0dfc0 , b/406228525 ) - Перенесите фабричные функции для создания экземпляров
FillableDataв сопутствующий объект. Вместо вызоваFillableData(value)используйте новые фабричные методы:FillableData.createFrom(value). ( I2e200 , b/441719650 ) - Введен
BeyondBoundsLayoutModifierNode— новый узел-модификатор для выполнения макета за пределами границ для поиска фокуса. ( I39be1 , b/416133658 ) -
ScrollState.valueотмечено как свойство@FrequentlyChangingValue. ( I4723d ) - Представлен
LazyLayoutKeyIndexMapи фабрика для реализации по умолчанию. ( I4fd0c , b/415038029 )
Исправления ошибок
- Столбец и строка теперь правильно передают фактический размер элемента в
Modifier.align, что решает проблему, из-за которой пользовательская реализацияModifier.alignполучала неверное значение 0. ( I8194f , b/439716351 )
Версия 1.10.0-альфа02
27 августа 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-alpha02 . Версия 1.10.0-alpha02 содержит следующие коммиты .
Изменения API
- Удален флаг
isFlingContinuationAtBoundsEnabled. ( I6b84f ) - Удален флаг
isAdjustPointerInputChangeOffsetForVelocityTrackerEnabled. ( I62380 ) - Удален флаг
isOnScrollChangedCallbackEnabled. ( I667dc ) - Удален флаг
isAutomaticNestedPrefetchEnabled. ( I4f416 ) - Удален флаг
DragGesturePickUpEnabled. ( Ib8500 ) - Представлен API
ScrollIndicatorStateдля представления состояния полосы прокрутки ( I5e229 )
Исправления ошибок
- Исправлена ошибка, из-за которой использование
Modifier.anchoredDraggableне приводило к вызовуconfirmValueChange. ( Iff7cc )
Версия 1.10.0-альфа01
13 августа 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.10.0-alpha01 . Версия 1.10.0-alpha01 содержит следующие коммиты .
Изменения API
- Обновить стратегию предварительной выборки Pager, чтобы использовать окно кэша вместо одного элемента по умолчанию в направлении прокрутки. Теперь начальная предварительная выборка в Pager включена по умолчанию и будет основана на размере окна, равном одному окну просмотра, то есть мы попытаемся заполнить один участок просмотра предварительно выбранными элементами. Элементы также будут храниться дольше. ( I4d45e , b/292136289 )
- Добавлен флаг
ComposeFoundationLayoutFlags.isWindowInsetsOptimizationEnabled, позволяющий отключить оптимизацию производительностиWindowInsets, если новая реализация приведет к изменению поведения. ( I8e912 ) -
SnapFlingBehaviorтеперь допускает превышение значений спецификаций анимации привязки во время привязки. Это позволяет, например, спецификации упругой пружины в качествеsnapAnimationSpecсоздавать упругую анимацию привязки. Значения превышения значений по-прежнему игнорируются при выполнении подхода с использованием спецификации привязки. ( I373c2 ) - Наведение указателя мыши или сенсорной панели в
ComposeViewтеперь автоматически снимает фокус, если наведение указателя не происходит в пределах сфокусированного узла. Это приводит к пользовательскому опыту, характеризующемуся «нажатием для снятия фокуса», что более ожидаемо, чем текущее поведение при использовании устройств ввода с указателем. От этого поведения можно отказаться с помощью нового APIAbstractComposeView.isClearFocusOnPointerDownEnabled. ( I6322b , b/282963174 ) - Теперь Scrollable лучше поддерживает двумерные события прокрутки колесика мыши. Добавлен новый тестовый API для тестирования вариантов использования в
MouseInjectionScope. Мы также добавили новую перегрузку для методов прокрутки вMouseInjectionScopeи флаг для управления новым поведением —isMouseWheel1DAxisLockingEnabled( I136df ). - Обновлён
DragGestureNodeдля использования необработанного ввода указателя вместо приостановки ввода указателя для оптимизации. Изменения добавлены после флагаisNonSuspendingPointerInputInDraggableEnabled( I0fa4b ). - Некоторые API
AnchoredDraggableаннотированы с помощью@FrequentlyChangingValue.offset,requireOffsetиprogressчасто меняются и не должны считываться в процессе композиции. Вместо этого обращайтесь к этим значениям из макета и отрисовывайте фазы, эффекты или иным образом вне процесса композиции. ( I05539 ) - Удалены флаги
isOnScrollChangedCallbackEnabled,isAdjustPointerInputChangeOffsetForVelocityTrackerEnabled,isFlingContinuationAtBoundsEnabled,isAutomaticNestedPrefetchEnabled,DragGesturePickUpEnabled,isPointerInteropFilterDispatchingFixEnabled,isNestedScrollInteropPostFlingFixEnabled,isNestedScrollDispatcherNodeFixEnabled( I36c18 ). - Введен
CompositionLocal, который можно использовать для изменения кисти подсветки успешного заполнения Autofill. ( I52329 ) - Добавлена настраиваемая область фокусировки в
FocusProperties. Теперь вы можете определить собственную область фокусировки вместо использования ограничивающего прямоугольника фокусируемого элемента по умолчанию. Эта информация используется системой перемещения фокуса и логикой удержания в поле зрения прокручиваемых контейнеров. ( Id6555 , b/368378073 ) - Добавлен новый режим
LineHeightStyle.Modeпод названиемTight. Этот режим помогает добиться меньшей высоты строк, даже если это может привести к обрезанию более высоких глифов. ( Id3849 ) - Представлен новый интерфейс Interpolatable, который позволяет автоматически интерполировать различные типы, предполагая, что один тип умеет преобразовывать другой. Этот интерфейс используется в нескольких типах компоновки, таких как Brush и Shape, но может использоваться и извне. ( I58eab )
- Добавляет косвенные входные события и способ указания осей координат, используемых для прокрутки. ( I58e7c )
- Добавляет новый API
WindowInsets.cutoutPathдля получения пути к вырезу на дисплее ( Ib90b1 , b/279636456 ). - Флаг
isWindowInsetsDefaultPassThroughEnabledбыл удален, что по умолчанию отключает потребление WindowInsets, так что дочерние представления могут получатьWindowInsetsпо умолчанию. ( I888e0 , b/412469666 )
Исправления ошибок
-
isNonSuspendingPointerInputInDraggableEnabledна данный момент следует отключить. ( Ia41c4 ) - Перемещение minSdk по умолчанию из API 21 в API 23 ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
- Обновлена документация
minPosition/maxPositionDraggableAnchorsс целью указать, что эти API должны возвращать Float.NaN в соответствии с другими APIDraggableAnchors. ( I0460a ) - Исправлена ошибка, из-за которой
DraggableAnchors#closestAnchorаварийно завершал работу, если якоря были пустыми ( I4e646 ). - Улучшения производительности для
DraggableAnchors( If4065 , I0460a ) -
TextFieldState.edit { }больше не очищает историю отмены. Вместо этого создаётся отдельная запись отмены. Если требуется очистить стек отмены после вызоваedit, используйтеTextFieldState.undoState.clearHistory(). ( I12c14 ) - Добавлена поддержка двойного нажатия для выбора слова в перегрузке
SelectionContainerиBasicTextField(value, onValueChange). ( Ibb06a ) - Исправлена небольшая ошибка, делающая
AutoboxingStateValuePropertyDetectorсовместимым как с K1, так и с K2 ( Ie81c1 ). - Запросы
requestRectangleOnScreen, отправляемые AndroidViews, теперь корректно передаются в Compose. Это помогает таким представлениям, какEditText, оставаться на экране при взаимодействии с ними. ( Ibbf4c ) - Column и Row теперь правильно передают фактический размер элемента в
Alignment.Vertical.alignиAlignment.Horizontal.align, что решает проблему, из-за которой пользовательские реализации выравнивания получали неверное значение 0. ( I3e460 , b/349722072 )
Версия 1.9
Версия 1.9.4
22 октября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.4 . Версия 1.9.4 содержит следующие коммиты .
Версия 1.9.3
8 октября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.3 . Версия 1.9.3 содержит следующие коммиты .
Версия 1.9.2
24 сентября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.2 . Версия 1.9.2 содержит следующие коммиты .
Версия 1.9.1
10 сентября 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.1 . Версия 1.9.1 содержит следующие коммиты .
Исправления ошибок
- Исправлен сбой, возникающий при использовании
LazyLayoutCacheWindowвLazyLists( c39f5f3 ).
Версия 1.9.0
13 августа 2025 г.
Выпущена версия androidx.compose.foundation:foundation-*:1.9.0 . Версия 1.9.0 содержит следующие коммиты:
Важные изменения с версии 1.8.0
- Для проверок lint, поставляемых вместе с Compose, теперь требуется версия AGP не ниже 8.8.2. Если вы не можете обновить AGP, вы можете обновить Lint самостоятельно, указав
android.experimental.lint.version=8.8.2(или более новую версию) в файлеgradle.properties. Для запуска проверок lint Compose в среде IDE требуется Android Studio Ladybug или более новая версия. - Критическое изменение: перегрузки
clickable,combinedClickable,selectable,toggleableиtriStateToggleableбез параметра Indication теперь поддерживают только экземплярыIndicationNodeFactory, предоставленные с помощьюLocalIndication. Это изменение вступит в силу при перекомпиляции использований этих модификаторов с использованием этой версии Compose. Бинарные/транзитивные зависимости не затронуты. Если вы предоставляете устаревшую реализацию Indication дляLocalIndicationи используете эти API, это приведет к сбою во время выполнения. Это изменение поведения необходимо для повышения производительности и позволяет функциям Composable, использующим эти модификаторы, пропускать рекомпозицию. Вы можете использоватьComposeFoundationFlags.isNonComposedClickableEnabled=false, чтобы временно отказаться от этого изменения поведения и разрешить обновление Compose без блокировки при этой миграции. Этот флаг будет удален после одного стабильного выпуска. Для решения этой проблемы перенесите все устаревшие реализации Indication на использованиеIndicationNodeFactory. Вы также можете использовать перегрузки с явным параметром Indication — эти перегрузки будут продолжать поддерживать не-IndicationNodeFactoryэкземпляры Indication, хотя это не рекомендуется по соображениям производительности. ( I6bcdc , b/316914333 ) - Добавлено
isFlingCancellationWithNestedScrollFixEnabledдля исправления проблемы с распространением мелькания при вложенной прокрутке. В этом CL мы восстанавливаем поведение продолжения мелькания, удалённое в I9326a . Мы по-прежнему будем отменять анимацию мелькания при удалении дочернего элемента из композиции. ( I467f4 , b/405910180 , b/419049142 , b/416784125 ) - Повторно добавлено использование
scrollAnimationSpecвContentInViewNode. Это поведение было удалено во время прекращения поддержкиscrollAnimationSpec, что привело к нарушению вариантов использования. ( I1436a , b/403301605 ) - Стабилизированный
LazyLayout( If5db4 ),LazyLayoutPrefetchStateи его методы планированияschedulePrecompositionиschedulePrecompositionAndPremeasure( I4362f , b/252853717 ) иLazyLayoutItemProvider( Icce09 , b/261565751 ) - Разрешить Compose вызывать
ViewTreeObserver.OnScrollChanged. Это поведение реализовано с помощью флагаisOnScrollChangedCallbackEnabled. Мы также добавили функцию расширенияDelegatableNode dispatchOnScrollChanged. ( I34b9d , b/238109286 ) - Представлены
Modifier.scrollable2D,Scrollable2DStateи сопутствующие API для создания состояний. Также представлены общие функции расширения прокрутки. ( Ic61c8 , b/214410040 ) -
PrefetchSchedulerи настройка были объявлены устаревшими в пользу внутренней реализации, которая выполняет всю работу автоматически. ( I3a9a6 , b/420551535 ) -
TextFieldState.edit { }больше не очищает историю отмены. Вместо этого создаётся отдельная запись отмены. Если требуется очистить стек отмены после вызова редактирования, используйтеTextFieldState.undoState.clearHistory(). ( I12c14 ) - Контекстное меню и панель инструментов выбора теперь поддерживают смарт-элементы (умный выбор)
- Добавлен стилизованный текст
OutputTransformation, позволяющий стилизовать выводTextFieldс использованием перегрузкиstate. -
TextField: поддержка контекстного меню (меню, вызываемое правой кнопкой мыши). - Текст, скопированный из нескольких текстовых компоновщиков в
SelectionContainer, теперь будет иметь разделитель строк \n, добавленный между текстом, поступающим из отдельных текстовых компоновщиков. ( I25332 , b/285036739 ) - Представить API для создания пользовательских маркированных списков через
AnnotatedString( I1d066 , b/383269496 , b/139326648 ) - Перегрузка
stateBasicTextFieldбудет сохранять курсор прокрученным в поле зрения при изменении его размера. ( I0eb41 , b/406187741 ) - Критическое изменение: узлы модификаторов
backgroundиborderтеперь реализуютSemanticsModifierNode. Это может привести к добавлению новыхSemanticsNodesв дерево семантики и, следовательно, к сбоям в тестах, делающих предположения о его структуре. Например, тесты, использующиеonChild,onParent,onSiblingи другие подобные методы для проверки утверждений, могут завершиться сбоем, если между текущим и целевым узлами добавляется новый узел. Предпочтительный способ исправления этих сбоев — непосредственное добавлениеtestTagк целевому узлу. Другой подход — использование более свободного сопоставления, например,onNode(hasAnyAncestor(hasText("ancestor")) and hasText("target")). ( I638b5 )
Версия 1.9.0-rc01
30 июля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-rc01 . Версия 1.9.0-rc01 содержит следующие коммиты .
Исправления ошибок
-
TextFieldState.edit { }больше не очищает историю отмены. Вместо этого создаётся отдельная запись отмены. Если требуется очистить стек отмены после вызоваedit, используйтеTextFieldState.undoState.clearHistory(). ( I12c14 )
Версия 1.9.0-beta03
16 июля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-beta03 . Версия 1.9.0-beta03 содержит следующие коммиты .
Исправления ошибок
- Исправлена регрессионная ошибка, нарушавшая поведение закрепленных заголовков в ленивых сетках при предоставлении пустого содержимого заголовка. ( e3e3400 )
Версия 1.9.0-beta02
2 июля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-beta02 . Версия 1.9.0-beta02 содержит следующие коммиты .
Новые функции
- Поддержка смарт-элементов в контекстном меню и панели инструментов выбора.
Изменения API
- Исправлена ошибка, из-за которой некоторые аппаратные клавиатуры или пульты дистанционного управления телевизорами не перемещали курсор в новых
TextFieldsс помощью клавиш управления курсором, а вместо этого переключали фокус на другой компонуемый элемент. ДобавленComposeFoundationFlag.isTextFieldDpadNavigationFixEnabled, позволяющий временно отключить это исправление, если оно приводит к неустранимым нежелательным последствиям. ( Ie1922 )
Исправления ошибок
- Исправлена ошибка, из-за которой закрепленные заголовки не сохранялись при наличии закрепленного элемента. ( I9198d , b/385006133 )
-
TextObfuscationMode.RevealLastTypedтеперь соответствует системной настройке «TEXT_SHOW_PASSWORD». ( I41c0c ) - Исправлена ошибка, из-за которой
BasicTextFieldошибочно отображал предупреждение «Данные вставлены из буфера обмена» при первом открытии текстовой панели инструментов. ( I5fda2 )
Версия 1.9.0-beta01
18 июня 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-beta01 . Версия 1.9.0-beta01 содержит следующие коммиты .
Критические изменения
- Узлы модификаторов
backgroundиborderтеперь реализуютSemanticsModifierNode. Это может привести к добавлению новыхSemanticsNodesв дерево семантики и, следовательно, к сбоям в тестах, делающих предположения о его структуре. Например, тесты, использующиеonChild,onParent,onSiblingи другие подобные методы для проверки утверждений, могут завершиться сбоем при добавлении нового узла между текущим и целевым узлами. Предпочтительный способ устранения этих сбоев — непосредственное добавлениеtestTagк целевому узлу. Другой подход — использование более свободного сопоставления, напримерonNode(hasAnyAncestor(hasText("ancestor")) and hasText("target")). ( I638b5 )
Изменения API
- Переименуйте
Modifier.addTextContextMenuComponentsвappendTextContextMenuComponents. ( I4c43f ) - Удалена
AnnotatedOutputTransformationи перенесены функцииaddStyleвTextFieldBuffer.addStyleпо-прежнему можно вызывать только изOutputTransformation. ( I9930a , b/417991824 ) - Clickable переписан так, чтобы не использовать ввод указателя приостановки для оптимизации. Эта функция включается флагом
ComposeFoundationFlags.isNonSuspendingPointerInputInClickableEnabled, который можно отключить при обнаружении ошибки в новой реализации ( I85b65 ). - Добавлено свойство
isFlingCancellationWithNestedScrollFixEnabledдля исправления проблемы с распространением мелькания при вложенной прокрутке. В этом CL мы восстанавливаем поведение продолжения мелькания, удалённое в aosp/3260391 . Мы по-прежнему будем отменять анимацию мелькания в случае удаления дочернего элемента из композиции. ( I467f4 , b/405910180 , b/419049142 , b/416784125 ) -
WindowInsetsRulers: значениеrulersIgnoringVisibilityизменено на максимальное. ФункцияgetDisplayCutoutBounds()теперь является функцией расширенияPlacementScope.WindowInsetsAnimationPropertiesизменена наWindowInsetsAnimation, аgetAnimationProperties()— наgetAnimation(). ( I3816f ) - Изменён
InsetsRulers, чтобы он находился в общем коде с именемWindowInsetsRulers. API упрощён, теперь все вставки являютсяWindowInsetsRulers. Свойства анимации, не относящиеся к линейкам, извлечены в классAnimationProperties. Для объединения нескольких классовWindowInsetsRulersможно использоватьWindowInsetsRulers.innermostOf(). ( I2f0c6 , b/415012444 )
Исправления ошибок
- Повторно добавлено использование
scrollAnimationSpecвContentInViewNode. Это поведение было удалено во время прекращения поддержкиscrollAnimationSpec, что привело к нарушению вариантов использования. ( I1436a , b/403301605 )
Версия 1.9.0-альфа04
4 июня 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-alpha04 . Версия 1.9.0-alpha04 содержит следующие коммиты .
Изменения API
-
PrefetchSchedulerи настройка были объявлены устаревшими в пользу внутренней реализации, которая выполняет всю работу автоматически. ( I3a9a6 , b/420551535 ) - Обновлен
Scrollable2DStateдля использования смещения в методеcanScrollвместо угла. ( I28694 , b/417268474 ) - Заменен
addAnnotationвAnnotatedOutputTransformationнаaddStyle. ( I91c6f , b/417991824 ) - Стабилизированный
LazyLayout. ( If5db4 ) - Стабилизирован пустой конструктор для
LazyLayoutPrefetchStateи его методы планированияschedulePrecompositionиschedulePrecompositionAndPremeasure. ( I4362f , b/252853717 ) - В Android представлен
ProcessTextKeyиспользуемый для пунктов контекстного меню, которые добавляются для действий намеренияPROCESS_TEXT. ( If0ac4 ) - API контекстного меню открыты. Доступны
Modifier.addTextContextMenuComponentsиModifier.filterTextContextMenuComponentsдля добавления и удаления элементов в контекстном меню. Также открыты следующие элементарные API для создания настраиваемого контекстного меню:-
TextContextMenuProvider -
TextContextMenuDataProvider -
TextContextMenuData -
TextContextMenuComponent -
LocalTextContextMenuDropdownProvider -
LocalTextContextMenuToolbarProvider( I1b7b0 )
-
- Сделать
LazyLayoutItemProviderстабильным ( Icce09 , b/261565751 ) - Добавлены функции интеллектуального выделения текста в Android, которые можно включать/отключать с помощью
ComposeFoundationFlags.isSmartSelectionEnabled. Также доступен статическийcompositionLocalLocalTextClassifierCoroutineContext, который можно использовать для указанияCoroutineContext, в котором запускается заданиеTextClassification. ( I1dbaa , b/139321320 )
Версия 1.9.0-альфа03
20 мая 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-alpha03 . Версия 1.9.0-alpha03 содержит следующие коммиты .
Изменения API
- Добавлен
AnnotatedOutputTransformation, который позволяет добавлять аннотации вTextFieldперед рендерингом. ( Ibc6f0 , b/389978748 ) - Внедрите
LazyLayoutMeasurePolicyи сделайтеLazyLayoutMeasureScopeстабильным. ( I8c5df , b/252853717 ) -
BasicSecureTextFieldтеперь поднимает ScrollState своего внутреннегоBasicTextField. ( I6e576 ) - Были введены модификаторы
Modifier.onFirstVisibleиModifier.onVisibilityChanged— высокоуровневые модификаторы, построенные на основеModifier.onLayoutRectChanged. Эти модификаторы специально разработаны для решения множества распространённых задач приложений, таких как регистрация показов, автоматическое воспроизведение видео и т. д. Они разработаны с учётом производительности, чтобы их можно было использовать в критически важных сценариях со списками без риска снижения производительности прокрутки. Помимо этих API модификаторов, были добавлены дополнительные API дляRelativeLayoutBoundsдля поддержки этих вариантов использования, а также для упрощения разработчиками создания аналогичных пользовательских модификаторов, точно соответствующих их задачам. ( I759b8 ) - Введена перегрузка
detectDragGestures, которая имеет функцию управления отклонением касания и блокировкой ориентации. ( Iadb0d ) - Представлены
Modifier.scrollable2D,Scrollable2DStateи сопутствующие API для создания состояний. Также представлены общие функции расширения прокрутки. ( Ic61c8 , b/214410040 ) - 64-битные цветовые значения Compose нельзя напрямую сравнивать с цветовыми пространствами Android
ColorLongs, поскольку для некоторых цветовых пространств идентификаторы цветовых пространств не упорядочены. Для преобразования в цветовые пространства Android и обратно добавлены два новых API:toColorLong()иfromColorLong(). ( I36899 )
Исправления ошибок
- Текст, скопированный из нескольких текстовых компоновщиков в
SelectionContainer, теперь будет иметь разделитель строк\nдобавленный между текстом, поступающим из отдельных текстовых компоновщиков. ( I25332 , b/285036739 )
Версия 1.9.0-альфа02
7 мая 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-alpha02 . Версия 1.9.0-alpha02 содержит следующие коммиты .
Изменения API
- Исправлено, как изменения ввода указателя добавляются в
VelocityTrackerвDragGestureNode. Это можно контролировать с помощью нового флагаisOffsetPositionBeforeAddingToVelocityTrackerEnabled. ( Ic7992 , b/292556787 , b/236451818 ) - Сделать
await[Vertical/Horizontal]PointerSlopOrCancellationпубличным ( I6968b , b/298903681 ) -
AbstractComposeView.consumeWindowInsetsтеперь по умолчанию имеет значение false. При установке значения false свойствоWindowInsetsавтоматически корректируется с учетом размера и положения дочернего элемента, поэтому больше нет необходимости устанавливать его по умолчанию равным true. Это устраняет проблему, из-за которой дочерние представления не получали обновленияWindowInsetsпо умолчанию. Разработчики могут отказаться от обновления, изменив экспериментальное значениеComposeFoundationLayout.isWindowInsetsDefaultPassThroughEnabledна true или, что предпочтительнее, установив значение true дляAbstractComposeView.consumeWindowInsetsво всех экземплярах представления Compose. ( I6fa0a , b/411868840 )
Внешний вклад
- Исправлен сбой пейджера при чрезвычайно больших значениях beyondViewportPageCount ( Idb2db ).
Версия 1.9.0-альфа01
23 апреля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.9.0-alpha01 . Версия 1.9.0-alpha01 содержит следующие коммиты .
Изменения поведения
Для проверок lint, поставляемых вместе с Compose, теперь требуется версия AGP не ниже 8.8.2. Если вы не можете обновить AGP, вы можете обновить Lint самостоятельно, указав
android.experimental.lint.version=8.8.2(или более новую версию) в файлеgradle.properties. Для запуска проверок lint Compose в среде IDE требуется Android Studio Ladybug или более новая версия.Критическое изменение: перегрузки
clickable,combinedClickable,selectable,toggleableиtriStateToggleableбез параметра Indication теперь поддерживают только экземплярыIndicationNodeFactory, предоставленные с помощьюLocalIndication. Это изменение вступит в силу при перекомпиляции использований этих модификаторов с использованием этой версии Compose. Бинарные/транзитивные зависимости не затронуты. Если вы предоставляете устаревшую реализацию Indication дляLocalIndicationи используете эти API, это приведет к сбою во время выполнения. Это изменение поведения необходимо для повышения производительности и позволяет функциям Composable, использующим эти модификаторы, пропускать рекомпозицию. Вы можете использоватьComposeFoundationFlags.isNonComposedClickableEnabled=false, чтобы временно отказаться от этого изменения поведения и разрешить обновление Compose без блокировки при этой миграции. Этот флаг будет удален после одного стабильного выпуска. Для решения этой проблемы перенесите все устаревшие реализации Indication на использованиеIndicationNodeFactory. Вы также можете использовать перегрузки с явным параметром Indication — эти перегрузки будут продолжать поддерживать не-IndicationNodeFactoryэкземпляры Indication, хотя это не рекомендуется по соображениям производительности. ( I6bcdc , b/316914333 )
Изменения API
- Представить API для создания пользовательских маркированных списков через
AnnotatedString( I1d066 , b/383269496 , b/139326648 ) - Разрешить Compose вызывать
ViewTreeObserver.OnScrollChanged. Это поведение реализовано с помощью флагаisOnScrollChangedCallbackEnabled. Мы также добавили функцию расширенияDelegatableNode dispatchOnScrollChanged. ( I34b9d , b/238109286 ) - Для проектов, выпущенных с использованием Kotlin 2.0, требуется использование KGP 2.0.0 или более поздней версии ( Idb6b5 ).
- Добавлена поддержка проверки линта для
TextFieldState, чтобы убедиться, что он запоминается при составлении. Рассмотрите возможность использованияrememberTextFieldStateвместо него. ( I53d74 ) - Добавлена поддержка проверки линта для
FocusRequester, чтобы убедиться, что он запомнен внутри композиции ( I6bf91 ). - Добавлена поддержка проверки линта для
BringIntoViewRequester, чтобы убедиться, что он запомнен внутри композиции. ( Ibfba6 ) - Введены области действия для вызовов
schedulePrefetchв стратегиях сеток и списков для согласования с возможностямиLazyListPrefetchStateпо предоставлению информации о размере и индексе. ( Iad80c ) - Критическое изменение: перегрузки
clickable,combinedClickable,selectable,toggleableиtriStateToggleableбез параметра Indication теперь поддерживают только экземплярыIndicationNodeFactory, предоставленные с помощьюLocalIndication. Это изменение вступит в силу при перекомпиляции использований этих модификаторов с использованием этой версии Compose. Бинарные/транзитивные зависимости не затронуты. Если вы предоставляете устаревшую реализацию Indication дляLocalIndicationи используете эти API, это приведет к сбою во время выполнения. Это изменение поведения необходимо для повышения производительности и позволяет функциям Composable, использующим эти модификаторы, пропускать рекомпозицию. Вы можете использоватьComposeFoundationFlags.isNonComposedClickableEnabled=false, чтобы временно отказаться от этого изменения поведения и разрешить обновление Compose без блокировки при этой миграции. Этот флаг будет удален после одного стабильного выпуска. Для решения этой проблемы перенесите все устаревшие реализации Indication на использованиеIndicationNodeFactory. Вы также можете использовать перегрузки с явным параметром Indication — эти перегрузки будут продолжать поддерживать не-IndicationNodeFactoryэкземпляры Indication, хотя это не рекомендуется по соображениям производительности. ( I6bcdc , b/316914333 ) - Ввести флаг для управления поведением автоматической вложенной предварительной выборки:
isAutomaticNestedPrefetchEnabled( I8d448 ) - Ввести перегрузку для
LazyGridStateиrememberLazyGridStateLazyGridState, которая принимаетLazyLayoutCacheWindow. ( I51151 ) - Добавляет линейки для вставок окон. Добавляет
DerivedRuler, позволяющий рассчитывать линейку на основе другой линейки. ИзменяетPlacmentScopeдля реализации Density. ( I658bc , b/359260964 ) - Добавлена функция-фабрика
WindowInsets()с нулевым аргументом для простого создания пустыхWindowInsets. ( I65f62 , b/395311689 ) - Добавлен
PaddingValues.Zeroдля пустогоPaddingValues. ( If193e , b/386255688 )
Исправления ошибок
- Перегрузка
stateBasicTextFieldбудет сохранять курсор прокрученным в поле зрения при изменении его размера. ( I0eb41 , b/406187741 ) - Обновлены API-интерфейсы
onVisibleItemsUpdatedвLazyListPrefetchStrategyиLazyGridPrefetchStrategyдля информирования о начальном состоянии. ( If2cfa )
Версия 1.8
Версия 1.8.3
18 июня 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.8.3 . Версия 1.8.3 содержит следующие коммиты .
Версия 1.8.2
20 мая 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.8.2 . Версия 1.8.2 содержит следующие коммиты .
Исправления ошибок
- Внесено исправление, предотвращающее деление на ноль при расчёте количества загружаемых элементов для поиска фокуса. Проверка применена ко всем макетам, использующим
LazyLayoutBeyondBoundsState. ( 8e6dc8 )
Версия 1.8.1
7 мая 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.8.1 . Версия 1.8.1 содержит следующие коммиты .
Исправления ошибок
- Исправлена ошибка в
BasicTextиTextAutoSize, из-за которой использованиеTextOverflow.Ellipsizeприводило к получению текста меньше оптимального размера. ( I1e1d8 , b/396582066 ) - Исправлена ошибка в
BasicTextField, которая вызывала различные сбои, когдаTextFieldDecoratorпропускал вызовinnerTextField. ( I2638c ), b/308398612 - Исправлена ошибка в
TextField, из-за которой панель инструментов текста и маркеры выделения полностью исчезали при изменении экземпляраTextFieldState. ( I8068a ), b/390477786 - Исправлена ошибка в
BasicText, из-за которой изменение ограничения минимальной ширины не приводило к обновлению размещения текста, еслиtextAlignбыло задано значение, отличное от значения по умолчанию. ( I77a96 ), b/406305552
Версия 1.8.0
23 апреля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.8.0 . Версия 1.8.0 содержит следующие коммиты .
Версия 1.8.0-rc03
9 апреля 2025 г.
Выпущен androidx.compose.foundation:foundation-*:1.8.0-rc03 . Версия 1.8.0-rc03 содержит следующие коммиты .
Версия 1.8.0-rc02
26 марта 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-rc02 is released. Version 1.8.0-rc02 contains these commits .
Version 1.8.0-rc01
12 марта 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-rc01 is released. Version 1.8.0-rc01 contains these commits .
Version 1.8.0-beta03
26 февраля 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-beta03 is released. Version 1.8.0-beta03 contains these commits .
Исправления ошибок
- Added a new semantics property
InputTextthat captures a textfield's value before output transformation is applied. ( Iae46a , b/395911609 , b/176949051 ) - Removed deprecated
AutoSizeoverloads. Please use theTextAutoSizeAPIs serving the same function. ( I2c90f ) - Fixed a caching issue with
TextAutoSizewhere a second layout pass with the same constraints could result in using the second-biggest fitting font size instead of the biggest. ( Id367f )
Version 1.8.0-beta02
12 февраля 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-beta02 is released. Version 1.8.0-beta02 contains these commits .
Исправления ошибок
- Fixed an issue where overscroll implementations using
LayoutModifierNodewould not work correctly inside scrolling containers.
Version 1.8.0-beta01
29 января 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-beta01 is released. Version 1.8.0-beta01 contains these commits .
API Changes
-
SemanticsNodeInteraction.semanticsId()has been removed. UseSemanticsNodeInteraction.fetchSemanticsNode().idinstead. ( Ie397a ) - Rewrite
requestAutofillAPI to exist outside of autofill manager. ( Id1929 ) -
ContextualFlowRowandContextualFlowColumnhave been marked as deprecated. This experimental component was introduced in 1.7 and had not yet been stabilized, and the implementation has been deemed undesirable. In the future, a component solving the use cases this component was meant to solve may be provided.-
FlowRowandFlowColumnhave experimental overloads that were introduced in 1.7 that include anoverflowparameter. The use of this parameter has been deprecated, and the overloads without this parameter can be used instead. The default "overflow" behavior for these overloads will be "Clip", as it was since its introduction. - Many use cases for
ContextualFlowRowcan be accomplished usingFlowRow, but we acknowledge that is not true in full generality.ContextualFlowRowis completely implementable in user-space, and one can attempt to copy its implementation and adapt if desired. In the future, we hope to solve these use cases in a different way. ( Ibafec )
-
Исправления ошибок
- Fix text layout with ellipsis sometimes translating incorrectly during animations, see b/389707025 for more info ( Ie55b1 , b/389707025 )
- Fixed a bug in
BasicTextwithTextAutoSizeandmaxLinesset to 1. ( Ic0450 , b/376834366 ) - Text's minimum intrinsics height now takes
minLinesparameter into account. It means that minimum intrinsics height reported won't be smaller than the height required to satisfy theminLinesparameter ( I225f9 , b/388299762 )
Version 1.8.0-alpha08
15 января 2025 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha08 is released. Version 1.8.0-alpha08 contains these commits .
API Changes
- AutoSize: Renamed
AutoSizetoTextAutoSizeand published APIs that enable creating customTextAutoSizeimplementations. SeeTextAutoSizeSamplefor an example of a custom text auto size implementation. ( I85756 ) - Moved the
DetectTapGesturesEnableNewDispatchingBehaviorfeature flag toComposeFoundationFlagsand renamed it toisDetectTapGesturesImmediateCoroutineDispatchEnabled. The old flag is deprecated and will now delegate toComposeFoundationFlags.isDetectTapGesturesImmediateCoroutineDispatchEnabledinstead. ( I62932 )
Исправления ошибок
- Enabled
DetectTapGesturesEnableNewDispatchingBehaviorby default.TapGestureDetectorAPIs now use the new dispatching behavior (immediate dispatch) by default. ( I9f2bc , b/369648479 ) - Fixed the
requiredWidth/Height/Sizemodifiers to properly handle intrinsic sizes. ( Ie3d7d , b/368113212 )
External Contribution
- Commonized
BasicTooltipin foundation andBasicTooltip/Tooltipin material3. ( Ifc2e6 ) - Added a new Clipboard interface and a composition local for it. ( I80809 )
Version 1.8.0-alpha07
11 декабря 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha07 is released. Version 1.8.0-alpha07 contains these commits .
API Changes
- Deleted
ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabledflag that helped revert the removal of internalgraphicsLayerfromBasicText. If you were using this flag please let us know of the reasons by filing a bug. Also you can just pass inModifier.graphicsLayer()to yourBasicTextcalls to achieve the same behavior as before. ( Id9f90 ) - Added default implementation for new
stickyHeaderDSL. ( I68986 ) - Has
LocalAutofillHighlightColorcomposition local use a Color type. ( I0e05b ) - Renamed
OverscrollEffect#withoutDrawingtoOverscrollEffect#withoutVisualEffect. ( I1a154 )
Исправления ошибок
- Follow-up fix for an issue in
AnchoredDraggable's target calculation where it could settle at the wrong anchor for specific swipes. ( I23b87 , b/367660226 )
External Contribution
- Add
BringIntoViewResponderModifierNodeto UI, which provides a new way to implement Bring Into View functionality as well as allows implementing in on a platform level ( Ia6dd8 ) - We are ever slightly changing the way the cursor is drawn. You can use
LocalCursorBlinkEnabledto disable the cursor drawing in tests. ( I4c697 )
Version 1.8.0-alpha06
13 ноября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha06 is released. Version 1.8.0-alpha06 contains these commits .
API Changes
- Adds
stylusHoverIconmodifier. ( Iff20a , b/331289114 ) - Deprecated
AnchoredDraggableState'sconfirmValueChange. Instead of vetoing state changes, disallowed anchors should not be in the active anchor set, and anOverscrollEffectshould be used to indicate the unavailability of the requested action. ( Ia717f ) - Changes Autofill manager to be an interface. ( I84914 , b/376080755 )
- Adds
OverscrollEffect#withoutDrawingandOverscrollEffect#withoutEventHandlingAPIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere. ( Idbb3d , b/266550551 , b/204650733 , b/255554340 , b/229537244 ) - Adding autofill support in text toolbar. ( Ie6a4c )
- Deprecates
OverscrollConfigurationandLocalOverscrollConfiguration, and addsrememberPlatformOverscrollFactoryto create an instance of / customize parameters of the default overscroll implementation. To disable overscroll, instead ofLocalOverscrollConfiguration provides null, useLocalOverscrollFactory provides null. To change the glow color / padding, instead ofLocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding), useLocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding). ( Ie71f9 , b/255554340 , b/234451516 ) - Changed the
effectModifierproperty onOverscrollEffectto benode: DelegatableNode, consistent with other APIs. ( Ic0b46 , b/255554340 ) - Removed the experimental
GlobalAssertionsAPI. It's intended use was to run accessibility checks, seeenableAccessibilityChecks()for that purpose instead. ( I59322 )
Version 1.8.0-alpha05
30 октября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha05 is released. Version 1.8.0-alpha05 contains these commits .
Новые функции
- Support for auto-sizing text. Pass an
AutoSizeinstance (egAutoSize.StepBased) to your favorite text composable (likeBasicText) and see your text size adapt to the available space! ( Ice7e0 , b/139320827 ) - Adds
OverscrollFactoryandLocalOverscrollFactoryAPIs to allow configuring overscroll within a hierarchy. The value provided throughLocalOverscrollFactorywill be used by default to create anOverscrollEffect. To create and remember an effect from the current provided factory, userememberOverscrollEffect(). ( I51ca4 , b/255554340 )
API Changes
- Introduce
CompositionLocalthat can be used to modify the hue of Autofill's successful filling highlight. ( I32092 ) - Removed
ScrollableDefaults.overscrollEffect- instead you should userememberOverscrollEffect. This will create an instance of the current overscroll implementation provided withLocalOverscrollFactory. ( I1651a , b/255554340 ),( b/234451516 ) - Introduces new
AutofillManagerinterface that can be used to fine-tune users' Autofill journey and aisSemanticAutofillEnabledflag to turn on this new version of Autofill. ( I9d484 ) - Removes
CombinedClickableNode. This experimental API was temporarily exposed to unblock performance work, but is no longer needed. Instead you should directly useModifier.combinedClickableas with other modifier APIs. ( I4b658 ) - Adds overloads to
horizontalScroll,verticalScroll,LazyColumn,LazyRow,LazyHorizontalGrid,LazyVerticalGrid,LazyHorizontalStaggeredGrid,LazyVerticalStaggeredGrid,HorizontalPager, andVerticalPagerwith support for specifying a customOverscrollEffect. The providedOverscrollEffectwill receive events, and be rendered within the bounds of these components. Note that drawing the sameOverscrollEffecttwice is unsupported - so you cannot draw the sameOverscrollEffectprovided to one of these components separately withModifier.overscroll. The use case of drawing the overscroll outside of the bounds of these components will be addressed separately in the future. ( I2dc42 , b/266550551 , b/234274772 , b/224572538 , b/353805117 )
Version 1.8.0-alpha04
16 октября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha04 is released. Version 1.8.0-alpha04 contains these commits .
API Changes
- Adds
DelegatableNode#onDensityChangeandDelegatableNode#onLayoutDirectionChangecallbacks to allow updating node state when these change. ( I04f3e , b/340662451 ) - Paragraph and
ParagraphIntrinsicsnow takes a list of all annotations applied to theAnnotatedString, previously it only had a list ofSpanStyles. ( I12f80 ) - Introduced
PointerInputModifierNode#touchBoundsExpansion, which can be used to enlarge the touch bounds of a single pointer input modifier. ( Iccf02 , b/335339283 )
Исправления ошибок
- Fixed a bug where positional thresholds passed to
AnchoredDraggableDefaults.flingBehaviorwere not considered correctly in some scenarios. ( Ifdf0d , b/367660226 ) - Introduce a fix for nested scrollables that are removed from the node tree during an ongoing fling. Now these nodes will cancel the fling and correctly send the
onPostFlingevent with the remaining velocity. We're also introducing the flagNewNestedScrollFlingDispatchingEnabledto control the behavior in case of regressions. The flag will be removed before beta. ( I05c37 , b/371168883 ) - Fixed a bug where
OverscrollEffectspassed toModifier.anchoredDraggablewould receive 2D deltas instead of 1D. ( Ie52c0 )
Version 1.8.0-alpha03
2 октября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha03 is released. Version 1.8.0-alpha03 contains these commits .
API Changes
- Kotlin version update to 1.9 ( I1a14c )
- Introduced flag
DraggableAddDownEventFixEnabled( I848d5 ) - Introduced a new Semantics Role called Carousel to emulate the list behavior in Pagers for a11y services. ( Id354b , b/354109776 , b/239672673 )
- Removed the implicit
graphicsLayermodifier fromBasicTextcomposable. Added experimentalComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabledflag to be able to revert to the old behavior. ( Ie478d ) - Added
Modifier.recalculateWindowInsets()to allow children in the hierarchy to useinsetsPaddingeven when parents aligned them withoutconsumeWindowInsets(). ( I7f9e4 )
Исправления ошибок
- Implement gesture pick-up in
detectDragGestures, draggables and scrollables. Now if a child draggable gives up on a gesture, the parent has the opportunity to pick it up. This allows for a more continuous and integrated gesture handling. ( Ic88fe ) - Update fling cancellation behavior in scrollables. Now if a scrollable flings and hits the bounds it will correctly pass on the fling velocity to the next scrollable in the chain instead of continue to drive the fling. ( I9326a )
Version 1.8.0-alpha02
18 сентября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha02 is released. Version 1.8.0-alpha02 contains these commits .
API Changes
-
TextOverflow.StartEllipsisandTextOverflow.MiddleEllipsisare now available which allows to place ellipsis at the start or middle of the line of the single line text ( I38913 , b/185418980 )
Version 1.8.0-alpha01
4 сентября 2024 г.
androidx.compose.foundation:foundation-*:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits .
Версия 1.7
Версия 1.7.8
12 февраля 2025 г.
androidx.compose.foundation:foundation-*:1.7.8 is released. Version 1.7.8 contains these commits .
Исправления ошибок
- Fix crash in
BasicTextFieldwith input transformation when replacing part of the pasted text. ( I73702 )
Версия 1.7.7
29 января 2025 г.
androidx.compose.foundation:foundation-*:1.7.7 is released. Version 1.7.7 contains these commits .
Исправления ошибок
- Fixed
IndexOutOfBoundcrash with link annotation. ( Ic96d2 ) - Fixed infinite recomposition in some edge cases with links. ( I04a03 )
Известные ошибки
- A bug was identified that can cause text to wrap unexpectedly in rare scenarios on Android API level 35. It cannot be fixed in 1.7, so it will be fixed in 1.8. ( b/391378120 )
Версия 1.7.6
11 декабря 2024 г.
androidx.compose.foundation:foundation-*:1.7.6 is released. Version 1.7.6 contains these commits .
Исправления ошибок
- Fixed text inline content not being visible to accessibility services.
- Fixed an issue where
AndroidEmbeddedExternalSurfacewould not reset properly and be stuck when reusing in a lazy list.
Версия 1.7.5
30 октября 2024 г.
androidx.compose.foundation:foundation-*:1.7.5 is released. Version 1.7.5 contains these commits .
Исправления ошибок
- Ensure that pinned items are not subcomposed twice in the content padding area. ( Ic6224 )
Версия 1.7.4
16 октября 2024 г.
androidx.compose.foundation:foundation-*:1.7.4 is released. Version 1.7.4 contains these commits .
Исправления ошибок
- Fixed a bug causing a rare crash in text fields. ( I475c6 , b/313010266 )
- Removed
ReusableContentHostat the root of Lazy layout items. This was a potential root cause for “measure called on a deactivated node” crashes. ( Id6e60 )
Версия 1.7.3
2 октября 2024 г.
androidx.compose.foundation:foundation-*:1.7.3 is released. Version 1.7.3 contains these commits .
Исправления ошибок
- Fixed a memory leak with
BasicTextwhen minLines is set to a non-default value.
Версия 1.7.2
18 сентября 2024 г.
androidx.compose.foundation:foundation-*:1.7.2 is released. Version 1.7.2 contains these commits .
Исправления ошибок
- Fix issue with draggable that was missing down events which caused flings to look slower than normal.
Версия 1.7.1
10 сентября 2024 г.
- No changes to Android artifacts.
-desktopartifacts were removed and-jvmStubsand-linuxx64Stubsartifacts were added. None of these targets are meant to be used, they are placeholders to help Jetbrains Compose efforts.
Версия 1.7.0
4 сентября 2024 г.
androidx.compose.foundation:foundation-*:1.7.0 is released. Version 1.7.0 contains these commits .
Important changes since 1.6.0
- Performance of
Modifier.clickable,Modifier.focusable,Modifier.indication,Modifier.scrollableandModifier.draggablehas been significantly improved. As a part of this effort, the following API changes were made in addition to internal changes- Added a new Indication API,
IndicationNodeFactory. This leads to more performant Indication implementations compared to the previous (now deprecated)rememberUpdatedInstanceAPI. For migration information, see developer.android.com . -
clickable/combinedClickable/selectable/toggleablenow accepts a nullableMutableInteractionSourceparameter. If null, and the provided Indication is anIndicationNodeFactory, the Indication can be lazily created only when needed, which improves performance. If you are not hoisting and using theMutableInteractionSource, it is recommended to pass null instead of passingremember { MutableInteractionSource() }. -
Indication#rememberUpdatedInstancehas been deprecated. It has a high unavoidable performance penalty, and prevents other optimizations. Instead, you should use the newIndicationNodeFactoryAPI.
- Added a new Indication API,
-
BasicTextFieldusing aTextFieldStateis now stable and we advise all call-sites to begin migration fromBasicTextField(value, onValueChange)toBasicTextField(TextFieldState). - The
ClickableTexthas been deprecated. To add clickable links to your text, useBasicTextwith the newLinkAnnotationannotation in yourAnnotatedString.LinkAnnotationallows for custom styling based on link state (eg focused, hovered). - Introducing
ContextualFlowRowandEnhanced FlowRow/ColumnwithMaxLinesandOverflow. We are excited to announce enhancements to the experimentalFlowRowandFlowColumn, now featuringmaxLinesand overflow support, alongside the debut ofContextualFlowRowandContextualFlowColumn. This update is designed to provide performance optimal components, whereContextualFlow*is perfect for a large number of items making use of a small maxLines config and dynamic +N see more buttons, andFlowRowandFlowColumnis perfect for a small number of items, less than 100 items. Important: To maintain existing behavior inFlowRoworFlowColumnwhere all items are composed regardless of if they fit the cross axis max, set overflow toFlowRowOverflow.VisibleorFlowColumnOverflow.Visibleduring initialization. ExploreContextualFlowRowSampleandFlowRowSamplefor examples of these new features in action. ( Ib9135 , b/293577082 ) - Item appearance and disappearance animation support was added into
LazyColumnandLazyRow. Previously it was possible to addModifier.animateItemPlacement()modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier calledModifier.animateItem()which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I2d7f7 , b/150812265 ) - Implemented experimental support for long screenshots in Compose scroll containers using the official Android API (
ScrollCaptureCallback). -
NestedScrollsources Drag and Fling are being replaced byUserInputandSideEffectto accommodate for the extended definition of these sources that now include animations (Side Effect) and Mouse Wheel and Keyboard (UserInput). -
LazyLayoutprefetch requests can be marked as urgent now, meaning that we expect this item to be needed in the next frame and want to ignore frame budget to make sure to do more work in advance ( Id513f ) - Support stylus handwriting feature on devices after Android U. ( I002e4 )
- Various APIs have been promoted to stable
- Pagers, snapping, window insets
Version 1.7.0-rc01
21 августа 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits .
Исправления ошибок
- Fixed a regression where the crash occurred when any element is focused inside a parent that is focusable (or clickable) and disabled. ( b/317561689 )
Version 1.7.0-beta07
7 августа 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta07 is released. Version 1.7.0-beta07 contains these commits .
Исправления ошибок
- Text input related
SemanticsNodeInteractionfunctionsperformTextReplacement,performTextInput, andperformTextClearanceis now going to throw assertion errors when they are called on read onlyTextFields. ( I4ae8f ) - Fixed a visual glitch in hyperlinks. ( I23311 )
- Fixed
contentReceivermodifier not working with some IMEs. - Velocity generation: Prevent propagation of NaN values in Compose UI and Foundation.
Version 1.7.0-beta06
24 июля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta06 is released. Version 1.7.0-beta06 contains these commits .
Version 1.7.0-beta05
10 июля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta05 is released. Version 1.7.0-beta05 contains these commits .
Исправления ошибок
- Fix for treatment of Nan values in
SnapFlingBehaviorand Pager.
Version 1.7.0-beta04
26 июня 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta04 is released. Version 1.7.0-beta04 contains these commits .
Исправления ошибок
- Avoid crashes when measuring very large text lines (eg 10k characters) ( 8157ab )
- Fixes measurement of very large text causing crash in the new
BasicTextField( 6b7575 ) - Reverts a behavior change in Row/Column measurement that breaks Text usage in certain scenarios ( 69e8ba )
Version 1.7.0-beta03
12 июня 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta03 is released. Version 1.7.0-beta03 contains these commits .
Version 1.7.0-beta02
29 мая 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta02 is released. Version 1.7.0-beta02 contains these commits .
API Changes
- Adds an experimental API for configuring prefetch behavior of
LazyGridssimilar to the existing experimental API forLazyLists. This includes support for prefetching items in nestedLazyGrids. Similiar toLazyListPrefetchStrategy, the implementation default is to prefetch the first 2 nested items of each grid, but this can be configured by the newLazyGridPrefetchStrategy(nestedPrefetchItemCount)andLazyListPrefetchStrategy#onNestedPrefetchAPIs. ( I591c4 ) - Renamed
SemanticsProperties.EditabletoIsEditableand changesSemanticsPropertyReceiver.editableto a valisEditable. The property is now a boolean and always specified by text fields. ( I8acd8 ) - Moved
basicMarqueedefault values intoMarqueeDefaultsobject. ( I12ff6 ) - Renamed
basicMarqueedelayMillisparameter torepeatDelayMillis. ( I12ff6 ) - Update API for styling the links: moved the
TextLinkStylesto theTextStyleand removed theTextDefaultsfrom material ( I5477b )
Исправления ошибок
- Renamed
LayoutCoordinates.introducesFrameOfReferencetoLayoutCoordinates.introducesMotionFrameOfReferenceto better reflect its purpose. Renamed related function to calculate coordinates based on that flag. ( I3a330 ) - Removed 'Default' from the
MarqueeDefaultsproperties. ( I1d8a0 ) - Removed 'Marquee' from
MarqueeDefaultsproperties. ( Iad4f4 ) - Removed
TextLinkStylesfrom theTextStyleclass. Instead,TextLinkStylesis part of theLinkAnntationconstructor and theAnnotatedString.fromHtmlmethod ( I90b2b ) - Fixed a bug where Pager would snap when flinging towards a bound while already settled at the bound. ( I9f373 , b/339171222 )
- BTF2 now has correct mouse selection gestures. ( Ibe8c6 )
External Contribution
- Resubmit 'Make compose/measure time calculation content-type based in prefetch to improve accuracy' ( Iea622 )
- Make compose/measure time calculation content-type based in prefetch to improve accuracy ( Ibccb1 )
- Make
WindowInsetsPaddingmodifiers available from common source set ( I070b2 )
Version 1.7.0-beta01
14 мая 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-beta01 is released. Version 1.7.0-beta01 contains these commits .
API Changes
- Added
KeyboardOptions.shouldShowKeyboardOnFocusproperty back as deprecated hidden for binary compatibility. ( I15cfe ) -
Modifier.anchoredDraggablenow reverses drag deltas by default for components with a Horizontal orientation when used in an RTL layout. ( I3c6d9 ) -
AnnotatedString.hasEqualsAnnotationsis nowhasEqualAnnotations. ( I685c0 ) - Updated the API for getting Material themed links in text. Specifically, removed the methods from the
TextDefaultsfor constructing themedLinkAnnotationsand parse HTML with themed links. Instead, added aTextLinkStylesclass that allows to style the links as a parameter to the Text composable. ( I31b93 ) - Replaced
onDragStartedandonDragStoppedwith non-suspend callbacks. ( I59de8 )
Исправления ошибок
- Fixed a bug where Pager would crash when the
contentPaddingwas bigger than the incoming constraints. Pager now coerces negative values returned fromPageSizeto 0. ( Iba5d8 , b/314008560 )
Version 1.7.0-alpha08
1 мая 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha08 is released. Version 1.7.0-alpha08 contains these commits .
Новые функции
- Added right-click context menu to
BasicTextFieldandSelectionContainerwith items for cut, copy, paste, and select-all actions. ( If8c93 , Ia2b49 , I6f268 )
API Changes
-
LazyLayoutprefetch requests can be marked as urgent now, meaning that we expect this item to be needed in the next frame and want to ignore frame budget to make sure to do more work in advance ( Id513f ) - Renamed
isPositionedByParentWithDirectManipulationtointroducesFrameOfReference. Note that it now has the reverse effect, meaning that by default, mostLayoutCoordinatesintroduce a frame of reference, and, only when placed under direct manipulation the property will be false. To query position with only those that introduce a frame of reference, usepositionInLocalFrameOfReference(...). OrpositionInLocalLookaheadFrameOfReferencefrom aLookaheadScope. ( Ifc5f7 ) - Renamed
onClickedtoonClickinsideLinkInteractionListener( Iaa35c ) - Change action lambda for
getScrollViewportLengthas per API council feedback. ( Ibc74a ) - Renamed stylus handwriting delegation APIs. ( Ica45f , b/327271923 )
- Rename
TextInclusionStrategy.isInsidetoisIncluded. MakeParagraph/MultiParagraph#getRangeForRect()return type non nullable. ( I51f26 )
Исправления ошибок
- Added "Select all" to all text contextual menus in
SelectionContainer. ( Ib750e , b/240143283 ) - Fixed long screenshot capture for scrolling containers with
reverseScrolling=true. ( I7c59c ) - Fixed an issue where
AnchoredDraggableState'scurrentValuewould change when approaching the state's bounds. ( Iea30b , b/333846848 )
External Contribution
- Renamed
PrefetchExecutor->PrefetchSchedulerto better reflect its responsibilities. ( Ib9154 ) - Added support for prefetching items in nested
LazyLists(eg aLazyColumnthat renders nestedLazyRows). This change is expected to reduce frame drops during scrolling for theseLazyLists. The implementation default is to prefetch the first 2 nested items, however this behavior can be controlled by the newLazyLayoutPrefetchStrategy(nestedPrefetchItemCount)andLazyListPrefetchStrategy#onNestedPrefetchAPIs. ( I51952 )
Version 1.7.0-alpha07
17 апреля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha07 is released. Version 1.7.0-alpha07 contains these commits .
Новые функции
- Added a
TextDefaultsobject that contains methods to construct aLinkAnnotationand parse HTML-tagged string which applyMaterialThemeto the links. ( I98532 , b/139312671 ) - Item appearance and disappearance animation support was added into
LazyVerticalGridandLazyHorizontalGrid. Previously it was possible to addModifier.animateItemPlacement()modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier calledModifier.animateItem()which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( Ib7d12 , b/330510929 ) - Item appearance and disappearance animation support was added into
LazyVerticalStaggeredGridandLazyHorizontalStaggeredGrid. Previously it was possible to addModifier.animateItemPlacement()modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier calledModifier.animateItem()which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I69bc9 , b/330511290 )
API Changes
- Adds
ContextMenuColorsand the associatedLocalContextMenuThemeProvidableCompositionLocal. The colors of the context menu on text fields and selectable text can be modified by providing the composition local. ( Ifa154 ) - Text links got pressed state styling option in addition to normal styling, hovered and focused. ( I5f864 , b/139312671 )
- Introduce
ViewConfiguration.HandwritingGestureLineMarginfor handwriting gestures. Support handwriting gesture forBasicTextField. ( Ie6e13 , b/325660505 ) - Removed
DelegatableNode.scrollIntoViewfor the 1.7 release since we didn't have time to finish stabilizing the rest of the related API surface. This function will be re-introduced in 1.8 ( I6cf61 , b/333421581 , b/332900232 ) - When querying Layout coordinates, you may now use the
excludeDirectManipulationOffsetargument to exclude the offset set by parent Layouts that placed their children usingPlaceable.PlacementScope.withDirectManipulationPlacement. Likewise, a Layout that changes the position of its children frequently may now place them usingwithDirectManipulationPlacement(such as Scroll, implemented by default). This helpsapproachLayoutbased animations to be more intuitive, having now the opportunity to differentiate what offset to animate, and what to apply directly when deciding to animate their approach. ( I60ec7 ) - Introduce
requestScrollToItemforLazyStaggeredGrid. For each measure-pass, the client may now opt-out of maintaining index based on the key by callingrequestScrollToItem. This does not change existing behavior in any way unlessrequestScrollToItemis called. ( I63983 ) - Introduce
requestScrollToPagein Pager. For each measure-pass, the client may now opt-out of maintaining index based on the key by callingrequestScrollToPage. This does not change existing behavior in any way unlessrequestScrollToPageis called. ( Ic4213 ) - Introduced
requestScrollToItemforLazyGrids. For each measure-pass, the client may now opt-out of maintaining index based on the key by callingrequestScrollToItem. This does not change existing behavior in any way unlessrequestScrollToItemis called. ( I0a7a0 ) -
ClickableTextis marked as deprecated. To add links to the text, create anAnnotatedStringwith aLinkAnnotationcorresponding to your link and pass thisAnnotatedStringto theTextcomposable ( I34d4b , b/323346994 ) -
UrlAnnotationis deprecated, useLinkAnnotation.Urlinstead. If you're using Material theming, then useTextDefaultsobject to create the annotation with Material theming applied to it ( I8d180 , b/323346545 ) -
String.parseAsHtmlrenamed toAnnotatedString.Companion.fromHtml( I43dcd ) - Added styling arguments (
linkStyle,focusedLinkStyle,hoveredLinkStyle) and a link interaction listener to theparseAsHtmlmethod. When parsing the HTML-tagged string with<a>tags, the method will construct aLinkAnnotation.Urlfor each such tag and pass the styling objects and link interaction listener to each annotation. ( I7c977 ) -
LinkAnnotationnow takes the state-based styling arguments and aLinkInteractionListener. Add this annotation to theAnnotatedStringto get a hyperlink. By passingfocusedStateand/orhoveredStateyou can define the visual configuration for links when they are focused and/or hovered. ( I81ce4 , b/139312671 ) - The feature flag for long screenshots has been removed. ( I28648 , b/329128246 )
-
LazyColumnwill now render sticky headers correctly in long screenshots. ( I8d239 , b/329296635 ) - Stabilized majority of the remaining experimental APIs that were introduced with the new
BasicTextField. ( I714e2 ) - Added
textObfuscationCharacterparameter toBasicSecureTextFieldthat controls which character to use while obfuscating the contents. ( I0588b ) -
NestedScrollsources Drag and Fling are being replaced byUserInputandSideEffectto accommodate for the extended definition of these sources that now include animations (Side Effect) and Mouse Wheel and Keyboard (UserInput). ( I40579 ) - Introduce
LocalBringIntoViewSpec, a platform dependent focus scrolling behavior that is applied at the Scrollable modifier layer. ( I27aa5 , b/317453911 ) - Removed
TextFieldCharSequence.TextFieldBuffer.originalValuesis replaced withTextFieldBuffer.originalTextandTextFieldBuffer.originalSelection. ( I2c7d6 ) -
ImeOptions.hintLocalesis no longer nullable. If you want to pass an empty Locale list, please useLocaleList.Empty. ( Ic5bc4 ) - Renamed
getOffsetFractionForPagetogetOffsetDistanceInPages. ( Ia05e2 )
Исправления ошибок
- When
InputTransformationsare joined withnext, theirKeyboardOptionsare now properly merged by individual options using the newKeyboardOptions.mergemethod. ( Ie5304 , b/295951492 ) -
AnchoredDraggableState'stargetValuenow does not consider positional thresholds anymore. It now has an implicit threshold of 50%, meaning that thetargetValuechanges at the midpoint between two anchors. ( I82c2c )
External Contribution
- Renamed 2 scroll APIs ( I56a75 )
Version 1.7.0-alpha06
3 апреля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha06 is released. Version 1.7.0-alpha06 contains these commits .
Новые функции
- Item appearance and disappearance animation support was added into
LazyColumnandLazyRow. Previously it was possible to addModifier.animateItemPlacement()modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier calledModifier.animateItem()which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I2d7f7 , b/150812265 ) - Clients of
LazyColumn/LazyRowmay now opt-out of maintaining an index based on the key for the upcoming measure-pass by calling a non-suspendLazyListState.requestToScroll. ( I98036 , b/209652366 ) - Added
parseAsHtmlmethod for styled strings: it allows to convert a string marked with HTML tags intoAnnotatedString. Note that not all tags are supported, for example you won't be able to display bullet lists yet. ( I84d3d ) - Implemented experimental support for long screenshots in Compose scroll containers using the official Android API (
ScrollCaptureCallback). This feature is experimental and may not currently handle all cases correctly. For that reason it is currently disabled by default. To opt-in, set theComposeFeatureFlag_LongScreenshotsEnabledflag to true. This flag will be removed before 1.7 beta. ( I2b055 , b/329296471 ) - Introduce new
GraphicsLayerAPI to provide more flexibility in placement and rendering ofGraphicsLayerinstances and support intrinsic rendering features without needing to coordinate with Composable implementations to specifyGraphicsLayermodifier instances.
API Changes
- All
KeyboardOptionsparameters now have an unspecified value by default. AddedKeyboardOptions.mergemethod. - Renamed
KeyboardOptions.autoCorrecttoautoCorrectEnabledand made it nullable, where null indicates no value was specified. ( Ia8ba0 , b/295951492 ) - Renamed
outOfBoundsPageCounttobeyondViewportPageCount. ( I129c6 ) -
fun ClipEntry.getMetadata()is changed toval ClipEntry.clipMetadata. ( I50155 ) - Removed
TextFieldState.valueAsFlow(). Prefer usingsnapshotFlow { state.text }, orsnapshotFlow { TextFieldCharSequence(state.text, state.selection) }( I7d629 ) - Reorganized
InputTransformation.transformInputparameters. RemovedoriginalValue: TextFieldCharSequence. InsteadTextFieldBuffernow carries this value with the same name. Also removed thevalueWithChanges: TextFieldBufferparameter.TextFieldBuffernow is the receiver scope on the function. ( I919cc ) -
BasicTextField(state)variant andBasicSecureTextFieldnow useKeyboardActionHandlerinstead ofKeyboardActionsto process actions taken by the software keyboard. ( I58dda ) - Stylus handwriting delegation APIs to support stylus handwriting on "fake" text input fields. ( I9c09c , b/327271923 )
- Renamed
KeyboardOptions.shouldShowKeyboardOnFocustoshowKeyboardOnFocus. ( Ib4b7a , b/295951492 ) - Removed
hintMediaTypesparameter fromModifier.contentReceiver. Developers were already encouraged to check the receivedTransferableContent's media type since it could be incompatible with the configuredhintMediaTypes. ( I82f99 ) - Reordered the parameters of
BasicSecureTextField. RemovedkeyboardTypeandimeActionparameters in favor of fullKeyboardOptionsclass while keeping the same defaults appropriate forBasicSecureTextField. Also removed thescrollStateparameter. ( Ibbfa9 ) -
TextFieldState.text's type is changed fromTextFieldCharSequenceto justCharSequence. Therefore, addedTextFieldState.selection: TextRangeandTextFieldState.composition: TextRange?to read the current selection and composition values directly from the state object. - Removed
TextFieldState.forEachTextValue. ( Idb2a2 ) - Removed
ClipboardManager.getClipMetadataandClipboardManager.hasClipfunctions. Please useclipEntry.getMetadata()to read the current clip entry's metadata. Also checkClipboardManager.getClip's result if it's null or not to understand whether Clipboard has a current clip. ( I50498 ) -
ClipboardManager.setClipnow accepts null to be able to clear the Clipboard. ( I7d2e9 ) -
ReceiveContentListeneris converted to a function interface. AlsoModifier.receiveContentoverload that takes in a lambda is removed sinceReceiveContentListeneris a function interface now. -
Modifier.receiveContentis renamed toModifier.contentReceiver. ( I1e6af ) - Renamed
TransferableContent.consumeEachtoTransferableContent.consume. ( I1e462 ) -
rememberTextFieldStatehas graduated to a Stable API. ( I37999 )
Исправления ошибок
- Fixed a bug where
BasicTextField(state)variant did not work with CJK(composition based) keyboards. ( I54425 ) - Fixed a bug where
Modifier.dragAndDropTarget()could reference stale data in certain scenarios withModifier.Nodere-use. ( I05bb1 ) - Reverted a recent contract change where
AnchoredDraggableState#anchoredDragcalls would snap at the end of ananchoredDragoperation. ( I95715 )
Version 1.7.0-alpha05
20 марта 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha05 is released. Version 1.7.0-alpha05 contains these commits .
API Changes
- Removed experimental
LocalTextLinkStylecomposition local for styling hyperlinks. ( Iebfa7 ) - Removed experimental override of
BasicTextwithonLinkClickedargument. A replacement API for hyperlinks support will follow in the future. ( I107d5 ) - Removed Codepoints related methods and properties under
TextFieldStateandTextFieldBuffer. Also removed theinCharssuffixes from the remaining selection and composition related APIs. ( Ief7ce ) -
AnchoredDraggable'scurrentValuewill now update when passing through an anchor point. UsesettledValueto receive the previouscurrentValuesemantics, only updating when settling at an anchor. The progress is now exposed as a function (requiring a starting and end point) instead of a property. ( Ibe6e8 , b/318707189 , b/298271489 , b/294991954 ) -
BasicTextField(state),TextFieldState,InputTransformation,OutputTransformation,TextFieldLineLimits,TextFieldDecoratorare graduated to stable. ( I9582b ) - Introduced
InterceptPlatformTextInputfor helping write low-level IME-related tests and other low-level IME use cases.PlatformTextInputTestOverridehas been deprecated. ( I862ed , b/322680547 ) - Split
restrictedConstraints()to two methods:fitPrioritizingWidth()andfitPrioritizingHeight()( I6d7fd )
External Contribution
- Added 2 new API
isLastScrollForward/isLastScrollBackwardto check scroll direction for latest scroll action, return false if no scroll action yet. ( I63a0e )
Version 1.7.0-alpha04
6 марта 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha04 is released. Version 1.7.0-alpha04 contains these commits .
API Changes
- Support stylus handwriting feature on devices after Android U. ( I002e4 )
- Added
hintLocalestoKeyboardOptionsto provideTextFieldswith the ability to hint IMEs with specific locales to preset a preferred language. ( Id18c2 ) - Removed the Experimental
BasicTextField2andBasicSecureTextFieldoverloads that tookvalue: StringandonValueChange: () -> Stringparameters. ( I568b4 ) - Add an optional
applySemanticsfunction toInputTransformationto influence the semantics of theBasicTextField2that it's applied to. ( I74a2f , b/170648072 ) - In this CL we are adding the
GetScrollViewportLengthsemantic action so we can pipe up information about the components being scrolled in compose to the a11y system. This CL also applies the usage of said property in Foundation Scrollable Lists. ( Ic5fa2 ) -
BasicTextField2is renamed toBasicTextField. ( Ie5713 ) -
FocusRequester.createRefsis now stable ( I4d92c , b/261436820 ) - Introduced
DelegatableNode.scrollIntoView()to allow modifier nodes to makescrollIntoViewrequests directly. ( I2b3b7 , b/299939840 ) - Introduced
DelegatableNode.requireView()to allow modifier nodes to get the current AndroidViewwithout reading a composition local. ( I40768 ) - Introducing contextual layout information within Contextual Flow Row Scope and Contextual Flow Column Scope, featuring line index, position, and constraints on maximum width and height to stay in specified position. Items exceeding maximum width/height may flow to the next line or be omitted based on overflow settings. ( Id13f8 , b/292114798 )
Исправления ошибок
- Fixed a bug where in certain conditions toggling
enabledorreadOnlyattributes ofTextFieldwould cause a crash. ( Iae17b )
Version 1.7.0-alpha03
21 февраля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha03 is released. Version 1.7.0-alpha03 contains these commits.
API Changes
- Introduced
DelegatableNode.requireLayoutCoordinates()as a way to get aModifier.Node's currentLayoutCoordinateswithout needing to overrideonPlacedand store the coordinates in a property yourself. ( Ia8657 ) - Introduced
DelegatableNode.currentLayoutCoordinatesas a way to get aModifier.Node's currentLayoutCoordinateswithout needing to overrideonPlacedand store the coordinates in a property yourself. ( Iaebaa ) - Performance optimizations in
DraggableAnchorsused byAnchoredDraggable. ( I89cff ) -
BasicTextField2and related APIs underandroidx.compose.foundation.text2package are moved toandroidx.compose.foundation.text. ( I9f635 ) -
BasicTextField2no longer accepts aCodepointTransformationparameter. UseBasicSecureTextFieldorOutputTransformation. ( Id34ff ) - Added method to compare only the annotations of two
AnnotatedStrings. ( I32659 ) - Introducing
ContextualFlowRowand EnhancedFlowRow/ColumnwithMaxLinesandOverflow. We are excited to announce enhancements to the experimentalFlowRowandFlowColumn, now featuringmaxLinesand overflow support, alongside the debut ofContextualFlowRowandContextualFlowColumn. This update is designed to provide performance optimal components, whereContextualFlow*is perfect for a large number of items making use of a smallmaxLinesconfig and dynamic +N see more buttons, andFlowRowandFlowColumnis perfect for a small number of items, less than 100 items. Important: To maintain existing behavior inFlowRoworFlowColumnwhere all items are composed regardless of if they fit the cross axis max, setoverflowtoFlowRowOverflow.VisibleorFlowColumnOverflow.Visibleduring initialization. ExploreContextualFlowRowSampleandFlowRowSamplefor examples of these new features in action. ( Ib9135 , b/293577082 )
Исправления ошибок
- Cursor animation no longer requests frames between on and off states. ( Ia2253 )
-
KeyboardOptions' deprecated copy constructors will now correctly copy all properties. ( If12de )
Version 1.7.0-alpha02
7 февраля 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha02 is released. Version 1.7.0-alpha02 contains these commits.
API Changes
-
HorizontalPager,VerticalPagerandPagerStateare promoted to stable. ( I67660 , b/316966909 ) - Added
LocalTextLinkStylecomposition local that allows to change the style of the links in Text across the app. If you're using your own theme in the app, you should be setting this composition local according to your theming. When using Material theme the color of the link by default will be set to Material's primary color. ( I7eb10 ) - Introduced
receiveContentmodifier that provides developers with a way to receive rich content in Jetpack Compose. -
receiveContentintegrates withBasicTextField2to accept rich content provided by the software keyboard, or via Clipboard paste action. ( I81b72 ) - In this change we're replacing
SnapFlingBehaviorwithTargetedFlingBehaviorin pager to unlock other use cases and provide greater flexibility. ( I762ea ) - In this change we're making Snapping APIs Stable. We're also cleaning up some of the testing code and adding more samples to Snapping. ( Id8da9 )
- Introduce
TargetedFlingBehavior, aFlingBehaviorthat allows propagating information about the state of the ongoing animation and it's target scroll offset. ( I6a207 )
Исправления ошибок
-
BasicTextField2now keeps the cursor in view while typing when it has been scrolled out of view or would move out of view due to input. ( Ieb856 , b/237190748 )
External Contribution
- Adds an experimental API for configuring prefetch behavior of LazyLists. ( I022a4 )
Version 1.7.0-alpha01
24 января 2024 г.
androidx.compose.foundation:foundation-*:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.
Новые функции
- Added a new
Indication API,IndicationNodeFactory. This leads to more performantIndicationimplementations compared to the previous (now deprecated)rememberUpdatedInstanceAPI. For migration information, see developer.android.com . -
clickable / combinedClickable / selectable / toggleablenow accepts a nullableMutableInteractionSourceparameter. If null, and the providedIndicationis anIndicationNodeFactory, theIndicationcan be lazily created only when needed, which improves performance. If you are not hoisting and using theMutableInteractionSource, it is recommended to pass null.
API Changes
- Introduce
DecayAnimationinAnchoredDraggable, this change adds adecayAnimationSpecparameter toAnchoredDraggableallowing to use decay animation when settling to one of the anchors. The change also includes renaming the existinganimationSpectosnapAnimationSpecto help understanding the use case of each spec. -
BasicTextField2is available for experimental use. It should be roughly at feature parity withBasicTextField, and behavior should be production-ready. However, the API remains experimental for now. Before stabilizing, it will be renamed toBasicTextFieldand moved into the same package. - Introduced the first draft of the
OutputTransformationAPI forBasicTextField2. This API replaces most of the use cases ofVisualTransformationin the oldBasicTextField. However it is not complete yet, and some things won't work correctly, but we'd appreciate any feedback on the API usability for your use cases. ( aosp/2708848 ) - Introduced
LinkAnnotationthat allows to add links and clickables into text. Links feature is not complete yet and more API changes are coming. - Introduced
receiveContentmodifier that provides developers with a way to receive rich content in Jetpack Compose. -
receiveContentintegrates withBasicTextField2to accept rich content provided by the software keyboard, or via paste from Clipboard. -
KeyboardOptions.shouldShowKeyboardOnFocusallows you to disable the default behavior ofBasicTextFieldof requesting a software keyboard on focus. -
TextInputServiceandLocalTextInputServiceare now deprecated. UsePlatformTextInputModifierNodeto integrate directly with platform IME APIs instead. ( aosp/2862698 ) -
Indication#rememberUpdatedInstancehas been deprecated. It has a high unavoidable performance penalty, and prevents other optimizations. Instead, you should use the newIndicationNodeFactoryAPI.
Исправления ошибок
-
BasicTextFieldwill now pre-validate a small selection of offset mappings whenVisualTransformationis passed. This helps catch common coding errors that lead to unrecoverable exceptions in later measure or draw passes. By throwing during composition, it is more likely developers will see these errors during development helping avoid production crashes. ( I0fd42 ) -
VisualTransformationwill not throw if you return an invalid index for an invalid index ( b/316401857 )
Версия 1.6
Версия 1.6.8
12 июня 2024 г.
androidx.compose.foundation:foundation-*:1.6.8 is released. Version 1.6.8 contains these commits .
Версия 1.6.7
1 мая 2024 г.
androidx.compose.foundation:foundation-*:1.6.7 is released. Version 1.6.7 contains these commits .
Версия 1.6.6
17 апреля 2024 г.
androidx.compose.foundation:foundation-*:1.6.6 is released. Version 1.6.6 contains these commits .
Исправления ошибок
- Fixed a bug where in certain conditions toggling
enabledorreadOnlyattributes ofTextFieldwould cause a crash. ( Iae17b )
Версия 1.6.5
3 апреля 2024 г.
androidx.compose.foundation:foundation-*:1.6.5 is released. Version 1.6.5 contains these commits .
Исправления ошибок
- Adds debugging logs to hard-to-reproduce bugs in Row/Column: ( b/300280216 and b/297974033 )
Версия 1.6.4
20 марта 2024 г.
androidx.compose.foundation:foundation-*:1.6.4 is released. Version 1.6.4 contains these commits .
Исправления ошибок
- A long-press-then-drag selection gesture which moves out of the text's layout bounds in the first frame of the drag no longer crashes. ( Icdf90 , b/325307463 )
Версия 1.6.3
6 марта 2024 г.
androidx.compose.foundation:foundation-*:1.6.3 is released. Version 1.6.3 contains these commits .
Версия 1.6.2
21 февраля 2024 г.
androidx.compose.foundation:foundation-*:1.6.2 is released. Version 1.6.2 contains these commits.
Исправления ошибок
- Fix
AnimateContentSizenot resetting properly. ( I07051 ) - Fix issue where
intrinsicHeightof text would be over-cached in some circumstances. ( 3cd398 , b/217910352 )
Версия 1.6.1
7 февраля 2024 г.
androidx.compose.foundation:foundation-*:1.6.1 is released. Version 1.6.1 contains these commits.
Исправления ошибок
- Fix staggered grid measure when scrolled over limit. ( bffc39 )
- Add check for layout with large dimensions. ( e74af5 )
- Fix placement of 0-sized items at the start of the staggered grid. ( 785f94 )
- Call onRelease callback in the same order as onForgotten. ( 31ce3b )
Версия 1.6.0
24 января 2024 г.
androidx.compose.foundation:foundation-*:1.6.0 is released. Version 1.6.0 contains these commits.
Important changes since 1.5.0
- New Modifier
Modifier.anchoredDraggablethat unlocks the ability to drag and animate between predefined set of anchors. This modifier is intended to be a replacement forModifier.swipeable. Learn how to use it and migrate fromModifier.swipeablein the migration guide . - Drag and drop functionality between apps and components has been added. Refer to
DragAndDropTarget,Modifier.dragAndDropSourceand other APIs to get started -
Modifier.draggable2Dis the new modifier that allows for easy 2d dragging support. See Sample . -
AndroidExternalSurfaceandAndroidEmbeddedExternalSurfacehave been added to make it easier to add surface-driven components in compose - Various API changes and improvements in
PagerandsnapFlingBehaviour - Various focus, text and insets APIs have been promoted to stable APIs
Version 1.6.0-rc01
10 января 2024 г.
androidx.compose.foundation:foundation-*:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.
API Changes
- The
DragAndDropTarget()extension constructor has been removed. Create a new instance usingobject: DragAndDropTarget {}. ( I32318 )
Version 1.6.0-beta03
13 декабря 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-beta03 is released. Version 1.6.0-beta03 contains these commits.
Исправления ошибок
- Fix crash that impacted very large text measured with infinite constraints. ( I1a7df , b/312294386 )
-
PlatformImeOptionsis now a concrete class instead of an interface. ( If40a4 )
Version 1.6.0-beta02
29 ноября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-beta02 is released. Version 1.6.0-beta02 contains these commits.
Исправления ошибок
- Fix for
canScrollnot being updated after relayout-only scroll. ( I60a86 ) - Fix for
Modifier.animateItemPlacement()andLookaheadScopeafter small scrolls. ( I3a2b7 )
Version 1.6.0-beta01
15 ноября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.
API Changes
- The
DragAndDropTargetmodifier now takes in the receivingDragAndDropTargetexplicitly and has a lambda to opt into a drag and drop session. There are now two factory functions for aDragAndDropModifierNode. One for receiving transfers and one for transferring data ( I69481 ) - Updated
maximumFlingVelocityto be represented as Float. Updated documentation to be more clear about themaximumFlingVelocityunity. ( I8adc7 ) onDragAndDropStartin theDragAndDropModifierNodefactory has been renamed toacceptDragAndDropTransfer.acceptsDragAndDropTransferhas been added to thedragAndDropTargetModifierto accept from a drag and drop session. This lambda returns a viableDragAndDropTargetif interested in a drag and drop session. Other lambdas for processing drag events have been replaced by this.a
DragAndDropTargetfactory function has been added to receive from drag and drop sessions ( Iebf3a )Exposing
startDragImmediatelyinAnchoredDraggablegives control for detecting dragging gestures when using it. It is useful to set it when the widget is animating to a target anchor. See Sample . ( Ie6d13 , b/285139987 )Foundation Tooltip APIs are now
@ExperimentalFoundationApi( I30b0b )Removed
DragAndDropInfoas a typeDragAndDropModifierNode.dragnow takes parameters for thetransferData, decoration size and drag decorationDrawScopelambdaDragAndDropTargethas methods for particular drag and drop events instead of being a single abstract methodonDragAndDropEventin the factory function for aDragAndDropModifierNodehas been renamed toonDragAndDropStartto better communicate that theDragAndDropTargetprovided is valid for a given drag and drop session onlyThe
DragAndDropEventTypehas been removed ( I645b1 )Renamed
PlatformTextInputModifierNode.runTextInputSessiontoestablishTextInputSession. ( I03cd0 )Replace
OriginalTextbyTextSubstitution. ( Ifa5a8 )Renamed
PlatformTextInputModifierNode.textInputSessiontorunTextInputSession. ( Ie9c6b )The children of
SubcomposeLayout(and layouts likeLazyColumnbased on it) which are retained to be reused in future are considered deactivated. NewassertIsDeactivated()test API was introduced to test such nodes. The rest of the test apis will filter out deactivated nodes by default. ( I2ef84 , b/187188981 )clippingEnabledparameter ofModifier.magnifieris renamed toclip.magnifierCenterparameter ofModifier.magnifieris made nullable preserving the same default behavior. ( I6aa66 )Material
SwipeToRevealAPIs (for Cards and Chips) now rely on a slot based API (as recommended by Compose) instead of data class based instances to create those slots. This is a breaking change, please see the demo and sample code for examples on how to use the new API. ( Ia8943 )
Исправления ошибок
- Implement equals and hashcode for
PageSize.Fixed. ( Ie3ede , b/300134276 ) - Fixed a bug that would cause
BasicTextlayout to not shrink whenminWidthchanged andminWidthless than initial measure constraintsmaxWidth( Idb19c ) - Add renderer support for Sweep Gradient in
ArcLine. ( I4d5bb ) - Fix binary compatibility issue with Window Inset change ( Iee695 )
- Remove material core layer for Material3 Chip/Button as the microbenchmarks show better performance without it. ( I55555 )
Version 1.6.0-alpha08
18 октября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha08 is released. Version 1.6.0-alpha08 contains these commits.
Новые функции
-
Modifier.draggable2Dis the new modifier that allows for easy 2d dragging support. See Sample ( Id95f5 , b/214412658 )
API Changes
-
Modifier.dragAndDrawSourcehas had theonDrawDragShadowlambda renamed todrawDragDecorationandDragAndDropInfohas had the size parameter renamed todragDecorationSize. ( Id0e30 , b/303904810 ) -
BasicTextField2'sdecorationBoxparameter is renamed todecorator. Its type is also changed to an equivalent fun interfaceTextFieldDecorator. ( I23c1c )
Исправления ошибок
- Improved documentation on
BasicTextFieldregardingonValueChangerequirements. ( I90fc9 , b/160257648 )
Version 1.6.0-alpha07
4 октября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha07 is released. Version 1.6.0-alpha07 contains these commits.
API Changes
- Introduced
PlatformTextInputMethodTestOverridefor writing tests for custom text editors. ( Id159b ) - Renamed
GraphicsSurfacetoAndroidExternalSurface( I11680 ) - Added
DisableNonLinearFontScalingInComposetemporary flag to disable non-linear font scaling. SetDisableNonLinearFontScalingInCompose = truein your tests if you need time to clean them up. This flag will be removed in Compose 1.6.0-beta01. ( Ic9486 ) - Added
ColorListandColorSetcollections that avoid allocations. ( I744bd ) - This change removes
shortSnapVelocityThresholdwhich has been turned into an implementation detail of the implementations ofSnapLayoutInfoProvider. ( I65f6d ) - Adds
dragAndDropSourceModifier for starting drag and drop sessions, anddragAndDropTargetModifier for receiving from drag and drop sessions ( Ib7828 , b/286038936 ) - Update
SnapPositionInLayoutdocumentation and position method. Introduce content paddings to the position method inSnapPositionInLayout. ( Id7938 , b/300116110 ) - Added
UndoStatetoTextFieldStatethat provides the ability to undo/redo the changes made by the user. ( Icc024 )
Исправления ошибок
- Fixed
basicMarqueenot animating after velocity change. ( Id2e77 , b/297974036 )
Version 1.6.0-alpha06
20 сентября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha06 is released. Version 1.6.0-alpha06 contains these commits.
Новые функции
- New Composable wrappers for
SurfaceViewandTextureView: GraphicsSurface()andEmbeddedGraphicsSurface(). It is an experimental API and is subject to changes and modifications. ( I9ddb2 ) -
Modifier.magnifier()is now a stable API. This includes the removal ofMagnifierStylein favor of inline parameters in the modifier itself. ( I83bec , b/298381260 , b/262367109 , b/261438887 )
API Changes
- Introduced
updateCurrentPageandupdateTargetPageinScrollScope, these are the last pieces necessary to allowing customization of animated scroll throughPagerState.scroll. ( I9cad5 , b/267744105 , b/243786897 ) - Remove density from
SnapFlingBehavior. All implementations ofSnapLayoutInfoProvideralready have a way of accessing the density, the receiver scope could be removed which will lead to a less complex implementation of bothSnapFlingBehaviorandSnapLayoutInfoProviders. ( I153c3 ) - More modifiers marked as stable. ( I56af1 , b/298046462 )
- Removed
SnapStepSizefromSnapLayoutInfoProvider. The calculation should be done using the Layout information and provided through the approach or snapping offsets. ( If320c )
Изменения поведения
- Compose now uses non-linear font scaling for better readability and accessibility. When font scale > 100% in system settings, small text will increase in size normally, but already-large text will only increase a little bit. Also, line heights defined in SP will automatically adjust to stay proportional to the 100% scale intended height. See the Font Scaling Best Practices for more info. ( I11518 )
Исправления ошибок
- Remove the use of
rememberSaveablefor tooltips. ( Icc131 , b/299500338 )
Version 1.6.0-alpha05
6 сентября 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha05 is released. Version 1.6.0-alpha05 contains these commits.
API Changes
- Add overloads for
BasicSecureTextFieldthat accept an immutable value and a callback to change that value, just like the currentBasicTextFieldAPI. ( Ia4882 ) - Add
Modifier.preferKeepClear()to mark as composable as preferring to keep clear of floating windows on API 33 and above. ( Ib51d5 , b/297260115 ) - Fling velocities in View components like
ScrollViewandRecyclerVieware capped atViewConfiguration.ScaledMaximumFlingVelocity. Compose now contains its own version ofmaximumFlingVelocitywhich now applies toDraggable. ( Ibf974 ) - Removed deprecated
PagerandPagerStateoverloads. ( Iea07e ) - Added
BasicTooltipBoxtocompose.foundationand updatedPlainTooltipBoxandRichTooltipBoxto useTooltipBoxwith newPlainTooltipandRichTooltipcomposables. ( I79e1d )
Version 1.6.0-alpha04
23 августа 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha04 is released. Version 1.6.0-alpha04 contains these commits.
API Changes
- Add
ReusableCompositioninterface for managing lifecycle and reuse of subcompositions. ( I812d1 , b/252846775 ) -
Modifier.focusGrouphas been promoted to stable APIs. ( I7ffa3 ) - Add overloads for
BasicTextField2that accept an immutable value and a callback to change that value, just like the currentBasicTextFieldAPI. ( I3f2b8 ) -
GridItemSpan::currentLineSpanis now a stable API. ( Icc29c ) - Canvas that accepts
contentDescriptionis now a stable API. ( Ib3d29 ) - Introduced
viewportSizeinScrollState, a way of knowing theviewPortsize of the component that usesScrollStateafter measuring happens. ( I8b85a , b/283102682 ) - Fixed an issue where the prefetching in Pager did not match the behavior in Views. ( I93352 , b/289088847 )
-
Modifier.consumeWindowInsets(PaddingValues)is now stable.-
Deprecated Modifier.consumedWindowInsetsAPI is now removed. UseModifier.consumeWindowInsetsinstead. ( Id72bb )
-
Version 1.6.0-alpha03
9 августа 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.
API Changes
- Overload of
LazyLayoutadded, it accepts a lambda ofLazyLayoutItemProvider, not a plain object as it was before. The previous overload is deprecated. ( I42a5a ) - Added support for configuring
privateImeOptions( Idb772 )
Исправления ошибок
- Fixed text fields showing keyboard and being editable when
readOnlyis true. Also fixed the keyboard not showing whenreadOnlyis changed from true to false while focused. ( I34a19 , b/246909589 )
Version 1.6.0-alpha02
26 июля 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.
API Changes
- Introduced
PagerLayoutInfowith information collected after a measure pass inPager. Also introducedPageInfo, the information about a single measured Page inPager. ( Iad003 , b/283098900 ) - Additional annotations to specify allowed inputs to composables ( I51109 )
- Added
SemanticsNodeInteraction.requestFocusas a more convenient and discoverable way to request focus in tests. ( Ie8722 ) - Completely redesigned
PlatformTextInput*API. ( I6c93a , b/274661182 , b/267235947 , b/277380808 ) -
SoftwareKeyboardControllerandLocalSoftwareKeyboardControllerare no longer experimental.LocalSoftwareKeyboardControlleris also now a properCompositionLocal. ( I4c364 ) -
Modifier.transformablenow provides pan delta incanPanparameter to help determine the direction of the pan to allow or disallow it. ( I692aa , b/266829800 ) - Updates the modifier
consumeWindowInsetsto extend the superclassAbstractComposeView( Iacd74 , b/269479941 )
Version 1.6.0-alpha01
21 июня 2023 г.
androidx.compose.foundation:foundation-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
Новые функции
- Introduced a new
AnchoredDraggableAPI in Foundation. It can be used to build components that can be dragged between discrete states, like modal bottom sheets. This API replaces Material'sSwipeableAPI. ( I4a2ed )
API Changes
- Support
InputConnection#requestCursorUpdates( I0c69b ) - Introduced
scrollAnimationSpecto allow custom animation specs. UpdatedBringIntoViewCalculatortoBringIntoViewScroller. ( Idb741 ) - Add
ResourceResolutionExceptiontype to wrap throwables thrown when attempting to load bitmap assets with a description of the asset path that failed to load. ( I19f44 , b/230166331 , b/278424788 ) - Added semantics properties and actions to support text translation. ( I4a6bc )
- Introduced a
BringIntoViewCalculatorAPI that can be used to customize how components likeScrollablerespond tobringIntoViewrequests. Changed the overload of scrollable to optionally accept an instance ofBringIntoViewCalculator. ( Iaf5af )
Исправления ошибок
- Added a lint check to warn if you are creating a
MutableInteractionSourcein composition without remembering it, similar to the lint checks for creating mutable state /Animatable. ( I5daae ) - Added support for selection by mouse. Touch based selection will expand by word, and shrink by character. ( Ic0c6c , b/180639271 )
- Added
FocusTargetModifierNodeinterface that can be used to create a customFocusTarget. ( I9790e )
Версия 1.5
Версия 1.5.4
18 октября 2023 г.
androidx.compose.foundation:foundation-*:1.5.4 is released. Version 1.5.4 contains these commits.
Версия 1.5.3
4 октября 2023 г.
androidx.compose.foundation:foundation-*:1.5.3 is released. This version has no changes.
Версия 1.5.2
27 сентября 2023 г.
androidx.compose.foundation:foundation-*:1.5.2 is released. Version 1.5.2 contains these commits.
Исправления ошибок
- Fixed a bug in text that led to crashes in certain circumstances when semantics were invalidated.
Версия 1.5.1
6 сентября 2023 г.
androidx.compose.foundation:foundation-*:1.5.1 is released. Version 1.5.1 contains these commits.
Исправления ошибок
- Fixed text fields showing keyboard and being editable when
readOnlyis true. Also fixed the keyboard not showing whenreadOnlyis changed from true to false while focused. ( I34a19 , b/246909589 )
Версия 1.5.0
9 августа 2023 г.
androidx.compose.foundation:foundation-*:1.5.0 is released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- Many foundational modifiers, including
Modifier.clickable,Modifier.draggable,Modifier.scrollable, layout modifier and more have been migrated toModifier.NodeAPI, reducing the overhead on the initial composition. - Improvements in Pagers stability. Many bugs have been addressed.
-
pageCountparameters now lives inPagerStateinstead of the Pager itself
Version 1.5.0-rc01
26 июля 2023 г.
androidx.compose.foundation:foundation-*:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.
Исправления ошибок
An optional inspection to recommend migrating
mutableStateOf()calls to their corresponding specialized types for primitives is available. Its lint ID isAutoboxingStateCreation. Previously, this inspection was enabled by default for all projects. To see this warning in Android Studio's editor and your project's lint outputs, change its severity from informational to warning (or higher) by declaringwarning "AutoboxingStateCreation"inside your module'sbuild.gradleorbuild.gradle.ktsconfiguration as shown ( I34f7e ):android { lint { warning "AutoboxingStateCreation" } ... }
Version 1.5.0-beta03
28 июня 2023 г.
androidx.compose.foundation:foundation-*:1.5.0-beta03 is released. Version 1.5.0-beta03 contains these commits.
Version 1.5.0-beta02
7 июня 2023 г.
androidx.compose.foundation:foundation-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Version 1.5.0-beta01
24 мая 2023 г.
androidx.compose.foundation:foundation-*:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
API Changes
- Implement
PlatformDataProviderto provide heart rate and daily steps.SensorGatewayinterface is removed from the public API. ( I55b84 )
Исправления ошибок
- Reduce allocations during lazy list/grids/etc. measurements ( Iaf9e2 )
- Reduced allocations when applying snapshots ( I65c09 )
- Removed allocations from spring animations ( Ie9431 )
- Removed allocation from
TextLayout( I0fd11 ) - Removed multiple allocations in pointer velocity tracking ( I26bae )
Version 1.5.0-alpha04
10 мая 2023 г.
androidx.compose.foundation:foundation:1.5.0-alpha04 and androidx.compose.foundation:foundation-layout:1.5.0-alpha04 are released. Version 1.5.0-alpha04 contains these commits.
API Changes
- Added optimized
TextStyle.merge(...)with full parameter list. ( Iad234 , b/246961787 ) - Introduce a
SnapLayoutInfoProviderthat can be used withLazyGridState. ( I92134 , b/269237141 , b/260914964 ) - Experimental
Modifier.animateItemPlacement()was added for the lazy staggered grids item scope. You can apply it on the items in order to achieve the automation position change/reordering animations. ( I4b62d , b/257034719 ) - Promote
GridCells.FixedSizeto stable.FixedSizedefines aLazyGridwhere each cell takes exact size on cross axis, with the remaining space distributed by cross axis arrangement. ( I8542f ) - Introduced receiver scope
PagerScopefor Pager and an utility function for calculation a given page offset. ( If2577 ) - Introduce the
snapPositionalThresholdwhen creating a snap fling behavior. Use this parameter to specify a positional threshold to short snapping in Pager. ( If8f7f ) - Replaced
SnapLayoutInfoProvider.calculateSnappingOffsetBoundswithcalculateSnappingOffset. In this new method we simply request the next offset to snap to. The calculation of the bounds should be performed at the implementation level as this may differ depending on how one needs snapping to happen. ( I923a4 ) -
LazyStaggeredGridAPIs have been promoted to stable. ( I633a5 ) - Remove
pageCountfromHorizontal/VerticalPager. This should be provided at the state creation. UpdatedPagerStateandrememberPagerStateto accept thepageCount. ( Ieb52d , b/266965072 ) - Remove
pageCountfromHorizontal/VerticalPager. This should be provided at the state creation. UpdatedPagerStateandrememberPagerStateto accept thepageCount. ( Ifa3cb , b/266965072 ) - Introduce
shortSnapVelocityThresholdin Pager'sSnapFlingBehavior. ( I7379e , b/275579012 ) - Adds a
FlowRowScopeandFlowColumnScope. ( I54fe2 )
Исправления ошибок
- Calls to get semantics on Text when constraints have
minWidthandminHeightno longer crash. ( Ibd072 ) - Fixed regression where keyboard wasn't showing for text fields inside dialogs not created by the
Dialogcomposable. ( I82551 , b/262140644 )
Version 1.5.0-alpha03
19 апреля 2023 г.
androidx.compose.foundation:foundation:1.5.0-alpha03 and androidx.compose.foundation:foundation-layout:1.5.0-alpha03 are released. Version 1.5.0-alpha03 contains these commits.
This release enables the new text rendering stack for Compose. The new stack is performance optimized, and you should see no visible changes.
If you do see changes in rendered text, you can debug by setting NewTextRendering1_5 = false to confirm the behavior difference. Setting this will force recomposition. Please file any behavior differences as bugs.
The debug flag will be removed before the 1.5 beta01 release.( Iada23 , b/246960758 )
API Changes
- Make
FlowColumn/FlowRowinline. ( Idab37 )
Version 1.5.0-alpha02
5 апреля 2023 г.
androidx.compose.foundation:foundation:1.5.0-alpha02 and androidx.compose.foundation:foundation-layout:1.5.0-alpha02 are released. Version 1.5.0-alpha02 contains these commits.
API Changes
- Added support for fixed size cells in
LazyGridand arranging them with cross axis arrangement. ( I83ed9 , b/235121277 , b/267942510 ) - Added support for fixed size lanes in
LazyStaggeredGridand arranging them with cross axis arrangement. ( I7d519 ) -
UrlAnnotations inAnnotatedStrings can now be opened via accessibility services likeTalkBack. ( If4d82 , b/253292081 ) - Added the
InsertTextAtCursorsemantics action for text fields. ( I11ed5 ) - Text-related test actions (eg
performTextInput) will now request focus directly, using the semantics action, instead of clicking on the field. ( I6ed05 ) - Adds support for cross axis spacing/arrangement using the
verticalArrangementinFlowRowandhorizontalArrangementinFlowColumn. We also remove the top-levelverticalAlignmentandhorizontalAlignmentinFlowRow/FlowColumn. Developers can useModifier.aligninstead. This reduces confusion between the naming conventions ofverticalAlignmentandverticalArrangement. ( I87b60 , b/268365538 )
Version 1.5.0-alpha01
22 марта 2023 г.
androidx.compose.foundation:foundation:1.5.0-alpha01 and androidx.compose.foundation:foundation-layout:1.5.0-alpha01 are released. Version 1.5.0-alpha01 contains these commits.
API Changes
- Text and
BasicTextis refactored to use the new modifier system. This leads to substantial performance improvements in many cases. No changes should be visible. ( If1d17 , b/246961435 ) - Added the
PerformImeActionsemantics action to invoke the IME action on text editor nodes. ( Ic606f , b/269633506 )
Исправления ошибок
- Updated internals of
Modifier.hoverable. Thehoverablemodifier will only be shown in the inspector if it is enabled. ( I82103 )
Версия 1.4
Версия 1.4.3
3 мая 2023 г.
androidx.compose.foundation:foundation:1.4.3 and androidx.compose.foundation:foundation-layout:1.4.3 are released with no changes (only a version bump).
Версия 1.4.2
19 апреля 2023 г.
androidx.compose.foundation:foundation:1.4.2 and androidx.compose.foundation:foundation-layout:1.4.2 are released. Version 1.4.2 contains these commits.
Версия 1.4.1
5 апреля 2023 г.
androidx.compose.foundation:foundation:1.4.1 and androidx.compose.foundation:foundation-layout:1.4.1 are released. Version 1.4.1 contains these commits.
Версия 1.4.0
22 марта 2023 г.
androidx.compose.foundation:foundation:1.4.0 and androidx.compose.foundation:foundation-layout:1.4.0 are released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
- Added Emoji compat integration to
TextandTextField, as well as the lower level Paragraph. It is enabled by default when emojicompat is configured. -
EmojiCompatcan be configured on a specific Text usingPlatformParagraphStyle. - Added full line span support to
LazyStaggeredGrid(I28252) - Adding experimental
onHovertoClickableText(I6938f) - Introduced new experimental overloads for the
runComposeUiTestfunction andcreate*ComposeRulefunctions that acceptCoroutineContextparameters. The context will be used for the test composition and anyLaunchedEffectandrememberCoroutineScope()calls in the composition. ( I10614 , b/265177763 ) -
FlowRowandFlowColumnare now available as@ExperimentalFoundationApithat allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 ) -
Modifier.basicMarquee()is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )
Version 1.4.0-rc01
8 марта 2023 г.
androidx.compose.foundation:foundation:1.4.0-rc01 and androidx.compose.foundation:foundation-layout:1.4.0-rc01 are released. Version 1.4.0-rc01 contains these commits.
API Changes
- Introduced new low-level
PlatformTextInputAdapterAPI for building custom text input implementations that talk directly to platform APIs. ( I58df4 ) - Add support for reverse layout to
LazyStaggeredGrid. ( I3ef4a )
Исправления ошибок
-
BasicTextField'sSetTextsemantics action will now update the text buffer using the same code path as IME updates and the testing functions (egperformTextReplacement). - Text testing functions
performTextClearance,performTextReplacement, andperformTextSelectionnow useSemanticsActions. ( I0807d , b/269633168 , b/269624358 )
Version 1.4.0-beta02
22 февраля 2023 г.
androidx.compose.foundation:foundation:1.4.0-beta02 and androidx.compose.foundation:foundation-layout:1.4.0-beta02 are released. Version 1.4.0-beta02 contains these commits.
API Changes
- Added a new
Modifier.Node.onReset()callback allowing you to reset some local state to properly handle the case when theLayoutwill be reused (for example as an item ofLazyColumn). FixedFocusTargetModifierNodeto properly reset the focused state. ( I65495 , b/265201972 ) - Added
BlendModeparameter toDrawScope.drawText,Paragraph.paint, andMultiParagraph.paintmethods to support different blending algorithms when drawing text on Canvas. ( I57508 ) - Removed the
modifierElementOf()API. Please extend fromModifierNodeElementdirectly instead. ( Ie6d21 )
Исправления ошибок
- Adjusting selection handles can no longer select a partial character. ( Idedd1 )
- Fix crash when ctrl+backspace on empty
TextField( I0427f , b/244185537 )
Version 1.4.0-beta01
8 февраля 2023 г.
androidx.compose.foundation:foundation:1.4.0-beta01 and androidx.compose.foundation:foundation-layout:1.4.0-beta01 are released. Version 1.4.0-beta01 contains these commits.
Новые функции
- Since 1.3, added Emoji compat integration to
TextandTextField, as well as the lower level Paragraph. It is enabled by default when emojicompat is configured. -
EmojiCompatcan be configured on a specific Text usingPlatformParagraphStyle.
API Changes
- Added common implementation of
PinnableContainerAPI used in allLazyLayoutsto retain items that exit composition, but still need to be active. ( If45a4 ) -
PinnableContainer.PinnedHandle.unpin()was renamed torelease()( I4667a )
External Contribution
- Added
mainAxisItemSpacingproperty toLazyListLayoutInfo,LazyGridLayoutInfoandLazyStaggeredGridItemInfo( I52fad )
Version 1.4.0-alpha05
25 января 2023 г.
androidx.compose.foundation:foundation:1.4.0-alpha05 and androidx.compose.foundation:foundation-layout:1.4.0-alpha05 are released. Version 1.4.0-alpha05 contains these commits.
Новые функции
- Added full line span support to
LazyStaggeredGrid( I28252 ) - Adding experimental
onHovertoClickableText( I6938f ) - Introduced new experimental overloads for the
runComposeUiTestfunction andcreate*ComposeRulefunctions that acceptCoroutineContextparameters. The context will be used for the test composition and anyLaunchedEffectandrememberCoroutineScope()calls in the composition. ( I10614 , b/265177763 )
API Changes
- Merges the pre/post APIs of
OverscrollEffectinto combined 'decorator'applyToScrollandapplyToFlingfunctions. See the updated samples in the documentation for examples of how to implement an overscroll effect with the new API shape. ( I8a9c4 , b/255554340 ) - More type/nullability of inline/deprecated-hidden functions ( I24f91 )
-
LineBreakandHyphensAPIs inTextStyleare graduated to stable. ( Ic1e1d )
Исправления ошибок
- The cursor in text fields will now continue to blink even when animations are disabled. ( I95e70 , b/265177763 )
-
Modifier.basicMarqueenow animates even when animations are disabled in the system settings. ( I23389 , b/262298306 , b/265177763 )
External Contribution
-
notifyFocusedRectmethods inTextInputSessionandTextInputServiceare not deprecated again. ( I23a04 , b/262648050 )
Version 1.4.0-alpha04
11 января 2023 г.
androidx.compose.foundation:foundation:1.4.0-alpha04 and androidx.compose.foundation:foundation-layout:1.4.0-alpha04 are released. Version 1.4.0-alpha04 contains these commits.
Новые функции
-
FlowRowandFlowColumnare now available as@ExperimentalFoundationApithat allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 ) -
Modifier.basicMarquee()is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )
API Changes
-
FocusRequesterModifieris deprecated in favor ofFocusRequesterNode( I7f4d7 , b/247708726 , b/255352203 , b/253043481 , b/247716483 , b/254529934 , b/251840112 , b/251859987 , b/257141589 ) -
AndroidFontconstructor withvariationSettingsis now a stable API, and can be used to create new types of font descriptors. ( I5adcc , b/261565807 ) - Introduced
PinnableContainerapi propagated by lazy lists via a composition local which allows to pin current item. This means such item will not be disposed when it is scrolled away from the view. For example,Modifier.focusable()will pin the current focused item via this mechanism. ( Ib8881 , b/259274257 , b/195049010 ) - Rewrote the way scrollables respond to
bringIntoViewRequestersand focusables to better model the complexity of those operations and handle more edge cases. ( I2e5fe , b/241591211 , b/192043120 , b/237190748 , b/230756508 , b/239451114 ) - More return type nullability of deprecated-hidden functions ( Ibf7b0 )
- Added experimental
TextMotiontoTextStyleto define Text either to beStatic(default)or Animated. UseTextMotion.Animatedif Text is going to be scaled, translated, or rotated via animation. ( I24dd7 ) - Add
TextFieldFocusModifierto fix focus navigation behaviour for android platform ( I00303 ) - Replaced
maxSize: IntSizeargument indrawTextwithsize: Sizeto be inline with otherDrawScopefunctions.sizeis set toSize.Unspecifiedby default which should not change the previous default behavior. ( Icd27d )
Исправления ошибок
- Adjustments in the snapping physics in
SnapFlingBehaviourfor a more natural feel.
Известная проблема
- When updating from
androidx.compose.foundation:1.4.0-alpha03toandroidx.compose.foundation:1.4.0-alpha04, you might experience ajava.lang.NoSuchFieldErrorerror. Here is where the issue was orginially reported. A fix has been submitted, and will be available on the next Compose update. As a work around, update yourandroidx.compose.materialandandroidx.compose.material3libraries to the latest version(1.1.0-alpha04) or downgrade yourandroidx.compose.foundationto 1.4.0-alpha03.
Version 1.4.0-alpha03
7 декабря 2022 г.
androidx.compose.foundation:foundation:1.4.0-alpha03 and androidx.compose.foundation:foundation-layout:1.4.0-alpha03 are released. Version 1.4.0-alpha03 contains these commits.
API Changes
- In UI tests using a Compose rule, continuations resumed during
withFrameNanoscallbacks will not be dispatched until after all frame callbacks have finished running. This matches the behavior of compose when running normally. However, tests that rely on the old behavior may fail. This should only affect code that callswithFrameNanosorwithFrameMillisdirectly, and has logic outside of callback passed to those functions that may need to be moved inside the callbacks. See the animation test changes in this CL for examples . - Added optional
onPerformTraversals: (Long) -> Unitparameter toTestMonotonicFrameClockconstructor and factory function to run code afterwithFrameNanoscallbacks but before resuming callers' coroutines. ( Idb413 , b/254115946 , b/222093277 , b/255802670 ) - Introduce Page accessibility actions:
PageUp,PageDown,PageLeft,PageRight. Note that these are only available from API 29. ( Ida4ab ) - Introduce
HorizontalPagerandVerticalPager, a way of showing composables in a Pager manner. IntroducedPagerStateto control the Pagers as well as query information about the Pager's current state. IntroducedPageSize, a way of controlling the size of a Pager's page, this can be used to create a carousel like Pagers. IntroducedPagerSnapDistance, a way to control how snapping will work in Pager's fling behavior. ( I01120 ) - Introduced an overload in
SnapFlingBehavior.performFlingto help to understand where the fling will settle. ( I569f6 ) - Removed
OverscrollEffect#isEnabled. Instead of needing to remember and set this flag, just don't dispatch events to the overscroll effect in cases where you do not want overscroll to show (for example ifScrollableState#canScrollForward/backwardboth return false). ( I1a4b0 , b/255554340 , b/255557085 ) - Added
ScrollableState#canScrollForwardandScrollableState#canScrollBackwardto query whether aScrollableStatehas room to scroll in either direction (whether it is at the minimum / maximum of its range). This defaults to true for backwards compatibility with existing implementations ofScrollableState. Consumers can use this to show indication to the user that there is still room to scroll, and this could also be used to avoid dispatching delta toScrollableStatesthat have no room to scroll in a given direction, to reduce unnecessary work. ( Idf1a0 , b/255557085 ) - Added an Modifier API to query ancestors scroll info. ( I2ba9d , b/203141462 )
- Used in
Clickableto correctly delay press interactions, when gestures could become scroll events. - Fixed
Clickablesnot correctly delaying ripples, when used inside anScrollable ViewGroup. - Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events.
- Update
snapStepSizenaming to be consistent with other methods inSnapLayoutInfoProvider. ( Ife67c ) - Added
EmojiCompattoCompose( Ibf6f9 , b/139326806 ) - Renamed
consumedWindowInsets()toconsumeWindowInsets()andwithConsumedWindowInsets()toonConsumedWindowInsetsChanged()and made the Modifiers public. ( Ie44e1 )
Исправления ошибок
- The crash with
Modifier.animateItemPlacement()and Lazy grids was fixed. It was happening in some conditions when the new items count is smaller then the previous one. ( I0bcac , b/253195989 )
Version 1.4.0-alpha02
9 ноября 2022 г.
androidx.compose.foundation:foundation:1.4.0-alpha02 and androidx.compose.foundation:foundation-layout:1.4.0-alpha02 are released. Version 1.4.0-alpha02 contains these commits.
API Changes
-
awaitFirstDownandwaitForUpOrCancellationnow accept aPointerEventPassfor greater flexibility. ( I7579a , b/212091796 ) - Revert
beyondBoundCountAPI from Lazy* APIs ( I12197 ) - Introduced parameter in Lazy APIs to compose and place out of viewport items ( I69e89 , b/172029355 )
- Added
minLinesparameter to theBasicTextandBasicTextField. It allows to set the minimum height of these composables in terms of number of lines ( I24294 , b/122476634 )
Version 1.4.0-alpha01
24 октября 2022 г.
androidx.compose.foundation:foundation:1.4.0-alpha01 and androidx.compose.foundation:foundation-layout:1.4.0-alpha01 are released. Version 1.4.0-alpha01 contains these commits.
API Changes
- A new method,
awaitEachGesture(), for gesture detectors was added. It operates similar toforEachGesture(), but the loop over gestures operates entirely within theAwaitPointerEventScopeso events can't be lost between iterations. -
forEachGesture()has been deprecated in favor ofawaitEachGesture()because it allows events to be lost between gestures. ( Iffc3f , b/251260206 ) - Added
WindowInsets.imeAnimationSource andWindowInsets.imeAnimationTargetto determine the animation progress and know where the IME will be after animation completes. ( I356f1 , b/217770337 )
Версия 1.3
Версия 1.3.1
9 ноября 2022 г.
androidx.compose.foundation:foundation:1.3.1 and androidx.compose.foundation:foundation-layout:1.3.1 are released. Version 1.3.1 contains these commits.
Исправления ошибок
- Fix performance issue in
BeyondBoundsLayout( aosp/2255266 ) -
ContentInViewModifierwill not read layout coordinates unless attached ( aosp/2241316 )
Версия 1.3.0
24 октября 2022 г.
androidx.compose.foundation:foundation:1.3.0 and androidx.compose.foundation:foundation-layout:1.3.0 are released. Version 1.3.0 contains these commits.
Important changes since 1.2.0
- Experimental versions of
LazyVerticalStaggeredGridandLazyHorizontalStaggeredGridwere introduced. -
SnapFlingBehavior,rememberSnapFlingBehaviorand other corresponding APIs were added as experimental. -
Modifier.clickable,Modifier.toggleable, andModifier.selectablenow show ripples if clicked with the keyboard or d-pad on a remote control.
Version 1.3.0-rc01
5 октября 2022 г.
androidx.compose.foundation:foundation:1.3.0-rc01 and androidx.compose.foundation:foundation-layout:1.3.0-rc01 are released. Version 1.3.0-rc01 contains these commits.
API Changes
- Introduced
lowVelocityAnimationSpecused by the approach step when there's not enough fling velocity to decay. ( Iaeb27 ) - Added new experimental API Hyphens to support automatic hyphenation in Text ( Iaa869 )
Version 1.3.0-beta03
21 сентября 2022 г.
androidx.compose.foundation:foundation:1.3.0-beta03 and androidx.compose.foundation:foundation-layout:1.3.0-beta03 are released. Version 1.3.0-beta03 contains these commits.
API Changes
- Add options to customize line breaking in Text. ( I86907 )
-
BringIntoViewResponders are now able to get the most up-to-date bounds of a request while processing it. ( If86a5 , b/241591211 ) - Introduce support for spacings between items to experimental
Staggered Grid( I10b82 ) - Introduce content padding to experimental
Staggered Grid( I342ea ) - Changed
size:IntSizeargument withconstraints: ConstraintsinTextMeasurer.measuremethod to support minimum width constraints. ( I37530 , b/242707525 ) - Added
Modifier.withConsumedWindowInsets()to get consumedWindowInsetsfor use outsidewindowInsetsPadding. - Added
MutableWindowInsetsto allow easily changingWindowInsetswithout recomposition. ( I7fd28 , b/237019262 , b/243119659 )
Version 1.3.0-beta02
7 сентября 2022 г.
androidx.compose.foundation:foundation:1.3.0-beta02 and androidx.compose.foundation:foundation-layout:1.3.0-beta02 are released. Version 1.3.0-beta02 contains these commits.
API Changes
- Initial version of experimental
StaggeredGrid( Ia48be ) - Renamed
FocusDirection.InandFocusDirection.OuttoFocusDirection.EnterandFocusDirection.Exit( Ia4262 , b/183746982 ) - Introduced a
rememberSnapFlingBehavioroverload that provides a quick way of enabling snapping inLazyLists. ( Ifb48a ) - Replaced the
snapFlingBehaviorfactory with a concreteSnapFlingBehaviorclass. ScopedSnapLayoutInfoProvidermethods to Density to make Dp<->Px conversions easier for the API users. ( I54a11 ) - Update
LazyLayoutMeasureScope.measureto return list of placeables, highlighting desired immutability of the returned value. ( I48b7c ) - Introduced
SnapLayoutInfoProviderwhich takes aLazyListStateto create an instance ofSnapLayoutInfoProviderthat can be used to enable a snapFlingBehaviorforLazyLists. ( I2dd10 )
Исправления ошибок
- Refactors
AwaitPointerEventScope#awaitLongPressOrCancellationto match other await functions ( I646e6 )
Version 1.3.0-beta01
24 августа 2022 г.
androidx.compose.foundation:foundation:1.3.0-beta01 and androidx.compose.foundation:foundation-layout:1.3.0-beta01 are released. Version 1.3.0-beta01 contains these commits.
API Changes
- Removed
pointerPositionfromOverscrollEffect- effects that care about pointer position can useModifier.pointerInput { }in theeffectModifierto get the current pointer position instead. ( I9f606 , b/241239306 ) - Exposed
AwaitPointerEventScope#awaitLongPressOrCancellationas additional building block for more complex gesture detection ( I04374 , b/181577176 ) - Introduced
lazyListSnapLayoutInfoProviderto enable snapping in Lazy Lists. ( I3ecdf ) - Introduced
SnapFlingBehavior, a fling behavior that enables list snapping. Provide an instance ofSnapLayoutInfoProviderwith information about your snapping layout. ( Ie754c )
Version 1.3.0-alpha03
10 августа 2022 г.
androidx.compose.foundation:foundation:1.3.0-alpha03 and androidx.compose.foundation:foundation-layout:1.3.0-alpha03 are released. Version 1.3.0-alpha03 contains these commits.
API Changes
- Resource Fonts now support setting font variation settings (API 26+). ( I900dd , b/143703328 )
- Variable font support in
DeviceFontFamilyNameFont( Ic1279 , b/143703328 ) - Removed experimental annotation from
PlatformTextStyleandLineHeightStyle. ( I64bef ) - Text fields will now throw more detailed exceptions when the
OffsetMappingprovided by aVisualTransformationreturns invalid indices. ( Ie73f9 , b/229378536 ) - Introduce experimental APIs to share item provider logic between Lazy layouts. ( Ic891c )
-
ScrollableDefaults.reverseDirection()is not experimental anymore. ( Iba646 ) - Deprecated
SemanticsModifier.idand moved the semantics id toLayoutInfo.semanticsIdinstead. ( Iac808 , b/203559524 ) -
checkScrollableContainerConstraints()is not experimental anymore. ( I2c290 ) -
Modifier.clipScrollableContainer()is not experimental anymore. ( Ia2b44 ) - Deprecate
TextInputService.show|hideSoftwareKeyboard. Please useSoftwareKeyboardControllerinstead in app code andTextInputSessionin IME-management code. ( I14e4c , b/183448615 )
Version 1.3.0-alpha02
27 июля 2022 г.
androidx.compose.foundation:foundation:1.3.0-alpha02 and androidx.compose.foundation:foundation-layout:1.3.0-alpha02 are released. Version 1.3.0-alpha02 contains these commits.
API Changes
- Added
drawTextextension function onDrawScopeto provide a way to draw multi-styled text on composables and modifiers that operate on aDrawScopelikeCanvasanddrawBehind. ( I16a62 , b/190787898 )
Исправления ошибок
- Soft keyboard will now be hidden when a text field is disabled while focused. ( I6e3e4 , b/237308379 )
- When adding
InputEventChangeevents to Velocity Tracker we will consider now deltas instead of positions, this will guarantee the velocity is correctly calculated for all cases even if the target element moves ( Icea9d , b/216582726 , b/223440806 , b/227709803 ) - When a scrollable has a focused child, it will now correctly scroll to keep the focused child in view when its size is decreased, even when the size is animated. ( I80867 , b/230756508 , b/220119990 )
- Fixed a crash where
TextFieldis cleared and refilled while selection is active. ( I1235b , b/208655565 , b/214253689 )
Version 1.3.0-alpha01
29 июня 2022 г.
androidx.compose.foundation:foundation:1.3.0-alpha01 and androidx.compose.foundation:foundation-layout:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Introduced the
UrlAnnotationannotation type and associated methods to supportTalkBacklink support inAnnotatedStrings. ( I1c754 , b/231495122 )
Исправления ошибок
-
BasicTextFieldcursorBrushmay now be animated without restarting the cursor timer. ( I812e6 , b/236383522 )
Версия 1.2
Версия 1.2.1
10 августа 2022 г.
androidx.compose.foundation:foundation:1.2.1 and androidx.compose.foundation:foundation-layout:1.2.1 are released. Version 1.2.1 contains these commits.
Версия 1.2.0
27 июля 2022 г.
androidx.compose.foundation:foundation:1.2.0 and androidx.compose.foundation:foundation-layout:1.2.0 are released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
-
LazyVerticalGridandLazyHorizontalGridare stable now. - You can now specify a content type for items in Lazy lists and grids. This will allow the components to reuse elements more efficiently.
- Lazy lists and grids now have
userScrollEnabledparam which allows to disable scrolling via the user gestures. - A new experimental API called
LazyLayoutwas added. It It is the API we use internally to power Lazy lists and grids. -
OverscrollEffectAPI has been introduced as experimental. You can define custom overscroll effects as well as adding a standard platform one to custom scrollable containers. - Nested scrolling interoperability APIs have been introduced to allow for interoperability between views and compose scrolling actors.
- Mouse and trackpad scrolling has been added to all scrolling containers.
Version 1.2.0-rc03
29 июня 2022 г.
androidx.compose.foundation:foundation:1.2.0-rc03 and androidx.compose.foundation:foundation-layout:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Version 1.2.0-rc02
22 июня 2022 г.
androidx.compose.foundation:foundation:1.2.0-rc02 and androidx.compose.foundation:foundation-layout:1.2.0-rc02 are released. Version 1.2.0-rc02 contains these commits.
Version 1.2.0-rc01
15 июня 2022 г.
androidx.compose.foundation:foundation:1.2.0-rc01 and androidx.compose.foundation:foundation-layout:1.2.0-rc01 are released. Version 1.2.0-rc01 contains these commits.
API Changes
- An experimental
OverscrollEffecthas been introduced to allow for custom overscroll effects, alongside theModifier.scrollableoverloads that accept it. - Experimental
LocalOverScrollConfigurationhas been moved fromfoundation.gestureto foundation package and renamed toLocalOverscrollConfiguration( If19fb , b/204650733 ) - Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
- Introduced an experimental api
checkScrollableContainerConstraints()which allows to check that we do not nest scrollable containers. You can use it when create your own scrollable lazy layouts viaLazyLayout. ( Id6fab , b/233352497 ) - Removed deprecated
LazyVerticalGridfromandroidx.compose.foundation.lazypackage. The new stable api is located inandroidx.compose.foundation.lazy.grid( I73c76 , b/225192009 )
Version 1.2.0-beta03
1 июня 2022 г.
androidx.compose.foundation:foundation:1.2.0-beta03 and androidx.compose.foundation:foundation-layout:1.2.0-beta03 are released. Version 1.2.0-beta03 contains these commits.
API Changes
- Added new experimental
IntervalListandMutableIntervalList. It allows to represent some list of values via multiple intervals. It will be useful when you want to define your own dsl similar to the one used byLazyColumnwhere list items can be defined via multiple item/items calls. ( I2d05e , b/228580728 )
Исправления ошибок
- Clarified the documentation for
WindowInsets.imeto state thatimeinsets are reported as far back as API 23, but only animated on 30+. ( Ia7fc0 , b/230756508 ) - Pressing the forward delete key when the cursor is at the end of a text field will no longer crash.
-
DeleteSurroundingTextCommandandDeleteSurroundingTextInCodePointsCommandnow require their constructor arguments to be non-negative. ( Ica8e6 , b/199919707 )
Version 1.2.0-beta02
18 мая 2022 г.
androidx.compose.foundation:foundation:1.2.0-beta02 and androidx.compose.foundation:foundation-layout:1.2.0-beta02 are released. Version 1.2.0-beta02 contains these commits.
- Downloadable font resolution that does not change the layout size of Text or
TextFieldpreviously would not redraw, leading to stale font display. This bugfix ensures that text layout always triggers redraw (b/229727404). ( I1d49e , b/229727404 )
Version 1.2.0-beta01
11 мая 2022 г.
androidx.compose.foundation:foundation:1.2.0-beta01 and androidx.compose.foundation:foundation-layout:1.2.0-beta01 are released. Version 1.2.0-beta01 contains these commits.
Новые функции
- This is the first beta release of 1.2!
API Changes
- Added experimental
BeyondBoundsIntervalthat can be used by custom implementations ofLazyListwhen they layout items beyond visible bounds ( Ifabfb , b/184670295 ) -
LineHeightBehavioris renamed asLineHeightStyle -
LineVerticalAlignmentis renamed asLineHeightStyle.Alignment - Renames
LineHeightTrimis renamed asLineHeightStyle.Trim - Default constructor values from
LineHeightStyleis removed ( I582bf , b/181155707 ) - Added default values for the optional members of
LazyLayoutItemProviderinterface. ( Iba8a0 ) - In the
LazyLayoutItemProviderapi instead of a factory returning the composable lambda by index we now have a simpler composable function Item accepting the index. ( Id2196 ) - LazyLayoutItemsProvider is renamed to LazyLayoutItemProvider ( I0638c )
-
LazyLayoutItemsProvider.itemsCountis renamed toitemCount( Id409c ) - Added Brush to
TextStyleandSpanStyleto provide a way to draw text with gradient coloring. ( I53869 , b/187839528 ) -
trimFirstLineTop,trimLastLineBottomattributes ofLineHeightBehaviorchanged into a single enum:LineHeightTrim.LineHeightTrimhave values of 4 states defined by two booleans:FirstLineTop,LastLineBottom, Both and None ( Ifc6a5 , b/181155707 ) Added
LineHeightBehaviorto theTextStyleandParagraphStyle. LineHeightBehaviorcontrols whether line height is applied to the top of the first line and to the bottom of the last line. It also defines the alignment of line in the space provided byTextStyle(lineHeight).For example it is possible to get a behavior similar to what CSS defines via
LineHeightBehavior(alignment = LineVerticalAlignment.Center, trimFirstLineTop=false, trimLastLineBottom = false).trimFirstLineTop,trimLastLineBottomconfigurations works correctly only whenincludeFontPaddingis false. ( I97332 , b/181155707 )Added experimental
imeNestedScroll()modifier so that developers can control the IME through scrolling. ( I60759 )
Исправления ошибок
- Fixed regression where text fields would not hide the keyboard when removed from the composition while focused. ( I7a410 , b/230536793 , b/225541817 )
- Support ellipsis when height is limited and doesn't fit all text lines ( Ie528c , b/168720622 )
-
BringIntoViewRequester.bringIntoViewwill now always suspend until the request is either completed or was interrupted by a newer, non-overlapping request. Overlapping requests will be queued. ( I43e7f , b/216790855 ) - Concurrent
BringIntoViewRequester.bringIntoViewcalls for rectangles that are completely overlapping will now only honor the larger rectangle's request. ( I34be7 , b/216790855 , b/184760918 ) - Turned on default
includeFontPadding. It is possible to turn off theincludeFontPaddingusingTextStyle.platformTextStyleattribute. In the near future we will change the default behavior however until that time this allows us to better integrate line height improvements (aosp/2058653) and solveTextFieldclipping issues. ( I01423 , b/171394808 ) -
Modifier.bringIntoViewRequesterno longer usesonGloballyPositioned. ( I630f5 )
External Contribution
-
MouseInjectionScope.scroll(delta = someDelta)is now inverted on Android if we scroll vertically (if someDelta is positive, it will scroll downward) ( Ifb697 , b/224992993 )
Version 1.2.0-alpha08
20 апреля 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha08 and androidx.compose.foundation:foundation-layout:1.2.0-alpha08 are released. Version 1.2.0-alpha08 contains these commits.
API Changes
- Display all available weights for systems fonts on Android when using
FontFamily.SansSerif. This will use fallback font names like sans-serif-medium internally on API 21-28. This is a behavior change as previously only weights 400 and 700 were supported on API 21-28. ( I380fe , b/156048036 , b/226441992 ) - Paragraph and MultiParagraph are now accepting Constraints parameter. Passing
Constraints.maxHeightis a no-op at the moment but will allow to do some calculation in the future, like ellipsizing based on the height. ( I6afee , b/168720622 ) -
SubcomposeSlotReusePolicy.getSlotsToRetain()now accepts a custom MutableSet-like class which doesn't allow adding new items in it. ( Icd314 ) - Partial consumption (down OR position) has been deprecated in
PointerInputChange. You can useconsume()to consume the change completely. You can useisConsumedto determine whether or not someone else has previously consumed the change. -
PointerInputChange::copy()now always makes a shallow copy. It means that copies ofPointerInputChangewill be consumed once one of the copies is consumed. If you want to create an unboundPointerInputChange, use constructor instead. ( Ie6be4 , b/225669674 ) - New experimental
LazyLayoutAPI is introduced. This allows you to build your own components likeLazyColumnofLazyVerticalGrid. Note that the API is in its early stages and can be changed in the future releases. ( Iba2bc , b/166591700 ) -
AndroidFontnow takestypefaceLoaderas a constructor parameter. ( I2c971 ) -
WindowInsetscompanion now exposes the visibility (whether they are on the screen, regardless of whether they intersect with the window) and the size they could be if they are available on the device, but not currently active. ( I65182 , b/217770337 )
Version 1.2.0-alpha07
6 апреля 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha07 and androidx.compose.foundation:foundation-layout:1.2.0-alpha07 are released. Version 1.2.0-alpha07 contains these commits.
API Changes
- Added a
PinnableParentAPI that allows children of lazy layouts to prevent the currently composed items from being disposed ( Ibbdd0 , b/184670295 ) -
LazyListLayoutInfoandLazyGridLayoutInfonow havebeforeContentPaddingandafterContentPaddingfields ( I3b628 , b/200920410 ) - Added
KeyboardType.Decimalas an alternative toKeyboard.Numberfor specifically including decimal separator in IME. ( Iec4c8 , b/209835363 ) - Add new font descriptor Font(DeviceFontFamilyName) to optionally lookup system-installed fonts during font fallback chains. ( I30468 , b/219754572 )
-
PointerEventType.ScrollandPointerEvent.scrollDeltaare stable APIs now ( I574c5 , b/225669674 ) - Added temporary compatibility configuration for
includeFontPaddinginTextStyle/ParagraphStyle. includeFontPaddingcan be changed viaTextStyle(platformStyle = PlatformTextStyle(includeFontPadding = true/false)). This is a temporary configuration option to enable migration and will be removed. ( If47be , b/171394808 ) - Updated
FontFamily.Resolverto integrate System-wide bold text accessibility setting ( I6c1e7 ) - The
consumeWindowInsetsextension property ofComposeViewallows developers to disable consumption of Android WindowInsets. This allows separateComposeViewsin the hierarchy to each applyWindowInsetswithout interfering with each other. ( I0ef08 , b/220943142 )
Version 1.2.0-alpha06
23 марта 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha06 and androidx.compose.foundation:foundation-layout:1.2.0-alpha06 are released. Version 1.2.0-alpha06 contains these commits.
API Changes
- Added
RequestFocussemantics action to request focus on the focusable target. ( I17b71 ) -
FocusOrderhas now been merged intoFocusPropertiesandfocusProperties()now has all the capabilities offocusOrder().FocusOrderandfocusOrder()have been deprecated.focusOrder()that accepts afocusRequestershould be replaced with afocusRequester()modifier in combination withfocusProperties(). This allows the modifiers to have a stronger separation of concerns. ( I601b7 ) -
WindowInsets.asPaddingValues(Density)was added to allow developers to do the conversion without needing to be in composition. ( I94c35 ) - Updated parsing of vector drawables to support auto mirroring to flip the content of a
VectorPainterif the current layout direction is RTL. ( I79cd9 , b/185760237 )
Исправления ошибок
- Scroll modifiers (
Modifier.verticalScroll(),Modifier.horizontalScroll(), andModifier.scrollable()) will now scroll to keep the focused composable visible if the scroll area is resized and the focused composable was previously visible. - TextFields will now be kept above the keyboard when they are focused and the keyboard is shown, when inside a non-lazy scrollable and the soft input mode is
ADJUST_RESIZE. ( I4a485 , b/190539358 , b/192043120 , b/216842427 )
Version 1.2.0-alpha05
9 марта 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha05 and androidx.compose.foundation:foundation-layout:1.2.0-alpha05 are released. Version 1.2.0-alpha05 contains these commits.
API Changes
-
LazyVerticalGridandLazyHorizontalGridare now stable. ( I307c0 ) -
LazyGridItemInfo.Unknownwas replaced with separateLazyGridItemInfo.UnknownRowandLazyGridItemInfo.UnknownColumn( I56d51 ) -
LazyVerticalGrid/LazyHorizontalGridand all related apis were moved into.gridsubpackage. Please update your imports fromandroidx.compose.foundation.lazytoandroidx.compose.foundation.lazy.grid. ( I2d446 , b/219942574 ) - Text:
includeFontPaddingis now turned off by default. The clipping issues as a result ofincludeFontPadding=falseis handled and no clipping should occur for tall scripts. ( I31c84 , b/171394808 ) - Measured interface now exposes parentData property ( I3313f )
- Introduced experimental
Modifier.onFocusedBoundsChangedto allow observing the bounds of child focusables. ( I14283 , b/220030968 , b/190539358 , b/192043120 , b/216842427 ) - LazyHorizontalGrid was added. ( I61ae7 , b/191238807 )
- Added a new
LazyVerticalGridAPI to define cross axis sizes ( I17723 ) - Added FocusGroup modifier ( I64bc0 , b/213508274 , b/184670295 )
Исправления ошибок
-
WindowInsets.toString()will now show the correct values. ( I1585d )
External Contribution
- Updated to use Kotlinx coroutines 1.6.0 ( I3366d )
Version 1.2.0-alpha04
23 февраля 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha04 and androidx.compose.foundation:foundation-layout:1.2.0-alpha04 are released. Version 1.2.0-alpha04 contains these commits.
API Changes
-
BringIntoViewRespondersare no longer required to manually pass requests up to parent responders, and are instead required to immediately return the rectangle they want their parent to bring into view. ( I8e66a ) - Support async font loading in Text ( I77057 , b/214587005 )
-
LazyVerticalGridnow supportsline breakingbefore items with span not fitting inside the current line. ( I05c40 , b/207462103 ) - Renamed
excludeFromSystemGesturestosystemGesturesExclusion( I19526 ) -
LazyVerticalGridnow supports reverseLayout. ( I6d7d7 , b/215572963 , b/211753558 ) - Add
WindowInsets.only()method to allow developers to include only dimensions from the WindowInsets. ( I14c94 , b/217768486 ) Added
ComposableTarget,ComposableTargetMarkerandComposableOpenTargetthat allows compile time reporting of when a composable function is called targeting an applier it was not designed to use.In most cases the annotations can be inferred by the compose compiler plugin so using these annotation directly should be rare . The cases that cannot be inferred include creating and using a custom applier, abstract composable functions (such as interface methods), fields or global variables that are composable lambdas (local variables and parameters are inferred), or when using
ComposeNodeor a related composable functions.For custom appliers the composable functions that calls
ComposeNodeorReusableComposeNodeneed to add aCompoableTargetannotation for the function and any composable lambda parameter types. It is recommended, however, to create an annotation that is annotated withComposableTargetMarkerand then the marked annotation be used instead ofComposableTargetdirectly. A composable annotation marked withComposableTargetMarkeris equivalent to aComposbleTargetwith the fully qualified name of the attribute class as the applier parameter. For an example of usingComposableTargetMarkerseeanroidx.compose.ui.UiComposable. ( I38f11 )
Исправления ошибок
- Now it is allowed to pass negative scroll offsets into
LazyGridState.scrollToItem()andLazyGridState.animateScrollToItem(). ( I025c6 , b/211753558 ) - Support async font loading for TextField. ( Icc4bf , b/214587005 )
Version 1.2.0-alpha03
9 февраля 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha03 and androidx.compose.foundation:foundation-layout:1.2.0-alpha03 are released. Version 1.2.0-alpha03 contains these commits.
API Changes
-
notifyFocusedRectmethods inTextInputSessionandTextInputServiceare now deprecated and won't be called. UseBringIntoViewRequesterinstead. ( Ia4302 , b/192043120 , b/216842427 , b/178211874 ) - Animations were enabled for items of lazy grids with Modifier.animateItemPlacement(). ( Ib6621 , b/211753218 )
-
BringIntoViewRequesternow propagates requests to the hosting Android View. ( Ia7a51 ) -
FontFamilyResolveris now available viaLocalFontFamilyResolver.current- Added
createFontFamilyResolver(context)andcreateFontFamilyResolver(context, coroutineScope)to create new FontFamily resolvers outside of compose usage. - Paragraph and MultiParagraph now take
FontFamily.Resolver -
TextLayoutResult.layoutInput.fontFamilyResolvernow contains the resolver used for this layout, deprecatedTextLayoutResult.layoutInput.resourceLoaderas it is no longer used. ( Id5a45 , b/174162090 )
- Added
- Added
AndroidFont, a new low-level API for providing new types of font resource descriptors on Android. For example, loading fonts from an app-specific backend, optionally locating pre-installed fonts on-device, or loading a font from a resource not provided by the current Font factories.- Expanded
Font.ResourceLoadedAPI to support optional and async font loading. It is not recommended that application developers use this API directly. To add new types of fonts see AndroidFont. -
Font.AndroidResourceLoaderextension function allows construction of aFont.ResourceLoaderwhen outside of composition. - Added
loadingStrategyparameter to resource-based fonts, to allow async loading when resource font references downloadable fonts XML. ( Ie5aea , b/174162090 )
- Expanded
-
Typeface(FontFamily)constructor is deprecated. This was previously used to preload fonts, which may take up to 10 seconds for downloadable fonts. With downloadable fonts, this call may block for 10 seconds. Instead useFontFamilyResolver.preload-
fontResource(FontFamily): Typefaceis deprecated. This was previously used to preload fonts, which may take up to 10 seconds for downloadable fonts. Instead useFontFamilyResolver.preload( If8e7c , b/174162090 )
-
- You can now specify the content type for the items of
LazyVerticalGrid- item/items functions onLazyGridScopenow accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I7b355 , b/215372836 ) -
LazyListLayoutInfoandLazyGridLayoutInfonow have new properties:viewportSize,orientation,reverseLayout( Ifc8ed , b/200920410 ) - You can now specify the content type for the items of LazyColumn/LazyRow - item/items functions on LazyListScope now accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I26506 )
-
SubcomposeLayoutStateconstructor acceptingmaxSlotsToRetainForReuseis now deprecated. Instead there is a new constructor acceptingSubcomposeSlotReusePolicy- a new interface allowing more granular control on what slots should be retained for the future reuse. ( I52c4d ) - Adds Modifiers for WindowInsets, both for padding and sizing. This allows some content to extend into the inset area, and still have primary content stay out of the inset area. For example, windowInsetsPadding can be used to pad the content area to avoid areas that may be fully or partially covered. ( Id0395 , b/213942085 )
Исправления ошибок
- TextFields will now be kept above the keyboard when they are focused and the keyboard is shown, when the soft input mode is
ADJUST_PAN. ( I8eaeb , b/190539358 , b/192043120 ) - Desktop uses composition local for
FontFamily.Resolver- Desktop
FontLoaderis deprecated - New
createFontFamilyResolverfactory on Desktop ( I6bbbb , b/174162090 )
- Desktop
- The soft keyboard input type no longer flickers when changing focus between text fields. ( I1bf50 , b/187746439 )
- Text fields no longer require an extra back press when the cursor handle is showing. ( Ideb4b , b/205726883 )
- Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )
Version 1.2.0-alpha02
26 января 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha02 and androidx.compose.foundation:foundation-layout:1.2.0-alpha02 are released. Version 1.2.0-alpha02 contains these commits.
API Changes
- Added
NonRestartableComposableto methods that are overloads of existing methods without complex logic. This reduces compiler generated memoization checks (equals) for all parameters which are repeated in the inner function that is called. ( I90490 ) - Added
excludeFromSystemGestureModifiers for easy access to Android'ssetSystemGestureExclusionRects( I46f07 )
Исправления ошибок
- Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )
-
LazyColumn,LazyRow,Modifier.verticalScrolland other containers that useModifier.scrollablenow support mouse wheel scrolling. ( I2b5e1 , b/198214718 )
Version 1.2.0-alpha01
12 января 2022 г.
androidx.compose.foundation:foundation:1.2.0-alpha01 and androidx.compose.foundation:foundation-layout:1.2.0-alpha01 are released. Version 1.2.0-alpha01 contains these commits.
API Changes
- New parameter
userScrollEnabledwas added toLazyColumn,LazyRow, andLazyVerticalGridin order to allow users to temporarily or permanently disable the user initiated scroll via touch gestures or accessibility actions. Scrolling programmatically via the methods on the state will still be allowed. ( I7eae9 , b/201150093 ) - Add
onSizeChangedcallback to magnifier modifier. ( I6879f ) - The magnifier widget now shows when dragging selection handles in a
SelectionContainer. ( I30b38 , b/139320979 )
Исправления ошибок
- Fixes
TextFieldcursor handle not hiding when scrolled out of view. ( I14552 , b/208883748 )
Обновления зависимостей
- Now depends on Kotlin
1.6.10.
Версия 1.1
Версия 1.1.1
23 февраля 2022 г.
androidx.compose.foundation:foundation:1.1.1 and androidx.compose.foundation:foundation-layout:1.1.1 are released. Version 1.1.1 contains these commits.
Исправления ошибок
- Fix
NullPointerExceptionatandroidx.compose.ui.platform.RenderNodeLayer.updateDisplayList( aosp/1947059 , b/206677462 ) - Fix crash caused by clipboard content while reading from clipboard on Android. ( I06020 , b/197769306 )
- Fixed RTL in
LazyVerticalGrid( aosp/1931080 , b/207510535 )
Версия 1.1.0
9 февраля 2022 г.
androidx.compose.foundation:foundation:1.1.0 and androidx.compose.foundation:foundation-layout:1.1.0 are released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
- Stable support for the Android 12 Overscroll effect
- Improvements to touch target sizing
- Note that, with respect to Compose 1.0, Material components will expand their layout space to meet Material accessibility guidelines for touch target size . For instance, Button touch target will expand to a minimum size of 48x48dp, even if you set the Button's size to be smaller. This aligns Compose Material to the same behavior of Material Design Components, providing consistent behavior if you mix Views and Compose. This change also ensures that when you create your UI using Compose Material components, minimum requirements for touch target accessibility will be met.
- Stable support for Navigation Rail
- Graduates a number of previously experimental APIs to stable
- Support for newer versions of Kotlin
Version 1.1.0-rc03
26 января 2022 г.
androidx.compose.foundation:foundation:1.1.0-rc03 and androidx.compose.foundation:foundation-layout:1.1.0-rc03 are released. Version 1.1.0-rc03 contains these commits.
Исправления ошибок
- Updated to support Compose Material 1.1.0-rc03
Version 1.1.0-rc01
15 декабря 2021 г.
androidx.compose.foundation:foundation:1.1.0-rc01 and androidx.compose.foundation:foundation-layout:1.1.0-rc01 are released. Version 1.1.0-rc01 contains these commits.
Исправления ошибок
- Now it is allowed to pass negative scroll offsets into
LazyListState.scrollToItem()andLazyListState.animateScrollToItem(). ( Iceb90 , b/184252837 ) - Fixed a bug that caused missing accessibility scroll actions ( I7cbfb )
Version 1.1.0-beta04
1 декабря 2021 г.
androidx.compose.foundation:foundation:1.1.0-beta04 and androidx.compose.foundation:foundation-layout:1.1.0-beta04 are released. Version 1.1.0-beta04 contains these commits.
Новые функции
- Updated to be compatible with Kotlin
1.6.0
API Changes
- Cleaned up nullability in
androidx.core.view( I7078a , b/204917439 ) - Experimental APIs were added that allow to consume PointerInputchange as a whole or check whether it was consumed or not. ( I2e59d )
- Show a magnifier widget when dragging the cursor or selection handles inside text fields. ( I5391e , b/203781358 )
Исправления ошибок
- Fix text handles not moving when IME visibility changes. ( I25f2e )
Version 1.1.0-beta03
17 ноября 2021 г.
androidx.compose.foundation:foundation:1.1.0-beta03 and androidx.compose.foundation:foundation-layout:1.1.0-beta03 are released. Version 1.1.0-beta03 contains these commits.
API Changes
- Support for horizontal spans was added to LazyVerticalGrid. ( I7e2fa , b/176758183 )
Experimental ability to animate Lazy lists item positions was added. There is a new modifier available within LazyItemScope called
Modifier.animateItemPlacement(). Usage example:var list by remember { mutableStateOf(listOf("A", "B", "C")) } LazyColumn { item { Button(onClick = { list = list.shuffled() }) { Text("Shuffle") } } items(list, key = { it }) { Text("Item $it", Modifier.animateItemPlacement()) } }- When you provide a key via
LazyListScope.itemorLazyListScope.itemsthis modifier will enable item reordering animations. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated. ( I59e7b , b/150812265 )
- When you provide a key via
Version 1.1.0-beta02
3 ноября 2021 г.
androidx.compose.foundation:foundation:1.1.0-beta02 and androidx.compose.foundation:foundation-layout:1.1.0-beta02 are released. Version 1.1.0-beta02 contains these commits.
Исправления ошибок
- Ripples and other indications will now only be delayed if they are inside a
Modifier.scrollable()container, instead of always being delayed for a down event. ( Ibefe0 , b/203141462 ) - Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )
External Contribution
- Added
Modifier.pointerHoverIcon( I95f01 )
Version 1.1.0-beta01
October 27, 2021
androidx.compose.foundation:foundation:1.1.0-beta01 and androidx.compose.foundation:foundation-layout:1.1.0-beta01 are released. Version 1.1.0-beta01 contains these commits.
Исправления ошибок
- Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )
Version 1.1.0-alpha06
13 октября 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha06 and androidx.compose.foundation:foundation-layout:1.1.0-alpha06 are released. Version 1.1.0-alpha06 contains these commits.
API Changes
- A child-less overload for Layout was added, with improved efficiency ( Ib0d9a )
-
SemanticsNodeInteraction.performSemanticsActionnow returns theSemanticsNodeInteractionon which the function was called. ( I9e5db ) - Added
performScrollToNode(matcher: SemanticsMatcher)that scrolls a scrollable container to the content that is matched by the given matcher. ( Ic1cb8 )
Version 1.1.0-alpha05
29 сентября 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha05 and androidx.compose.foundation:foundation-layout:1.1.0-alpha05 are released. Version 1.1.0-alpha05 contains these commits.
API Changes
- Added experimental historical pointers to PointerEventChange. ( Ic1fd8 , b/197553056 , b/199921305 )
Исправления ошибок
- Fixed accessibility support for scrollables (both lazy and non-lazy) with respect to scrolling ( I6cdb0 )
Version 1.1.0-alpha04
15 сентября 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha04 and androidx.compose.foundation:foundation-layout:1.1.0-alpha04 are released. Version 1.1.0-alpha04 contains these commits.
API Changes
- Deprecated
performGestureandGestureScope, which have been replaced byperformTouchInputandTouchInjectionScope. ( Ia5f3f , b/190493367 ) - Added
touchBoundsInRoottoSemanticsNodethat includes the minimum touch target size so that developers can ensure that touch targets meet accessibility minimums. ( I2e14b , b/197751214 )
Исправления ошибок
- Support for stretch overscroll has been added on Android 12 devices. ( Iccf3c , b/171682480 )
Version 1.1.0-alpha03
1 сентября 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha03 and androidx.compose.foundation:foundation-layout:1.1.0-alpha03 are released. Version 1.1.0-alpha03 contains these commits.
Новые функции
- Updated Compose
1.1.0-alpha03to depend on Kotlin1.5.30. ( I74545 )
API Changes
- Glow effect for scroll has been added. New experimental OverScrollConfiguration API has been added to allow for configuration of the overscroll visual effect. Provide null to turn off the overscroll effect. ( I0c304 , b/171682480 )
- AwaitPointerEventScope now has withTimeout() and withTimeoutOrNull() ( I507f0 , b/179239764 , b/182397793 )
- Added test method to get the clipped bounds. ( I6b28e )
- Added minimum touch target size to ViewConfiguration for use in semantics and pointer input to ensure accessibility. ( Ie861c )
Version 1.1.0-alpha02
18 августа 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha02 and androidx.compose.foundation:foundation-layout:1.1.0-alpha02 are released. Version 1.1.0-alpha02 contains these commits.
API Changes
- Added DpSize versions for
Modifier.sizeandrequiredSize( I3fc7e , b/194219828 )
Version 1.1.0-alpha01
4 августа 2021 г.
androidx.compose.foundation:foundation:1.1.0-alpha01 and androidx.compose.foundation:foundation-layout:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits.
API Changes
- Updated
DrawScope#drawImagemethod that consumes source and destination rects to consume an optional FilterQuality parameter. This is useful for pixel art that is intended to be pixelated when scaled up for pixel based art. Updated BitmapPainter + Image composable to also consume an optional FilterQuality parameter ( Ie4fb0 , b/180311607 ) - TextField now clears selection when back button is pressed, which matches Android EditText behavior. ( I3ca16 , b/174173645 )
- Add Cursor Handle. ( I07a82 , b/173016579 )
Исправления ошибок
- Scrolling via semantics actions for lazy lists and regular scrolling components is now animated ( Id9066 , b/190742024 )
External Contribution
-
LazyVerticalGridnow accepts both horizontal and vertical arrangement parameters. ( If9c92 )
Версия 1.0
Версия 1.0.5
3 ноября 2021 г.
androidx.compose.foundation:foundation:1.0.5 and androidx.compose.foundation:foundation-layout:1.0.5 are released. Version 1.0.5 contains these commits.
Исправления ошибок
- Fixed a crash tracking derivedStateOf instances. ( aosp/1792247 )
Версия 1.0.4
13 октября 2021 г.
androidx.compose.foundation:foundation:1.0.4 and androidx.compose.foundation:foundation-layout:1.0.4 are released. Version 1.0.4 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.31
Версия 1.0.3
29 сентября 2021 г.
androidx.compose.foundation:foundation:1.0.3 and androidx.compose.foundation:foundation-layout:1.0.3 are released. Version 1.0.3 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.30
Версия 1.0.2
1 сентября 2021 г.
androidx.compose.foundation:foundation:1.0.2 and androidx.compose.foundation:foundation-layout:1.0.2 are released. Version 1.0.2 contains these commits.
Updated to support the Compose 1.0.2 release. Compose 1.0.2 is still compatible with Kotlin 1.5.21 .
Версия 1.0.1
4 августа 2021 г.
androidx.compose.foundation:foundation:1.0.1 and androidx.compose.foundation:foundation-layout:1.0.1 are released. Version 1.0.1 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.21.
Версия 1.0.0
28 июля 2021 г.
androidx.compose.foundation:foundation:1.0.0 and androidx.compose.foundation:foundation-layout:1.0.0 are released. Version 1.0.0 contains these commits.
Major features of 1.0.0
This is the first stable release of Compose. Please see the official Compose Release blog for more details!
Известные проблемы
If you are using Android Studio Bumblebee Canary 4 or AGP
7.1.0-alpha04/7.1.0-alpha05, you may hit the following crash:java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"To fix, temporarily increase your minSdkVersion to 24+ in your
build.gradlefile. This issue will be fixed in the next version of Android Studio Bumblebee and AGP7.1. ( b/194289155 )
Version 1.0.0-rc02
14 июля 2021 г.
androidx.compose.foundation:foundation:1.0.0-rc02 and androidx.compose.foundation:foundation-layout:1.0.0-rc02 are released. Version 1.0.0-rc02 contains these commits.
- Updated border rendering for generic shapes to address issues with paths defined with fixed dimensions. ( aosp/1748871 , b/191817116 )
Version 1.0.0-rc01
1 июля 2021 г.
androidx.compose.foundation:foundation:1.0.0-rc01 and androidx.compose.foundation:foundation-layout:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.
API Changes
- Canvas now supports a contentDescription parameter for accessibility. ( Ib547c )
Исправления ошибок
- Disabled Button, Card, Checkboxes and overall
Modifier.clickable(enabled=false)will block clicks from going up to the parent. ( Ic2c3b , b/183908811 )
Version 1.0.0-beta09
16 июня 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta09 and androidx.compose.foundation:foundation-layout:1.0.0-beta09 are released. Version 1.0.0-beta09 contains these commits.
API Changes
- Removed
ManualFrameClock. If you need to control animations, usecomposeTestRule.mainClockinstead. ( I3c3e8 , b/189951065 ) - change enum Role and LiveRegionMode to inline classes with private constructor ( Id1890 )
- KeyboardCapitalization is converted into inline class. ( Id5a1c )
- TextOverflow is changed to an inline class. ( I433af )
Исправления ошибок
- Now when you specify the unique keys for LazyColumn/Row items the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one. ( Id263f , b/184257857 )
- Key constants are @ExperimentalComposeUiApi for now. Consuming code can declare private constants prior to stabilization. ( Ia5d48 )
- Added IdlingStrategy to AndroidComposeTestRule that can be used by testing frameworks to install an alternative mechanism to await or achieve quiescence. Use
AndroidComposeTestRule.setIdlingStrategyFactory()before your test starts to install your own strategy. ( I608fa )
Added Profile Rules
This release adds profile rules to the following compose modules ( I14ed6 ):
- androidx.compose.animation
- androidx.compose.animation-core
- androidx.compose.foundation
- androidx.compose.foundation-layout
- androidx.compose.material
- androidx.compose.material-ripple
- androidx.compose.runtime
- androidx.compose.ui
- androidx.compose.ui.geometry
- androidx.compose.ui.graphics
- androidx.compose.ui.text
- androidx.compose.ui.text
- androidx.compose.ui.unit
- androidx.compose.ui.util
What are profile rules?
Profile rules for a library are specified in a text file
baseline-prof.txtlocated in thesrc/mainor equivalent directory. The file specifies a rule per line, where a rule in this case is a pattern for matching to methods or classes in the library. The syntax for these rules is a superset of the human-readable ART profile format that is used when usingadb shell profman --dump-classes-and-methods .... These rules take one of two forms to target either methods or classes.A method rule will have the following pattern:
<FLAGS><CLASS_DESCRIPTOR>-><METHOD_SIGNATURE>And a class rule will have the following pattern:
<CLASS_DESCRIPTOR>Here
<FLAGS>is one or more of the charactersH,S, andPto indicate whether or not this method should be flagged as "Hot", "Startup", or "Post Startup".The
<CLASS_DESCRIPTOR>is the descriptor for the class that the targeted method belongs to. For example, the classandroidx.compose.runtime.SlotTablewould have a descriptor ofLandroidx/compose/runtime/SlotTable;.The
<METHOD_SIGNATURE>is the signature of the method, and includes the name, parameter types, and return types of the method. For example, the methodfun isPlaced(): BooleanonLayoutNodehas the signatureisPlaced()Z.These patterns can have wildcards (
**,*, and?) in order to have a single rule encompass multiple methods or classes.
What do the rules do?
A method that has the flag
Hindicates that this method is a "hot" method, and should be compiled ahead of time.A method that has the flag
Sindicates that it is a method which is called at startup, and should be compiled ahead of time to avoid the cost of compilation and interpreting the method at startup time.A method that has the flag
Pindicates that it is a method which is called after startup.A class that is present in this file indicates that it is used during startup and should be pre-allocated in the heap to avoid the cost of class loading.
Как это работает?
- Libraries can define these rules which will be packaged in AAR artifacts. When an app is then built which includes these artifacts, these rules are merged together and the merged rules are used to build a compact binary ART profile that is specific to the app. ART can then leverage this profile when the app is installed on devices in order to ahead-of-time compile a specific subset of the application to improve the performance of the application, especially the first run. Note that this will have no effect on debuggable applications.
Version 1.0.0-beta08
2 июня 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta08 and androidx.compose.foundation:foundation-layout:1.0.0-beta08 are released. Version 1.0.0-beta08 contains these commits.
API Changes
- NestedScrollSource enum is replaced by an inline class. ( Ie321b , b/187055290 )
- Refactored enum usages to inline classes to avoid issues with exhaustive when statements when new enum values are added. ( I2b5eb )
- Adds a tap timeout to clickable / toggleable to prevent showing a ripple during a scroll / drag ( Ia2704 , b/168524931 )
- ContentDescription and Text semantics properties are no longer single values but lists. This enables to merge them as they are instead of concatenations. Also provided better testing APIs to utilize these changes ( Ica6bf , b/184825850 )
-
Modifier.focusModifier()is deprecated and replaced byModifier.focusTarget()( I6c860 ) - KeyboardType enum is replaced by an inline class. ( I73045 , b/187055290 )
- Replaced
FocusStateenum with aFocusStateinterface ( Iccc1a , b/187055290 ) - ImeAction enum is replaced by an inline class. ( I18be5 , b/187055290 )
-
AnnotatedString.withAnnotationfunctions are now ExperimentalTextApi instead of ExperimentalComposeApi. ( I0cd0a )- TextUnit constructor with TextUnitType is now ExperimentalTextApi instead of ExperimentalComposeApi.
- PaddingValues is now
@Stablerather than@Immutable( I88c50 )
Исправления ошибок
- Fix crashes of long press the blank area in non-empty text. ( I33ab5 , b/187437299 )
- Show Toolbar after SelectAll ( I495d9 , b/185919613 )
- Fix for scrollable containers clipping its children on the cross axis. It was easily reproducible if you have a LazyRow with Card items. now the shadow will not be clipped. ( Icb635 , b/186318448 )
- Fixed an issue where ripples / other indication would sometimes get stuck on a long click when using Modifier.combinedClickable ( I2298c , b/186223077 )
- Now
detectDragGesures,detectVerticalGestures, anddetectHorizontalGestureswill consume the position change automatically, no need to call change.consumePositionChange in the onDrag callbacks ( I42fc4 , b/185096350 , b/187320697 ) -
Modifier.onGloballyPositioned()was changed to report the coordinates of this modifier in the modifier chain, not the layout coordinates after applying all the modifiers. This means that now the ordering of modifiers is affecting what coordinates would be reported. ( Ieb67d , b/177926591 )
Version 1.0.0-beta07
18 мая 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta07 and androidx.compose.foundation:foundation-layout:1.0.0-beta07 are released. Version 1.0.0-beta07 contains these commits.
API Changes
- The next visible item prefetching logic is introduced for LazyColumn/Row ( I8a4bc , b/184940225 )
- Added Clip Selection Handle ( Iff80d , b/183408447 )
Исправления ошибок
- LazyColumn/Row will now keep up to 2 previously visible items active (not disposed) even when they are scrolled out already. This allows the component to reuse the active subcompositions when we will need to compose a new item which improves the scrolling performance. ( Ie5555 )
- Remove paintBackground. ( I38660 )
- Draw Selection Background using DrawScope. ( I73c61 , b/186674472 )
- A beta06 regression affecting Row/Column using spacedBy arrangements to layout weighted children was fixed. ( Ifaf8c , b/187326588 )
Version 1.0.0-beta06
5 мая 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta06 and androidx.compose.foundation:foundation-layout:1.0.0-beta06 are released. Version 1.0.0-beta06 contains these commits.
API Changes
- Solve Conflict with Navigation Gesture ( I1145e )
- Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services ( Id54ef , b/180479017 )
- Added
SemanticsActions.ScrollToIndexto scroll a list with indexed items to the item with a certain index, andSemanticsProperties.IndexForKeyto get the index of an item in a list with keyed items. Both actions are implemented by LazyList.- Added
SemanticsNodeInteraction.performScrollToIndexthat scrolls a list to the given index, andSemanticsNodeInteraction.performScrollToKeythat scrolls a list to the item with the given key. ( I4fe63 , b/178483889 , b/161584524 )
- Added
- AnnotatedString save support to TextFieldValue.Saver. Added addTtsAnnotation and withAnnotation utility functions to AnnotatedString.Builder ( I8cbdc , b/178446304 )
- Default
0.dpparameter values were added toPaddingValues(horizontal, vertical)( I05571 , b/181336792 )
Исправления ошибок
- Row & Column children with
weight(fill = false)are no longer making the parent fill the entire available main axis space. ( Ied94d , b/186012444 , b/184355105 )
Version 1.0.0-beta05
21 апреля 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta05 and androidx.compose.foundation:foundation-layout:1.0.0-beta05 are released. Version 1.0.0-beta05 contains these commits.
API Changes
- FlingBehavior interface is now marked as @Stable. All implementations should comply with the
@Stablecontract. ( I93354 , b/184830577 )
Исправления ошибок
- Fixed
ACTION_SCROLL_FORWARD,ACTION_SCROLL_BACKWARD,accessibilityActionScrollLeft,accessibilityActionScrollUp,accessibilityActionScrollRightandaccessibilityActionScrollDownaccessibility scroll actions. Instead of scrolling to the end of the scrollable, it will now scroll by one screen in the given direction. ( Ieccb0 ) - The AndroidManifest files from ui-test-manifest and ui-tooling-data are now compatible with Android 12 ( I6f9de , b/184718994 )
Version 1.0.0-beta04
7 апреля 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta04 and androidx.compose.foundation:foundation-layout:1.0.0-beta04 are released. Version 1.0.0-beta04 contains these commits.
API Changes
- Rename hideSoftwareKeyboard and showSoftwareKeyboard on SoftwareKeyboardController to
hide()andshow()respectively.- Provide the full CompositionLocal interface for LocalSoftwareKeyboardController, allowing it to be set (especially useful in tests) ( I579a6 )
-
TextOverflow.Visibleis introduced. ( Ic8f89 ) - Public instances of
RowScope,ColumnScope,BoxScope,BoxWithConstraintsScopewere removed. ( I4e83e , b/181869067 )
Исправления ошибок
- Fixed the issue when items of
LazyColumn/LazyRowlocated on the edges were incorrectly positioned after fast fling ( Ie4d13 , b/183877420 ) Prior to this change, local composable functions were skippable based on their parameters. After this change, no local composable functions will skip. This change is done because it is common and expected for local functions to capture parameters from the parent and them skipping is a common source of bugs.
To summarize, consider the example:
@Composable fun Counter(count: Int, onCountChange: (Int) -> Unit) { @Composable fun ShowCount() { Text("Count: $count") } ShowCount() Button(onClick={ onCountChange(count + 1) }) { Text("Increment") } }Prior to this change, the
ShowCountcomposable function would always skip, even after thecountparameter was updated. This is no longer the case. ( I5648a )
Version 1.0.0-beta03
24 марта 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta03 and androidx.compose.foundation:foundation-layout:1.0.0-beta03 are released. Version 1.0.0-beta03 contains these commits.
API Changes
-
DefaultMonotonicFrameClockis deprecated. CallingwithFrameNanosorRecomposer.runRecomposeAndApplyChangeswith noMonotonicFrameClockwill now throwIllegalStateException. ( I4eb0d )
Исправления ошибок
-
FlingBehavior.performFling()is now called even when velocity is 0 ( I0b6e5 , b/181237123 )
Version 1.0.0-beta02
10 марта 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta02 and androidx.compose.foundation:foundation-layout:1.0.0-beta02 are released. Version 1.0.0-beta02 contains these commits.
API Changes
- Multiple small optimizations in LazyColumn measuring logic were added ( Ic6889 )
- Added new
LocalSoftwareKeyboardControllercomposition local API to replace previous SoftwareKeyboardController interface on TextField. ( I5951e , b/168778053 ) - Added new
LocalSoftwareKeyboardControllercomposition local API to replace previous SoftwareKeyboardController interface on TextField. ( I84472 , b/168778053 )
Исправления ошибок
- Enforce restrictions on public usage of experimental APIs ( I6aa29 , b/174531520 )
Version 1.0.0-beta01
24 февраля 2021 г.
androidx.compose.foundation:foundation:1.0.0-beta01 and androidx.compose.foundation:foundation-layout:1.0.0-beta01 are released. Version 1.0.0-beta01 contains these commits.
This is the first release of Compose 1.0.0 Beta.
API Changes
- onStart callback has been added to
detectDragGestures( I67269 , b/179995594 ) - Modifiers for sizing to intrinsics are no longer experimental. ( I15744 )
- Removed dp assertions ( I798d2 )
- Removed SoftwareKeyboardController callback from all text fields to be replaced by a new API shortly. ( Iae869 , b/168778053 )
- MeasureBlocks was renamed to MeasurePolicy which became a fun interface. Layout APIs were updated / simplified to use MeasurePolicy. ( Icab48 , b/167662468 , b/156751158 )
-
InteractionStatehas been replaced with[Mutable]InteractionSource- Interfaces are responsible for emitting / collecting Interaction events.
- Instead of passing
interactionState = remember { InteractionState() }to components such asButtonandModifier.clickable(), useinteractionSource = remember { MutableInteractionSource() }. - Instead of:
Interaction.Pressed in interactionStateyou should instead use the extension functions on InteractionSource, such as InteractionSource.collectIsPressedAsState(). - For complex use cases you can use InteractionSource.interactions to observe the stream of Interactions. See the InteractionSource documentation and samples for more information.
- ( I85965 , b/152525426 , b/171913923 , b/171710801 , b/174852378 )
- Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
- Created new TextInputSession for input sessions from low level text components such as CoreTextField. ( I8817f , b/177662148 )
- Placeable now exposes measuredSize, representing the size which the child layout actually measured to. This size might not respect the measurement constraints. ( Ib2729 , b/172560206 , b/172338608 )
- Add selectionGroup modifier that allows to mark collection of Tabs or RadioButtons for accessibility purposes ( Ie5c29 )
Add LazyListState.animateScrollToItem
This method smooth scrolls to a specific item in the list. ( I4bfd7 )
ScrollableState.smoothScrollBy() was renamed to animateScrollBy() LazyListState.snapToItemIndex() was renamed to scrollToItem() ScrollState.smoothScrollTo() was renamed to animateScrollTo() ( I35ded )
Modifier.zoomable has been replaced my Modifier.transformable. smoothPanBy, smoothRotationBy have been added as a functionality. ( Ifc32b , b/175294473 )
The
defaultFactoryforcompositionLocalOfandstaticCompositionLocalOfis now required instead of optional.This changes removes a potential type error for non-nullable types where no default factory was provided. Previously this would provide a null reference for a non-nullable type.
For nullable types consider supplying
{ null }as the default factory.We do not recommend using locals with non-nullable types unless a sensible default can be provided. If no sensible default exists, the
defaultFactorylambda should throw an exception. However throwing an exception means that consumers of the local will have an implicit dependency on it being provided that is not enforced by the type system. ( Ifbd2a )Changed
Indication#createIndication()toIndication#rememberUpdatedIndication(InteractionState)and removesInteractionStateparameter from IndicationInstance#drawIndication(). IndicationInstance should only be responsible for drawing visual effects, and not launching animations / writing state in response to InteractionState changes. These animations and state writes should happen withinrememberUpdatedIndication()instead. Theindicationparameter inModifier.indicationwas also changed to be a required parameter. ( Ic1764 , b/152525426 )Text actions now check focus automatically ( I13777 , b/179648629 )
Removed
runBlockingWithManualClock( I15cdc , b/179664814 )Scroll position in Modifier.verticalScroll()/horizontalScroll() is represented with Ints now ( I81298 )
smoothScrollBy and scrollBy methods' packages changed to
androidx.compose.foundation.gestures.*( I3f7c1 , b/175294473 )FlingConfig has been renamed to FlingBehavior now allows for customization of suspend animation rather than predefined Decays. ( I02b86 , b/175294473 )
Size modifiers were renamed. Modifier.width/height/size were renamed to requiredWidth/requiredHeight/requiredSize. Modifier.preferredWidth/preferredHeight/preferredSize were renamed to width/height/size. ( I5b414 )
defaultMinSizeConstraints was renamed to defaultMinSize. ( I4eaae )
Modifier.tapGestureFilter has been removed. Use
Modifier.pointerInput { detectTapGestures(...) }instead. ( I266ed , b/175294473 )partial consumption was removed from pointer input system. The recommended way of coordinating partial consumtion is Modifier.nestedScroll. ( Ie9c9b )
Orientation has been moved to foundation package. VelocirtTracker moved from ui.gesture to ui.input.pointer. ( Iff4a8 , b/175294473 )
AnimationClockObservable and subclasses have been removed. AnimatedFloat has been removed. ( Icde52 , b/177457083 )
drawerState.open() and drawerState.close() are now suspending functions. Use rememberCoroutineScope() to get the scope of the composition to call them ( I16f60 , b/175294473 )
Providers has been renamed to CompositionLocalProvider
- The Composition constructor no longer accepts a key parameter, and has been deprecated.
- currentCompositeKeyHash has been turned into a composable top level property instead of a composable top level function.
- CompositionData and CompositionGroup have been moved to the androidx.compose.runtime.tooling namespace
- ComposableLambda has been made an interface instead of a concrete class, and no longer has type parameters.
- ComposableLambdaN has been made an interface instead of a concrete class, and no longer has type parameters.
- The snapshotFlow function has been moved to the androidx.compose.runtime namespace
- the merge method of SnapshotMutationPolicy is no longer experimental
- The
@TestOnlytop level clearRoots function has been removed. It is no longer necessary. - keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
- Composer.collectKeySourceInformation has been removed. It is no longer necessary.
- isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
- Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
- ( I99b7d , b/177245490 )
Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )
Modifier.draggable now accepts DraggableState instead of a simple lambda. you can create state via
rememberDraggableState { delta -> }to get the same behaviour as before ( Ica70f , b/175294473 )requiredWidth(IntrinsicSize) and requiredHeight(IntrinsicSize) modifiers were added for required sizing to intrinsic sizes. ( I0a6b4 )
Deprecated
emptyContent()is removed. Use{}instead. ( Idb33f , b/179432510 )Deleted some previously deprecated APIs ( Ice5da , b/178633932 )
Исправления ошибок
- Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I658b6 , b/168778053 )
Version 1.0.0-alpha12
10 февраля 2021 г.
androidx.compose.foundation:foundation:1.0.0-alpha12 and androidx.compose.foundation:foundation-layout:1.0.0-alpha12 are released. Version 1.0.0-alpha12 contains these commits.
API Changes
- Modifier.pointerInput now requires remember keys to indicate when the pointer input detection coroutine should restart for new dependencies. ( I849cd )
- Testing update: hasText() will check for both input and label/hint/placeholder texts in the text field ( Iab803 )
- PaddingValues.Absolute was added and can be used in APIs accepting PaddingValues. ( Ia5f30 )
- onImeActionPerformed is deprecated. use KeyboardActions instead ( If0bbd , b/179071523 )
- In order to better match naming conventions with ImageBitmap and ImageVector, ImagePainter has been renamed to BitmapPainter to parallel VectorPainter. ( Iba381 , b/174565889 )
- Better substring test APIs with substring now as an argument ( Icbe78 )
- Introduced an
InfiniteAnimationPolicycoroutine context element that will be applied in infinite animations. By default no policy is installed, except when running tests withComposeTestRule. ( I50ec4 , b/151940543 ) - Animatable.snapTo and Animatable.stop are now suspend functions ( If4288 )
- ComponentActivity.setContent has moved to androidx.activity.compose.setContent in the androidx.activity:activity-compose module. ( Icf416 )
- Destructuring and copy() methods have been removed from several classes where they were rarely used. ( I26702 , b/178659281 )
Custom keys support for LazyColumn/LazyRow was added. This allows us to smarter handle items reordering. So the state you stored in remember {} blocks will move together with the item when you reorder elements or removed the item from the middle.
LazyColumn { items(users, key = { user -> user.id }) { ... } }- ( Ia50ef , b/164901852 )
Changed Indication#createInstance to be @Composable, and changed LocalIndication to contain an Indication, not () -> Indication. ( I5eeea , b/157150564 )
Constraints.enforcewas replaced withConstraints.constrain. ( I8b8ea )loadFontResource is deprecated. Use fontResource instead. imageResource, loadImageResource, vectorResource, and loadVectorResource are deprecated. Use painterResource instead. ( I6b809 )
For performance reasons, ScrollAxisRange semantics now takes lambdas returning Floats instead of direct Float values. ( If4a35 , b/178657186 )
Added EditableText semantics to mark editable input text of the text field for accessibility and corresponding test methods to check the semantics ( I8e07a )
Modifier.clickable now doesn't have double and long click support. Use Modifier.combinedClickable to achieve this functionality. ( Iafad1 )
toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )
IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )
Modifier.dragGestureFilter has been deprecated. Use
Modifier.pointerInput { detectDragGestures (...)}instead. Alternatively, use Modifier.draggable for one axis drags ( I0ba93 , b/175294473 )Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )
Selection was moved to foundation. ( I7892b )
Similarly to how we previously removed
state { 0 }composable and now promote usage likeremember { mutableStateOf(0) }we are going to removesavedInstanceState { 0 }composable. You should userememberSaveable { mutableStateOf(0) }instead and it will save and restore automatically if the type used inside the MutableState can be stored in the Bundle. If previously you were passing a custom saver object now you need to use a new overload of rememberSaveable which has thestateSaverparameter. The usage will look like this:val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) }( Ib4c26 , b/177338004 )Added password semantics for accessibility ( I231ce )
Added ProgressBarRangeInfo.Indeterminate to mark indeterminate progress bars for accessibility ( I6fe05 )
Playtime in animation is now unfiied to nanoseconds ( If776a )
@ComposableContract has been deprecated in favor of three more specific annotations.
@ComposableContract(restartable = false)has become@NonRestartableComposable@ComposableContract(readonly = true)has become@ReadOnlyComposable@ComposableContract(preventCapture = true)has become@DisallowComposableCalls@ComposableContract(tracked = true)has been removed. ( I60a9d )emptyContent()and(@Composable () -> Unit).orEmpty()utilities have been deprecated as they no longer have any positive performance impact or value ( I0484d )Recomposers can now be closed. Closed recomposers will continue recomposition until composition child coroutines complete. Recomposer.shutDown renamed to cancel to contrast with close. ( Ib6d76 )
APIs related to LazyVerticalGrid are marked as experimental ( Ia53e3 , b/178519862 )
rememberSavedInstanceState() was renamed to rememberSaveable() and moved to androidx.compose.runtime.saveable package. ( I1366e , b/177338004 )
RestorableStateHolder was renamed to SaveableStateHolder and moved to androidx.compose.runtime.saveable package. Inner method RestorableStateProvider was renamed to SaveableStateProvider. Generic type was removed so you can just pass Any as a key. Experimental annotation is not needed anymore. ( I0902e , b/174598702 )
Saver, listSaver(), mapSaver(), autoSaver was moved from androidx.compose.runtime.savedinstancestate to androidx.compose.runtime.saveable ( I77fe6 )
Artefact androidx:compose:runtime:runtime-saved-instance-state was renamed to androidx:compose:runtime:runtime-saveable ( I6dcac )
Many longstanding deprecated APIs in the ui package are deleted. ( I2f2dc )
The compose:runtime-dispatch artifact is now deprecated. MonotonicFrameClock can now be found in compose:runtime and AndroidUiDispatcher can be found in compose:ui. ( Ib5c36 )
Parameters on RounderCornerShape, CutCornerShape and CornerBasedShape were renamed from left/right to start/end in order to support the shape's auto mirroring in the rtl direction. AbsoluteRounderCornerShape and AbsoluteCutCornerShape were introduced for the cases when auto-mirroring is not desired. ( I61040 , b/152756983 )
canDrag has been removed from the Modifier.scrollable. ( Id66e7 , b/175294473 )
The API the Compose compiler plugin targets has been refactored to use an interface instead of a concrete class. The interface also no longer uses a type parameter.
This is an internal change that should not effect source code compatibility but is a binary breaking change. ( I3b922 , b/169406779 )
Modifier.scaleGestureFilter has been removed. Use Modifier.zoomable instead. Alternatively, use
Modifier.pointerInput { detectMultitouchGestures { ... }}( Id5da1 , b/175294473 )AnimatedValue/Float is now deprecated. Please use Animatable instead. ( I71345 , b/177457083 )
- Removed CoreText and CoreTextField from public API
- Removed deprecated SelectionContainer overload ( I99c19 )
Remove deprecated non-suspend scrolling functions Continuing with the changes from last release, the non-suspend scrolling functions are now removed entirely. Please convert to the suspend functions with the same names. A coroutine scope can be obtained via rememberCoroutineScope(). ( I3d39c , b/178169563 )
androidx.compose.foundation.layout.ConstraintLayout was deprecated in favor of androidx.constraintlayout.compose.ConstraintLayout. You will need to add a dependency on
androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha01. ( I87adc )tapGestureFilter, doubleTapGestureFilter, longPressGestureFilter and pressIndicaitonGestureFilter have been deprecated. Use Modifier.clickable or Modifier.pointerInput with detectTapGestures function instead. ( I6baf9 , b/175294473 )
Removed
Recomposer.current(). [Abstract]ComposeView now default to lazily created, window-scoped Recomposers driven by the ViewTreeLifecycleOwner for the window. Recomposition and withFrameNanos-based animation ticks are paused while the host Lifecycle is stopped. ( I38e11 )Recomposer.runningRecomposers now offers a global StateFlow of read-only RecomposerInfo for observing ongoing composition state in the process. Prefer this API to Recomposer.current(), which is now deprecated. ( If8ebe )
Version 1.0.0-alpha11
28 января 2021 г.
androidx.compose.foundation:foundation:1.0.0-alpha11 and androidx.compose.foundation:foundation-layout:1.0.0-alpha11 are released. Version 1.0.0-alpha11 contains these commits.
API Changes
Deprecate non-suspend scrollBy, remove non-suspend scrollTo
We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating and/or removing the non-suspend versions of these functions as part of this transition. ( Ie9ced )
Deprecate non-suspend smoothScrollBy We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating the non-suspend versions of these functions as part of this transition. ( I12880 )
Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )
BasicTextField received a new parameter called 'decorationBox'. It allows to add the decorations like icons, placeholder, label and similar to the text field and increase the hit target area of it. ( I16996 )
canDrag parameter has been removed from the Modifier.draggable ( Ic4bec , b/175294473 )
AnimatedFloat.fling that accepts FlingConfig has been removed. Please use suspend Animatable.animateDecay instead. ( I4659b , b/177457083 )
Removed
data classfrom the following classes:- InlineTextContent
- LocaleList
- ( I605c7 )
clickable, toggleable and selectable can be created outside of composition now ( I0a130 , b/172938345 , b/175294473 )
ScrollableColumn/Row were deprecated. Using ScrollableColumn is less efficient comparing to LazyColumn when you have a large scrolling content because with LazyColumn we can only compose/measure/draw visible elements. To prevent users from going inefficient way we decided to deprecate ScrollableColumn and ScrollableRow and promote usages of LazyColumn and LazyRow instead. Users can still decide they don't need the lazy behaviour and use the modifiers directly like this: Column(Modifier.verticalScroll(rememberScrollState())) ( Ib976b , b/170468083 )
New
items(count: Int)factory method for scope of LazyColumn/LazyRow/LazyVerticalGrid.items(items: List)anditemsIndexed(items: List)are now extension functions so you have to manually import them when used. New extension overloads for Arrays: items(items: Array) and itemsIndexed(Array) ( I803fc , b/175562574 )The deprecated AbsoluteArrangement was removed. ( Iffa96 , b/177641870 )
The propagateMinConstraints parameter was added to Box, for specifying whether the incoming min constraints should be passed to the content of the Box or not. Default is false. ( I0125b , b/152613457 )
Исправления ошибок
- onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
- WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
Changes to factory functions for Font/FontFamily/Typeface
- Added factory functions that start with capital letter
- Deprecated previous factory functions with lowercase first letters
- New factory functions return the FontFamily instead of subclasses
- Hid constructors of the subclasses, so that they can only be constructed via factory functions.
- Renamed Font.asFontFamily to Font.toFontFamily
- ( I42aa7 )
Introduced
ComposeContentTestRule, which extendsComposeTestRuleand definessetContent, which has been removed fromComposeTestRule. Added a factory methodcreateEmptyComposeRule()that returns aComposeTestRuleand does not launch an Activity for you. Use this when you want to launch your Activity during your test, eg usingActivityScenario.launch( I9d782 , b/174472899 )animateAsState is now animateFooAsState, where Foo is the type of the variable being animated. eg Float, Dp, Offset, etc ( Ie7e25 )
Density is now receiver scope for Arrangement interfaces. ( I18aad )
TextFieldValue accepts AnnotatedString. However this is an API only change and multi-style text editing is not implemented yet.
- Removed
initialfrom EditingBuffer constructor parameters. ( I326d5 )
- Removed
invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )
AnnotatedString is changed to extend from kotlin.CharSequence. Therefore length and subSequence are now instance functions, and extension functions are removed. ( Iaf429 )
Duration and Uptime will be replace with Long milliseconds, and this step removes the dependency of pointer input on those classes. ( Ia33b2 , b/175142755 , b/177420019 )
RememberObserver replaces CompositionLifecycleObserver and CompositionLifecycleObserver is now deprecated.
RememberObserveris a replacement forCompositionLifecycleObserverwith modified semantics and renamed methods. Changing to the new API can be done mechanically for objects that are only remembered once which is, and continues to be, the recommended practice. However, if a reference was remembered more than once in a compositiononRememberedis called for each reference whereonEnteris only called once.onEnterwas called multiple time if the object was used in subcompositions, such asWithConstraintsandScaffoldmaking the singleonEntercall guarantee unreliable and it was removed forRememberObserver.RememberObserveraddsonAbandonedwhich is called if theRememberObserverinstance is returned from the callback passed torememberbut was not remembered in the composition state and, therefore, will never haveonRememberedcalled. This can occur if an exception terminates composition before completing or the composition is discarded because the state is was producing a composition for is no longer current or otherwise is no longer needed. If the instance ofRememberObserverfollowing the single reference recommendation above is tracking an external resource bothonForgottenandonAbandonedeach indicate that the resource is no longer needed. If the object is tracking work started or resources allocated inonRemembered,onAbandonedcan be ignored as it will not be called ifonRememberedis called. ( I02c36 )Renamed TransformedText.transformedText to TransformedText.text
- TransformedText is no longer a data class ( Ie672a )
The following classes are not data classes anymore:
- AnnotatedString
- Стиль абзаца
- SpanStyle
- TextStyle
- FontWeight
- ТекстДекорация
- TextGeometricTransform
- TextIndex
- TextLayoutResult
- TextLayoutInput ( Iaff99 )
Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )
Deprecated global coordinates methods and made new window-based coordinates methods. ( Iee284 )
Please use ImeAction.None instead of ImeAction.NoAction
- Please use ImeAction.Default instead of ImeAction.Unspecified ( Ie1bcc )
FocusRequester.createRefs is now marked as experimental as it might change. ( I2d898 , b/177000821 )
SemanticsPropertyReceiver.hidden was renamed to invisibleToUser and marked @ExperimentalComposeUiApi. AccessibilityRangeInfo was renamed to ProgressBarRangeInfo. stateDescriptionRange was renamed to progressBarRangeInfo. AccessibilityScrollState was renamed to ScrollAxisRange. horizontalAccessibilityScrollState was renamed to horizontalScrollAxisRange. verticalAccessibilityScrollState was renamed to verticalScrollAxisRange. ( Id3148 )
Changed VisualTransformation to be a functional interface ( I3bba4 )
Leverage TestCoroutineDispatcher in testing ( I532b6 )
Removed PointerInputData and modified PointerInputChange to give it all of PointerInputData's fields. Made PointerInputEvent and PointerInputEventData internal because they aren't used in any public API. ( Ifff97 , b/175142755 )
Renamed TextInputService.onStateUpdated as updateState ( Id4853 )
Remove displaySize as it should be avoided. Typically it is better to use size of onRoot() or window size at least. ( I62db4 )
Version 1.0.0-alpha10
13 января 2021 г.
androidx.compose.foundation:foundation:1.0.0-alpha10 and androidx.compose.foundation:foundation-layout:1.0.0-alpha10 are released. Version 1.0.0-alpha10 contains these commits.
API Changes
- ImeOptions and KeyboardOptions are no more a data class ( I3c898 , b/168684531 )
- VisualTransformation API Changes
- Renamed OffsetMap to OffsetMapping
- Renamed OffsetMapping.identityOffsetMap to OffsetMapping.Identity
- PasswordTransformation is no longer data-class
- Moved OffsetMapping to its own file
- ( I0bdf3 )
- EditOperations API Changes
- Renamed EditOperation as EditCommand
- Added Command suffix for EditOperation concrete implementations
- EditCommand's are no longer data classes
- Renamed EditOperation.process function to applyTo
- Renamed InputEventListener to InputEventCallback
- ( I0a366 )
- Modified Velocity to have component parts and mathematical operations. ( Ib0447 )
- Renamed @ExperimentalTesting to @ExperimentalTestApi to be consistent with similar experimental api annotations ( Ia4502 , b/171464963 )
- Added experimental stickyHeader method for LazyColumn/LazyRow ( I0a81d )
- Ranamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
- Deprecated TestUiDispatcher. Use Dispatchers.Main instead ( Ic171f , b/175385255 )
- Add Toggle to foundation Strings.kt ( I4a5b7 , b/172366489 )
- Moved nativeClass to ui module and made it internal. Updated usages of nativeClass in equals implementations to use 'is MyClass' instead. ( I4f734 )
- FlowRow and FlowColumn were deprecated. Please use a custom layout instead. ( I09027 )
- Modifier.focus() and Modifier.focusRequester() are deprecated. Use Modifier.focusModifier() and Modifier.focusReference() instead. ( I75a48 , b/175160751 , b/175160532 , b/175077829 )
- Introduced SelectionRegistrar.notifySelectableChange to notify Selectable updates to SelectionManager. ( I6ff30 , b/173215242 )
- Changed
fun Dp.isFinite()to aval Dp.isFinite( I50e00 ) - Constraints#satisfiedBy was renamed to isSatisfiedBy. ( I9cf5c )
- Added isSpecified, isUnspecified, and useOrElse for inline classes with an Unspecified constant. ( I93f7b , b/174310811 )
Исправления ошибок
- New coroutine-based API
Animatablethat ensures mutual exclusiveness among its animations. New DecayAnimationSpec to support multi-dimensional decay animation ( I820f2 , b/168014930 ) - Added support for disabled and read-only text fields ( I35279 , b/171040474 , b/166478534 )
-
animate()is now replaced withanimateAsState(), which returns aState<T>instead ofT. This allows better performance, as the invalidation scope can be narrowed down to where the State value is read. ( Ib179e ) - Add Semantics role API and add Role as a parameter to clickable, selectable and toggleable SemanticsModifier. Changed Modifier.progressSemantics so that Slider can also use it. ( I216cd )
- The native keyEvent can now be accessed through keyEvent.nativeKeyEvent ( I87c57 , b/173086397 )
Version 1.0.0-alpha09
16 декабря 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha09 and androidx.compose.foundation:foundation-layout:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.
API Changes
Add Scrollable interface
This allows ScrollState and LazyListState to be treated as a common type, allowing custom scrolling to be implemented across both types.
This also moves smoothScrollBy to an extension function on Scrollable, taking advantage of this functionality. ( I2153b )
LazyVerticalGrid is added. ( I17267 , b/162213211 )
Deprecate LazyColumnFor, LazyRowFor, LazyColumnForIndexed and LazyRowForIndexed. Use LazyColumn and LazyRow instead ( I5b48c )
For suspending pointer input APIs, renamed HandlePointerInputScope to AwaitPointerEventScope and handlePointerInput() to awaitPointerEventScope(). ( Idf0a1 , b/175142755 )
LazyListState.layoutInfo was added which exposes the list of sizes and offsets of the currently visible items ( If8678 , b/170472532 )
Removed ExperimentalPointerInput annotation ( Ia7a24 )
InteractionState support for TextFields has been added. ( I61d91 )
Add reverseLayout param for LazyColumn/Row. when
trueitems will be composed from the bottom to the top andLazyListState.firstVisibleItemIndex == 0will mean the first item is located at the bottom. ( I552ae , b/166589935 )verticalArrangement param was added for LazyColumn. horizontalArrangement param was added for LazyRow. Arrangement allows us to add a spacing between items and specify the arrangement of the items when we do not have enough of them to fill the whole minimum size. ( Icf79a , b/170394300 )
detectMultitouchGestures now uses one callback with combined centroid, pan, zoom and rotate parameters. ( Ie6e1c )
Moved ContentDrawScope to ui-graphics module to be with DrawScope. ( Iee043 , b/173832789 )
Исправления ошибок
- Lambdas in offset modifiers now return IntOffset rather than Float. ( Ic9ee5 , b/174137212 , b/174146755 )
Removed SlotTable, SlotReader and SlotWriter from the public API. These were marked as InternalComposeAPI previously. Now they are internal to the compose module.
CompositionData and CompositionGroup were added as a replacement for the ui-tooling API to use to extract composition information. These are public but are not intended for use outside the ui-tooling API as they provide the raw information the ui-tooling API interprets ( I31a9c )
Refactored ShaderBrush to lazily create a shader instance when sizing information of the drawing environment is available. This is useful to define gradients that occupy the full drawing bounds of a composable at composition time, without having to implement custom DrawModifier implementations.
Deprecated gradient function constructor APIs in favor of factory methods on a Gradient object. ( I511fc , b/173066799 )
Modifier.focusObserver is deprecated. Use Modifier.onFocusChanged or Modifier.onFocusEvent instead ( I30f17 , b/168511863 , b/168511484 )
Autofill API is now experimental API and requires opt-in ( I0a1ec )
Adding destructuring declarations to create FocusRequester instances ( I35d84 , b/174817008 )
accessibilityLabel has been renamed to contentDescription. accessibilityValue has been renamed to stateDescription. ( I250f2 )
Introduced several new functions in SelectionRegistrar and also renamed onPositionChange to notifyPositionChange. ( Ifbaf7 )
AndroidOwner made internal ( Ibcad0 , b/170296980 )
New infiniteRepeatable function for creating an InfiniteRepeatableSpec ( I668e5 )
The
Applierinterface has changed to simplify building trees bottom-up instead of top-down.The
insert()method has been renamed toinsertTopDown().A new method,
insertBottomUp(), was added.An applier either inserts nodes into the tree it is editing using
insertTopDown()orinsertBottomUp()depending on which performs better.Some trees, such as
LayoutNodeandView, are much more efficient to build bottom-up than top-down. Prior to this change, a stack of inserts was required to implement bottom-up which needed to be copied to every applier which needed bottom-up construction for performance. With this change anApplieroverridesinsertBottomUp()to build a tree bottom-up andinsertTopDown()to build the tree top-down. ( Icbdc2 )Added painterResource API to handle opaquely loading Painter objects from either rasterized asset formats (like PNGs) or VectorDrawables. Consumers no longer have to determine the type of asset in advance and can call this method to get a Painter object to use in Image composables or painter modifiers. ( I2c703 , b/173818471 )
Added buildAnnotatedString factory function in order to build an AnnotatedString. Deprecated annotatedString builder function. ( Idfe0b )
Version 1.0.0-alpha08
2 декабря 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha08 and androidx.compose.foundation:foundation-layout:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.
API Changes
- Removed
maxLinesparameter from theCoreTextField. If you'd like to constraint the height of the text field by the number of lines, useBasicTextFieldinstead. ( Iec002 ) - Changed the
await*TouchSlop()methods to not detect the pointer down and renamed them to*OrCancellation. Also removed the need fororientationLockparameter. ( Ie96e1 ) - Added lint check for composable lambda parameter naming and position, to check for consistency with Compose guidelines. Also migrated some APIs using
childrenas the name for their trailing lambda tocontent, according to the lint check and guidance. ( Iec48e ) -
foundation:foundation-textapis moved tofoundation:foundation. The package structure remained the same ( Id3eb2 ) - New multitouch gesture detector, including helpers for detecting rotation, zoom, and panning. ( Ic459d )
- New drag gesture detector suspending pointer input API, including orientation locking. ( Icef25 )
- Renamed VectorAsset to ImageVector Moved and renamed VectorAsset to Builder to be an inner class of ImageVector as per API council guidelines. Added typealias of VectorAssetBuilder to link to ImageVector.Builder for compat. ( Icfdc8 )
- Renamed ImageAsset and related methods to ImageBitmap. ( Ia2d99 )
- Moved foundation semantics properties to ui ( I6f05c )
Add coroutine-based scrolling APIs:
Adds LazyListState.snapToItem and LazyListState.smoothScrollBy, as well as lower-level APIs for scroll control. These APIs provide a suspend interface to control scrolling that waits until the scroll is finished before returning. ( Ie5642 )
Added a singeLine parameter into BasicTextField, TextField and OutlinedTextField. Set this parameter to true to make the text field a single horizontally scrollable line. ( I57004 , b/168187755 )
Gesture detector for tap, double-tap, long press, and press indication were added using the new suspending pointer input. A few utilities were added as well, making it easier for developers to write their own gesture detectors. ( I00807 )
Modifier.focusable has need added in foundation. Use this to add focusable behavior to a component, with correct semantics and accessibility. ( I41eb9 , b/152525426 , b/162865824 )
Previously deprecated APIs have been removed: Border was removed, use BorderStroke instead. Modifier.drawBorder was removed, use Modifier.border instead. Modifier.gravity was removed, use Modifier.align instead. Stack was removed, use Box instead ( I32c2b , b/172470874 )
AbsoluteArrangement was renamed to Arrangement.Absolute. ( If26f2 )
Исправления ошибок
- Moved DrawModifier APIs from the androidx.compose.ui package to the androidx.compose.ui.draw package. Created DrawModifierDeprecated.kt file to include typealiases/helper methods to assist with the migration from the deprecated to the current APIs. ( Id6044 , b/173834241 )
- Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API council feedback. ( I0bd29 , b/173834241 )
-
<T>was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 ) - Made PointerInputData's uptime and position fields non-nullable. ( Id468a )
- MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection. ( I1e6f4 , b/139320372 , b/139320907 )
- The alignment parameter of Box was renamed to contentAlignment. ( I2c957 )
- offsetPx modifiers were renamed to offset. They are now taking lambda parameters instead of State. ( Ic3021 , b/173594846 )
- Added WindowManager.isWindowFocused to check if the host window is in focus, and a WindowFocusObserver that provides an onWindowFocusChanged callback. ( I53b2a , b/170932874 )
- Added resetInput parameter to TextInputService#onStateUpdated ( I3e8f5 , b/172239032 , b/171860947 )
- Updated TextFieldValue API
- made TextFieldValue.composition readonly
- removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
- Deprecated Ambients named with
Ambientas their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 ) - Added Android Typeface wrapper. You can load an Android Typeface via
typefacefunction ietypeface(Typeface.DEFAULT). Also renamedtypefaceFromFontFamily()totypeface()( I52ab7 ) - Added lint check to check that Modifier factories use
androidx.compose.ui.composed {}internally, instead of being marked as@Composable. ( I3c4bc ) - Added lint check to check that Modifier factory functions are defined as extensions on Modifier, so they can be fluently chained together. ( I07981 )
- Semantics argument mergeAllDescendants was renamed to mergeDescendants. ( Ib6250 )
- Time control in tests (TestAnimationClock and its usages) is now experimental ( I6ef86 , b/171378521 )
- Remove old ui-test module and its stubs ( I3a7cb )
- TextUnit.Inherit is renamed to TextUnit.Unspecified in consistent with other units. ( Ifce19 )
- The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
-
foundation:foundation-textmodule has been merged intofoundation:foundation( Idac0f ) - Deprecate place(Offset) and placeRelative(Offset). Use overloads with int offsets instead ( I4c5e7 )
-
idwas renamed tolayoutIdforLayoutIdParentData.Measurable.idwas renamed toMeasurable.layoutId. ( Iadbcb , b/172449643 )
Версия 1.0.0-альфа07
11 ноября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha07 , androidx.compose.foundation:foundation-layout:1.0.0-alpha07 , and androidx.compose.foundation:foundation-text:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.
API Changes
- Similarly to
Modifier.fillMaxSize[Width|Height]we now support fractions inModifier.fillParentMaxSize[Width|Height]inside the scope ofLazyColumn/Row( I797e2 , b/166586426 ) - Removed
KeyboardOptions.toImeOptionsfrom public API. ( Ic2e45 ) - The foundation AmbientTextStyle, ProvideTextStyle, and AmbientContentColor have been deprecated. Instead use the new versions available in the Material library. For non-Material applications, you should instead create your own design system specific theming ambients that can be consumed in your own components. ( I74acc , b/172067770 )
- foundation.Text has been deprecated and replaced with material.Text. For a basic, unopinionated text API that does not consume values from a theme, see androidx.compose.foundation.BasicText. ( If64cb )
- Added maxLines to TextFields ( Ib2a5b )
- Update TextFields to accept KeyboardOptions ( Ida7f3 )
- Added KeyboardOptions for use in TextFields ( I9ca32 )
- Adds BasicText as a design-unopinionated API for text, parallel to BasicTextField. ( I28268 )
- ExperimentalLazyDsl annotation was removed. LazyColumn/LazyRow can now be used without adding @OptIn ( Idab7a , b/166584730 )
- BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
- BasicTextField has been added as a replacement for both CoreTextField and BaseTextField ( Id4cea )
- Remove deprecated LazyColumnItems/LazyRowItems ( I1d8a8 )
- The deprecated composables for sizing to intrinsic measurements were removed. ( I18537 , b/171811496 )
- relativePaddingFrom was renamed to paddingFrom. The paddingFromBaseline modifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 )
- The matchHeightConstraintsFirst parameter was added to the aspectRatio modifier, which can be used to specify the modifier to size to height constraints before trying the width correspondents. ( Ie7c43 , b/155290593 )
- The deprecated DpConstraints was removed. ( I87884 , b/171702471 )
Исправления ошибок
- Introduced ScaleFactor inline class to represent scale factors for the horizontal and vertical axes independent of one another in order to support non-uniform scaling use cases.
- Added computeScaleFactor method to ContentScale
- Added ContentScale.FillBounds to perform non-uniform scaling to stretch the src bounds to fully occupy the destination.
- Added operator methods to compute ScaleFactor parameters with Size parameters.
- ( Ic96a6 , b/172291582 )
- captureToBitmap moved to captureToImage. ( I86385 )
- Marks CoreText as @InternalTextApi. Use BasicText instead. ( I6aaeb )
- Rename KeyboardOptions as ImeOptions ( I82f36 )
- Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
- CoreTextField has been marked as @InternalTextApi. Use BasicTextField instead ( Ie2469 )
- ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
- Introduce ui-test-junit4 module ( Ib91f8 )
- Updated Icon API to take in Color.Unspecified as a possible tint color which will draw the provided asset or painter without a ColorFilter. Previously attempts to ignore tinting with Color.Unspecified would tint with a transparent color ending up with nothing rendered at all. ( I049e2 , b/171624632 )
- MeasureResult was moved out of MeasureScope. ( Ibf96d , b/171184002 )
- Several layout related symbols were moved from androidx.compose.ui to androidx.compose.layout.ui. ( I0fa98 , b/170475424 )
- androidx.ui.test moved to androidx.compose.ui.test ( I9ffdb )
- FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
- Added SelectionContainer without the callback ( Ibfadb )
- Add Tests for SelectionHandles' Positions in SelectionContainer. ( Ie93db )
- Added Keyboard auto correct IME Option ( I57b8d )
Версия 1.0.0-альфа06
28 октября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha06 , androidx.compose.foundation:foundation-layout:1.0.0-alpha06 , and androidx.compose.foundation:foundation-text:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.
API Changes
- androidx.compose.foundation.Icon has been moved to androidx.compose.material.Icon. You can also use the Image component / Modifier.paint() with a Painter if you do not want to use the Material library. ( I9f622 )
- Added interactionState to Modifier.scrollable, ScrollableColumn and LazyColumnFor ( I81566 , b/169509805 )
- alignByBaseline was added to RowScope and alignWithSiblings was renamed to alignBy ( I06503 , b/170628732 )
- Box was made an inline function. ( Ibce0c , b/155056091 )
- Added maxLines to CoreTextField ( Ibee58 , b/143687793 )
- Added softwrap to CoreTextField. ( I21a4b )
Исправления ошибок
- Deprecate VectorPainter in favor of rememberVectorPainter to better indicate that the composable API internally leverages 'remember' to persist data across compositions. ( Ifda43 )
- Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. ( If0de3 )
- Added single line keyboard option to CoreTextField ( I72e6d )
- Renamed Radius API to CornerRadius to better express how it is used throughout Compose. Updated documentation to indicate that negative corner radii are clamped to zero. ( I130c7 , b/168762961 )
- Add ability to specify inspector info in composed modifier ( Idee08 , b/163494569 )
- Added KeyboardCapitalization IME Option ( I8ac38 )
- Fix Rtl Handle Position. ( I6e1e0 )
- Breaking change: removed the return value from PointerInputFilter.onPointerEvent(...) given that the only value that should be able to be changed in pointer events is consumption data. Instead of returning data from PointerInputFilter.onPointerEvent(...), now you can just mutate the consumption data of the PointerEvents passed in. ( I6acd0 )
- Added SelectAll option into selection menu ( Ief02b )
Версия 1.0.0-альфа05
14 октября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha05 , androidx.compose.foundation:foundation-layout:1.0.0-alpha05 , and androidx.compose.foundation:foundation-text:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.
API Changes
- CoreTextField now supports cursor functionality ( Id23aa )
Deprecates contentColor() and currentTextStyle() APIs, and replaces them with AmbientContentColor and AmbientTextStyle ambients respectively. You can access the current value by using
.currenton the ambient property, as with any other ambient. This was change was made for consistency and to avoid having multiple ways to accomplish the same thing. Additionally renames some ambient properties to better describe their purpose as follows:- ContentColorAmbient -> AmbientContentColor
- TextStyleAmbient -> AmbientTextStyle
- IndicationAmbient -> AmbientIndication
- EmphasisAmbient -> AmbientEmphasisLevels
- RippleThemeAmbient -> AmbientRippleTheme ( I37b6d )
Исправления ошибок
- As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes ( I97611 , b/169797763 )
- Added Copy/Paste/Cut accessibility actions ( I6db4f )
- TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. ( I175c9 , b/158830170 )
- Updated Size.Unspecified parameters to be Float.NaN instead of Float.POSITIVE_INFINITY. Updated Painter implementations to check against Size.Unspecified as well as non-finite Sizes. ( I95a7e )
- Added Paging Compose module and paging integration ( Ib85da )
- Modify LazyListScope to receive nullable values ( I1765b )
- OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )
- Added samples for LazyColumn/Row ( Idc16d )
- Fix for the items and itemsIndexed methods to allow emptyList ( I06647 )
- Add a DSL for specifying inspector information ( Ic9a22 )
- Move LongPress into Text. ( Iff2bc )
- Disable Selection in Text, and a Demo. ( Ie7e97 )
- Support AnnotatedString to SpannableString conversion for accessibility. ( Ief907 )
- Removed
PointerInputFilter.onPointerInput(...).PointerInputFilter.onPointerEvent(...)should be used in its place. ( I6f04a )
Версия 1.0.0-альфа04
1 октября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha04 , androidx.compose.foundation:foundation-layout:1.0.0-alpha04 , and androidx.compose.foundation:foundation-text:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.
API Changes
- Stack was renamed to Box. The previously existing foundation.Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. ( I94893 , b/167680279 )
- Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) ( Ibae92 , b/167680279 )
- Add a new LazyListState class. This allows for observation and control of the scroll position of LazyRow and LazyColumn components. Instances can be created using rememberLazyListState() and passed into the state parameter of the component. Currently, the first visible item and offsets can be observed in this initial version. ( Ic7cb7 , b/159307669 )
- Lazy list position and scroll offset are now saved and restored across Activity recreation ( Ie045f , b/166589058 )
- Add long click semantics action ( I6281b , b/156468846 )
- MutatorMutex utility added for keeping a single mutator of shared state over time and cancelling conflicting mutators by priority ( I3f975 )
- Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc ( I554eb , b/168308412 )
- Removed inlineContent parameter from Text with String input. It won't be used because inlineContent must work with AnnotatedString. ( Ief403 )
- The deprecated custom Arrangement APIs were removed. ( Ic576d , b/168297922 , b/168297923 )
- The
unboundedparameter was added to wrapContentSize modifiers, which enables measuring the layout element with infinite max constraints. ( I77951 , b/158559319 ) - We prevented static imports of contents of layout scopes (eg alignWithSiblings in RowScope). The explicit scope alternative should be used instead:
with(RowScope) { Modifier.alignWithSiblings(FirstBaseline) }. ( I216be , b/166760797 )
Исправления ошибок
- Updated many Graphics APIs
- Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
- Removed Rect.expandToInclude and Rect.join methods
- Updated Radius documentation to say oval in addition to elliptical
- Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
- Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
- Deprecated Rect.shift in favor of Rect.translate
- Removed RoundRect.grow and Rect.shrink APIs
- Renamed RoundRect.outerRect to Rect.boundingRect
- Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
- Renamed RoundRect.longestSide to RoundRect.maxDimension
- Renamed RoundRect.shortestSide to RoundRect.minDimension
- Changed RoundRect.center to be a property instead of a function
- Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
- Removed Size APIs that assumed it was a Rectangle with origin at 0,0
- Added a destructing API to Radius
- Migrated various RoundRect extension functions to be properties instead
- ( I8f5c7 , b/168762961 )
- Performance optimizations for LazyColumnFor/LazyRowFor scrolling by not doing unnecessary recompositions during every scroll ( I64f65 , b/168293643 , b/167972292 , b/165028371 )
- Fixed crash in LazyColumnFor/LazyRowFor after scrolling and then changing items and implemented auto scrolling up when the previously visible item was removed so we don't display empty gaps in the end anymore ( I220ab , b/161480164 , b/167855468 )
- Nesting scrollable in the same direction containers like ScrollableContainer and LazyColumnFor is not allowed anymore. It was never supported and was breaking the fling and all the laziness of composing the items of LazyColumnFor ( I6e101 )
- Updated many Graphics APIs
- Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
- Updated clipPath documentation to refer to Path instead of rounded rectangle
- Fixed spacing in documentation for right parameter in clipPath
- Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
- Renamed dx/dy parameters in inset method to horizontal and vertical
- Added inset overload that provides the same inset value to all 4 bounds
- Removed documentation on inset method indicating that inset would be applied to all 4 sides
- Updated documentation for Rect class
- Updated comments on Rect parameters to match kdoc style
- Removed Rect.join and Rect.expandToInclude
- Created overload for Rect.translate(offset) and deprecated Rect.shift
- ( If086a , b/167737376 )
- add AccessibilityScrollState to semantics properties. ( Ifeda9 )
- Make TextRange inline to avoid object creation. ( Id034b )
- ParagraphConstraints is removed. Width is directly passed to Paragraph now. ( Ica712 )
Версия 1.0.0-альфа03
16 сентября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha03 , androidx.compose.foundation:foundation-layout:1.0.0-alpha03 , and androidx.compose.foundation:foundation-text:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.
API Changes
- InnerPadding was renamed to PaddingValues. ( I195f1 , b/167389171 )
- Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
- An alignment parameter was added to Stack, which allows specifying the default alignment for all the Stack children. ( Ie80ca , b/164085265 )
Исправления ошибок
- DpConstraints and APIs using it were deprecated. ( I90cdb , b/167389835 )
- The parameters
minWidthandmaxWidthofwidthInwere renamed tominandmax. Similarly forpreferredWidthIn,heightIn,preferredHeightIn. ( I0e5e1 , b/167389544 ) - Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
- Fixed size and position calculations in GestureScope, which caused amongst others generation of invalid swipe gestures ( Iaf358 , b/166589947 )
- Moved
createAndroidComposeRuleandAndroidInputDispatcherfromandroidx.ui.test.androidtoandroidx.ui.test( Idef08 , b/164060572 )
Версия 1.0.0-альфа02
2 сентября 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha02 , androidx.compose.foundation:foundation-layout:1.0.0-alpha02 , and androidx.compose.foundation:foundation-text:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.
Исправления ошибок
- TestUiDispatcher is marked experimental ( Iae99d , b/161247083 )
Added
ManualFrameClock.hasAwaitersto see if anything is awaiting a frame from that clock;runWithManualClockas a replacement forrunBlockingwhen running tests that need a ManualFrameClock;TestUiDispatcher.Mainthat gives easy access to the main UI dispatcher in your tests.Например:
@Test fun myTest() = runWithManualClock { clock -> // set some compose content withContext(TestUiDispatcher.Main) { clock.advanceClock(1000L) } if (clock.hasAwaiters) { println("The clock has awaiters") } else { println("The clock has no more awaiters") } }( I0a85b , b/161247083 )
Version 1.0.0-alpha01
26 августа 2020 г.
androidx.compose.foundation:foundation:1.0.0-alpha01 , androidx.compose.foundation:foundation-layout:1.0.0-alpha01 , and androidx.compose.foundation:foundation-text:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.
Version 0.1.0-dev
Version 0.1.0-dev17
19 августа 2020 г.
androidx.compose.foundation:foundation:0.1.0-dev17 , androidx.compose.foundation:foundation-layout:0.1.0-dev17 , and androidx.compose.foundation:foundation-text:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.
API Changes
- The spacedBy Arrangement was added for Row and Column, to enable positioning layout children with a fixed spacing. The aligned Arrangment was also added, to enable positioning layout children one next to the other and aligned in the Row/Column according to an Alignment. The previous Arrangement.Vertical#arrange and Arrangement.Horizontal#arrange methods were deprecated, and writing custom Arrangements will not be supported in the future. ( I6733d , b/161985975 )
- Offset has become an inline class ( Iaec70 )
- Removed onFocusChanged callbacks from TextField. Use Modifier.focusObserver instead. ( I51089 , b/161297615 )
- Modifier.drawBorder has been deprecated. Use Modifier.border instead. Border data class has been replaced by BorderStroke ( I4257d , b/158160576 )
- VerticalScroller and HorizontalScroller have been removed. Use ScrollableColumn/Row instead. Modifier.drawBackground has been removed. Use Modifier.background ( I73b0d , b/163019183 )
- Remove marked as deprecated fillMax* modifiers from LazyItemScope as they are making it harder to add such modifiers correctly for items which are not direct children of LazyColumnFor ( Ifa78d )
- added LazyColumn/LazyRow implementation as DSL ( I93cc6 )
- Constraints is now an inline class ( I88736 )
- Added the ability to size a layout to a fraction of the available space, using the fillMaxWidth, fillMaxHeight and fillMaxSize modifiers. ( I945bb , b/161562591 )
Исправления ошибок
- Added a modifier param to SelectionContainer ( I4aada , b/161487952 )
- Added mergePolicy lambda to SemanticsPropertyKey. This can be used to define a custom policy for mergeAllDescendants semantics merging. The default policy is to use the parent value if already present, otherwise the child value. ( Iaf6c4 , b/161979921 )
-
PlacementScope.placeAbsolute()was renamed toPlacementScope.place(), and the previousPlacementScope.place()was renamed toPlacementScope.placeRelative(). As a result, thePlacementScope.place()method will not automatically mirror the position in right-to-left contexts anymore. If this is desired, usePlacementScope.placeRelative()instead. ( I873ac , b/162916675 ) - Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. ( I5e889 )
- Added backgroundColor parameter to LinearProgressIndicator and removed internal padding from CircularProgressIndicator. Added new ProgressIndicatorConstants.DefaultProgressAnimationSpec which can be used as the default AnimationSpec when animating progress between values ( If38b5 , b/161809914 , b/161804677 )
- The
state { ... }composable is now deprecated in favor of explicit calls toremember { mutableStateOf(...) }for clarity. This reduces the overall API surface and number of concepts for state management, and matches theby mutableStateOf()pattern for class property delegation. ( Ia5727 ) - Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors ( I5d325 )
- Removed onChildPositioned and OnChildPositionedModifier. Developers should use onPositioned and OnPositionedModifier on the child layout instead. ( I4522e , b/162109766 )
- IntSize is now an inline class ( I2bf42 )
- LongPress the Blank Area to Edit. ( Ib1e5b )
- Hide FloatingToolbar After Tapping on the Text. ( If4525 )
- Hide FloatingToolbar When Updating the Selection. ( I8444c )
- Deselect When Blur. ( I781a2 )
Version 0.1.0-dev16
5 августа 2020 г.
androidx.compose.foundation:foundation:0.1.0-dev16 , androidx.compose.foundation:foundation-layout:0.1.0-dev16 , and androidx.compose.foundation:foundation-text:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.
API Changes
- LazyItemScope was added for itemContent param of Lazy lists. It provides modifiers to fill the parent max size which solves the use case when the item should fill the viewport and the regular Modifier.fillMaxSize() doesn't work as the item is measured with infinity constraints. ( Ibd3b2 , b/162248854 )
- Move dialog to ui ( I47fa6 )
- Added LazyColumnForIndexed/LazyRowForIndexed - versions of LazyColumnFor/LazyRowFor which provides both index and item in the itemCallback. It is useful when in addition to a current item you need to know a current index. ( I65ff3 )
- Modifier.deternimateProgress has been renamed to Modifier.progressSemantics ( I9c0b4 )
- LazyColumnItems was renamed to LazyColumnFor. LazyRowItems was renamed to LazyRowFor ( I84f84 )
- Add some Marks/Annotations for best practice reason. ( I66b20 )
- foundation.shape.corner package were flatten to foundation.share ( I46491 , b/161887429 )
- Added сrossaxis gravity param for LazyRowItems/LazyColumnItems. LazyRowItems/LazyColumnItems now support wrap content behaviour. ( Ib39fc )
- ZoomableState has been renamed to ZoomableController. Custom curve support has been added for smoothScale.
enabledandonZoomStartedfunctionality has been added ( If8b8f ) - Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use ( Ia6242 , b/155482676 )
- Previously deprecated AdapterList has been removed. Use LazyColumnItems instead ( I12b9b )
- Modifier.drawBackground has been renamed to Modifier.background ( I13677 )
- The old ConstraintLayout DSL was removed. ConstraintSet2 has been renamed to ConstraintSet. ( If58d1 , b/162450908 )
- Added Modifier.absoluteOffset() and Modifier.absoluteOffsetPx(). Unlike offset modifiers, absolute offset modifiers will not auto-mirror in right-to-left context ( I3aa21 )
-
RowandColumnare now inline function significantly reducing the overhead of using them. ( I75c10 )
Исправления ошибок
- Address broad API fixes ( I077bc )
- Remove unused OffsetBase interface
- Align Offset and IntOffset classes to have a consistent API surface
- Rename IntOffset.Origin to IntOffset.Zero to be consistent with Offset API
- Moved nativeCanvas method off of Canvas interface to support consumers to create their own Canvas instances
- Created stub EmptyCanvas class to refactor DrawScope to be a non-null parameter instead of lateinit and ensure non-nullability of the field
- Renamed ClipOp enums to be Pascal Case
- Renamed FilterQuality enums to be Pascal Case
- Renamed StrokeJoin enums to be Pascal Case
- Renamed PointMode enums to be Pascal Case
- Renamed PaintingStyle enums to be Pascal Case
- Renamed PathFillType enums to be Pascal Case
- Renamed StrokeCap enums to be Pascal Case
- Updated DrawCache implementation to no longer use lateinit params
- Updated DrawScope to no longer use lazy delegation for fillPaint and strokePaint internal parameters
- Updated Image composable to avoid Box usage for less overhead
- Updated Outline class to have @Immutable annotations
- Updated PathNode to have @Immutable annotations for each path instruction
- Updated Vector subcomposition to remove redundant conditional checks for equality as compose already handles them
- Deprecated Rect companion constructor methods in favor of function constructors
- Updated Brush classes and function constructors with @Immutable and @Stable APIs
- Updated VertexMode enum to be PascalCase
- Updated DrawScope selectPaint method to conditionally overwrite stroke parameters on the paint if they have changed
- Updated Size to add destructuring API, rename UnspecifiedSize to Unspecified and removed unused methods
Added MonotonicFrameAnimationClock that enables you to use a MonotonicFrameClock as an AnimationClockObservable to bridge the gap between the new coroutines based clocks and APIs that still use the old callback based clocks.
The MonotonicFrameClock equivalent of ManualAnimationClock is now ManualFrameClock. ( I111c7 , b/161247083 )
Removed
SemanticsNodeInteraction.performPartialGesture. UseSemanticsNodeInteraction.performGestureinstead. ( Id9b62 )Renamed
SemanticsNodeInteraction.getBoundsInRoot()toSemanticsNodeInteraction.getUnclippedBoundsInRoot()( Icafdf , b/161336532 )The APIs for right-to-left support has been updated. LayoutDirectionAmbient has been added, which can be used to read and change the layout direction. Modifier.rtl and Modifier.ltr have been removed. ( I080b3 )
Modifier.plus has been deprecated, use Modifier.then instead. 'Then' has a stronger signal of ordering, while also prohibits to type
Modifier.padding().background() + anotherModifier, which breaks the chain and harder to read ( Iedd58 , b/161529964 )Added
isFocused()andisNotFocused()SemanticsMatcher. ( I0b760 )RemeasurementModifier was added. It allows users to synchronously remeasure the layout. In general, you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll. ( I5f331 , b/160791058 )
isSystemInDarkTheme now always considers the system-wide dark theme setting, and ignores power saving status before Q, following latest guidance. ( I0c10c )
OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )
Renamed AndroidComposeTestRule to createAndroidComposeRule. ( I70aaf )
Add accessibility action to get TextLayoutResult ( I9d6e6 )
Version 0.1.0-dev15
22 июля 2020 г.
androidx.compose.foundation:foundation:0.1.0-dev15 , androidx.compose.foundation:foundation-layout:0.1.0-dev15 , and androidx.compose.foundation:foundation-text:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.
To use the 0.1.0-dev15 version of Compose, you will need to:
Dependencies Update
- To use the
0.1.0-dev15version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies .
API Changes
- Similarly to the new param in ScrollableColumn/ScrollableRow LazyColumnItems/LazyRowItems now also have contentPadding param which allows to add a padding for the content after it has been clipped, which is not possible via just a modifier param. It also allows to add a spacing only before first item/after last item. ( Ibc24e )
- onFocusChange callback in text fields renamed to onFocusChanged ( Ida4a1 )
- VerticalScroller and HoriziontalScroller have been deprecated. Use ScrollableColumn and ScrollableRow for build-in experience with Column/Row behaviour and parameters, or Modifier.verticalScroll and Modifier.horizontalScroll on your own element. Similarly, ScrollerPosition has been deprecated in favor of ScrollState' ( I400ce , b/157225838 , b/149460415 , b/154105299 )
- Modifier.draggable and Modifier.scrollable APIs were reworked. DragDirection was removed in favor of Orientation. State required for scrollable has beed simplified. ScrollableState has been renamed to ScrollableController ( Iab63c , b/149460415 )
- Single-value semantics properties now use a calling style. For example, 'semantics { hidden = true }' is now written as:
semantics { hidden() }. ( Ic1afd , b/145951226 , b/145955412 ) - Corner sizes used by RoundedCornerShape and CutCornerShape can now be larger than 50% ( Id2340 , b/160400213 )
- Changed the default ContentScale parameter for the Image composable from Inside to Fit. This was done in order to get behavior to scale up the underlying Painter if the layout size is larger than the intrinsic size of the painter while maintaining the aspect ratio. This behavior better matches expectations for providing fixed sizes to the Image while not affecting the default behavior if only the intrinsic size is used to compute the size of the composable. ( I40ae3 , b/159838006 )
- Use AnimationSpec instead of AnimationBuilder in the top level APIs to clarify the concept of static animation specification -Improve the transition DSL by removing the lambda requirement for creating AnimationSpecs such as tween, spring. They instead take constructor params directly. -Improve the overall ease of use of AnimationSpec opening up constructors instead of relying on builders -Change the duration and delay for KeyFrames and Tween to Int. This eliminates unnecessary type casts and method overloading (for supporting both Long and Int). ( Ica0b4 )
- Clickable was removed. Use Modifier.clickable ( I84bdf )
- Added LazyRowItems - Horizontally scrolling analogue of LazyColumnItems ( Ibbcf7 )
- Introduced low level stateless animation APIs. These APIs ( I63bf7 )
- androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead ( I4066d , b/155211005 )
- Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )
- androidx.ui.foundation.shape.RectangleShape removed; use androidx.ui.graphics.RectangleShape ( I94939 , b/154507984 )
- In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. ( Ic0191 )
- In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. ( I3ad98 )
- Added Modifier.zoomable for pinch-to-zoom functionality ( Id5d63 )
- Toggleable component has been deprecated. Use Modifier.toggleable instead ( I35220 , b/157642842 )
- MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. ( I02b47 , b/157642842 )
- TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )
- Adds fontWeight parameter to Text, which was accidentally not added previously ( I56937 )
- Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I19d02 )
- VerticalScroller now provides Column out of the box. HorizontalScroller now provides Row out of the box. ( Ieca5d , b/157020670 )
- Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Iede0b )
- Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements ( I8425f , b/155287131 )
- VerticalScroller and HorizontalScroller now support reversed scrolling is isReversed is set on ScrollerPosition ( I953bd )
- Support adding composables into text layout. ( I1373c )
- Consolidated CanvasScope implementations so there is now just DrawScope and ContentDrawScope Renamed CanvasScope to DrawScope. Updated DrawScope to implement Density interface and provide LayoutDirection Deleted DrawScope subclass in ContentDrawScope Painter and PainterModifier have been updated to no longer maintain an RTL property themselves as DrawScope provides this already without manually providing it ( I1798e )
- Removed deprecated DrawBackground API in favor of drawBackground extension APIs on Modifier. Refactored color, brush and paint drawBackground implementations to reduce code paths as well as remove requirement for Modifier to be created as part of composition. ( I0343a )
- Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )
- HorizontalScroller and VerticalScroller not restores their scroll position using saved instance state. ( Ia0fae , b/155075048 )
- FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. ( Ic4826 )
- Table layout was removed temporarily until we will make it available again with a refreshed API. ( Id88a7 )
Created CanvasScope API that wraps a Canvas object to expose a stateless, declarative drawing API surface. Transformations are contained within their own receiver scope and sizing information is also scoped to corresponding inset bounds. It does not require a consumer to maintain its own Paint state object for configuring drawing operations.
Added CanvasScopeSample as well as updated the demo app to include a declarative graphics demo ( Ifd86d )
ColoredRect has been removed. User Box with drawBackground modifier instead ( I983c7 , b/152753731 )
Add cursor color customisation to the TextField ( I6e33f )
Now it is possible to hide/show software keyboard by using SoftwareKeyboardController which is delivered by onTextInputStarted callback ( I8dc44 , b/151860051 )
TextFieldValue used with TextField can now be survive activity recreation when used like this:
var text by savedInstanceState(saver = TextFieldValue.Saver) { TextFieldValue() }( I5c3ce , b/155075724 )Adds commonly used parameters to Text(). If you are currently creating a local text style to pass a small number of these parameters, such as
Text(style = TextStyle(textAlign = TextAlign.Center)), you can now just provide the parameters directly:Text(textAlign = TextAlign.Center)( I82768 )Replaced CoreTextField/TextField focusIdentifier parameter with FocusNode in order to integrate with focus subsystem. ( I7ea48 )
TextField update - in horizontal dimension it will occupy all available space granted to it ( Ib08df , b/154638552 )
Added InteractionState and Interaction, making it easier to build components that react to UI state changes such as press, and drag ( Icfe25 , b/152525426 )
RectangleShape moved from androidx.ui.foundation.shape.* to androidx.ui.graphics.* ( Ia74d5 , b/154507984 )
Replaced all nullable Color uses in API with non-nullable and use Color.Unset instead of null ( Iabaa7 )
TextField API update - merged onFocus and onBlur callbacks into a single onFocusChange(Boolean) callback with parameter ( I66cd3 )
Renamed ScaleFit to ContentScale Moved ContentScale from ui-graphics to ui-core module to live in the same module as the Alignment API. Renamed FillMaxDimension to Crop Renamed FillMinDimension to Fit Renamed Fit to Inside to better match ImageView.ScaleType equivalents Added documentation indicating that the combination of Crop and Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_CROP and Fit used with Alignment.Center achieves the same result as ImageView.ScaleType.FIT_CENTER Inside used with Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_INSIDE ( I45f09 , b/152842521 )
Removes ProvideContentColor, instead just use ContentColorAmbient directly with
Providers( Iee942 )Adds color parameter to text, allowing overriding the color of the text style without needing to manually merge with the style provided in a theme. ( I41a66 )
Improve DrawModifier API:
- Made the receiver scope for draw() ContentDrawScope
- Removed all parameters on draw()
- DrawScope has same interface as former CanvasScope
- ContentDrawScope has drawContent() method ( Ibaced , b/152919067 )
ColoredRect has been deprecated. Use
Box(Modifier.preferredSize(width, height).drawBackground(color))instead. ( I499fa , b/152753731 )Shape theming system is updated according to the Material design specification. Now you can provide small, medium and large shapes to be used by most of the components ( Ifb4d1 )
Replaced Modifier plus operator with factory extension functions ( I225e4 )
Draggable has been moved to modifier ( Id9b16 , b/151959544 )
Moved
Textto androidx.ui.foundation package, from androidx.ui.core. ( I87ce5 )add
enabledparam to Checkbox, Switch and Toggleable ( I41c16 )Ripple is now a Modifier. While Clickable is not yet converted the recommended usage is
Clickable(onClick = { ... }, modifier = ripple())( Ie5200 , b/151331852 , b/150060763 )Added VectorPainter API to replace existing subcomposition API for vector graphics. Result of subcomposition is a VectorPainter object instead of a DrawModifier. Deprecated previous DrawVector composables in favor of VectorPainter.
Renamed
Image(Painter)API toPaintBox(Painter)Created Vector composable that behaves like the Image composable except with a VectorAsset instead of an ImageAsset ( I9af9a , b/149030271 )Created Image composable to handle sizing/layout in addition to drawing a given ImageAsset to the screen. This composable also supports drawing any arbitrary Painter instance respecting its intrinsic size as well as supporting a given fixed size or minimum size ( Ibcc8f )
Button, FloatingActionButton and Clickable now have a separate
enabledparam. Some of the params on Button were renamed or reordered. ( I54b5a )Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content.
Created extension method on android.graphics.Bitmap,
Bitmap.asImageAsset(), to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework. ( Id5bbd )DrawImage composable was removed. Use ImagePainter to draw image on existing layout, or SimpleImage to introduce Image that takes space ( I595e1 , b/149827027 )
Stack component supports right-to-left directionality ( Ic9e00 )
Added Icon, IconButton and IconToggleButton, removing AppBarIcon. You can directly replace existing usages of AppBarIcon with IconButton, and they will now have the correct touch target. See the samples for usage information, and see Icons for the provided Material Icons you can use directly with these components. ( I96849 )
DrawShape composable was removed. Use DrawBackground modifier instead. ( I7ceb2 )
Added AdapterList, a scrolling list component that only composes and lays out the visible items. Currently known issues include that it is vertical-only and does not fully handle all cases of changes to its children. ( Ib351b )
Scrollable component has been added, which allows creation of custom Scrollers/Lists ( I5fd37 )
Renamed background to DrawBackground and make it to be memorized by default ( Ia0bd3 )
Add paddings, border, shape and background param to Box ( I05027 , b/148147281 )
Added Canvas component. This composable takes up some size (provided by user) and allows you to draw using CanvasScope ( I0d622 )
rename
Bordermodifier toDrawBorder( I8ffcc )Added Box component for combining layout and drawing common functionality. ( I6e2a7 )
Scrollers now exhibit native Android fling motion behavior. ( I922af , b/147493715 )
Replaced DrawBorder in favor of Border Modifier ( Id335a )
Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )
The percent parameter when creating ConstraintLayout guidelines has been renamed to fraction. ( Ida2db )
Added support for margins of ConstraintLayout barriers. ( I47ffe )
Fixed RTL support in ConstraintLayout. Added RTL unaware APIs. ( I3b1c7 )
A new DSL for ConstraintLayout has been added. Please see the samples for more details. ( Icaa9a )
Added the @ExperimentalLayout annotation. ConstraintLayout, FlowRow and FlowColumn are now tagged with it to mark that their APIs are going to change. ( I412a8 )
Modifier.padding(InnerPadding)has been added ( I94985 , b/157133803 )Removed deprecated RowAlign, ColumnAlign in Row and Column. ( If60d4 , b/155858731 )
Removed deprecated LayoutTag(), please use Modifier.tag() instead. Removed deprecated Modifier.matchParent(), please use Modifier.matchParentSize() instead. ( If8044 )
Added the offsetPx layout modifier, which can be used to define (dynamic) offsets in px. ( I5af57 )
AlignmentLineOffset composable is deprecated, please use relativePaddingFrom() modifier instead. CenterAlignmentLine composable is removed. ( I60107 )
Added defaultMinSizeConstraints layout modifier, which sets size constraints to the wrapped layout only when the incoming corresponding constraints are unspecified (0 for min constraints and infinity for max constraints). ( I311ea , b/150460257 )
Container has been removed. Use Box instead ( Ibbc2b , b/151407926 )
Removed deprecated LayoutWidth/Height/Size modifiers. ( Ib0bc1 )
Added default parameter values for the offset modifier. ( I37f06 )
Added symmetric padding modifier. ( I39840 )
Removed deprecated LayoutAspectRatio modifier. ( I65a74 )
Removed deprecated LayoutAlign modifiers. ( I10877 )
Fixed a bug in the width and height modifiers that was causing the wrapped layout to be measured with no opposite axis constraints. ( I210b8 , b/154797971 )
Added verticalGravity and horizontalGravity parameters to Row and Column, respectively. ( I7dc5a )
Updated wrapContentWidth and wrapContentHeight to expect vertical or horizontal Alignment rather than any Alignment. The gravity modifier was updated to accept vertical or horizontal Alignment. Row, Column and Stack were updated to support custom continuous Alignments. ( Ib0728 )
Made Alignment instantiable with arbitrary values. Added 1D Alignments. ( Ia0c05 )
Renamed EdgeInsets to InnerPadding. Renamed innerPadding parameter of Material Buttons to paddding. ( I66165 )
alignToSiblings now accepts a Measured instead of Placeable. ( I5788d )
Added modifiers for sizing to intrinsic measurements and deprecated the components serving this purpose. ( I8295d )
Added support for customizing dimensions of children of ConstraintLayout ( Idb1a5 )
Removed deprecated Wrap and Center composables. ( I29e23 )
Added LayoutModifier2, a new API for defining layout modifiers; deprecated LayoutModifier ( If32ac )
RowScope and ColumnScope members are now accessible outside Row and Column. ( I3a641 )
Container has been deprecated. Use Box instead. ( I675ce , b/151407926 )
Added the LayoutOffset modifier for offsetting layout position ( I0b8a3 )
Initial support for Rtl in Compose layout ( Ia5519 )
Updated LayoutAlign to not fill the available space anymore ( I2b14f )
Removed AspectRatio composable in favor of modifier. Deleted obsolete FlexColumn, FlexRow composables and Spacing modifier ( Iec8a7 )
Removed the LayoutInflexible modifier for Row and Column ( I0d820 )
Implement Drag Selection Handles to change selection for TextField. ( I27032 )
Implements LongPressAndDrag for TextField Selection. ( I17919 )
Исправления ошибок
- FocusModifier is deprecated in favor of Modifier.focus, Modifier.focusRequester, Modifier.focusObserver. FocusState and FocusDetailedState are deprecated in favor of FocusState2 ( I46919 , b/160822875 , b/160922136 )
-
runOnIdleComposerenamed torunOnIdle( I83607 ) - Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. ( I7f164 )
- Removes previously deprecated Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. ( I663b2 , b/155375067 )
- Removed obsolete size testing APIs. ( Iba0a0 )
- Made LayoutNode experimental API ( I4f2e9 )
- Version 1 of scroll orientation locking is implemented across Compose. ( I1ce7a , b/150289741 )
- Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
- Removed layout direction parameter from the measure block of the Layout() function. Layout direction is however available inside the callback through the measure scope object ( Ic7d9d )
- Add AbsoluteArrangement - allows for arrangement of the children inside the Row without automatic mirroring in RTL ( I3a1df )
- @Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) ( Id211e )
- Prior to this change, the compose compiler plugin would non-trivially intercept calls to constructors inside of a @Composable function if there was an ( I5205a , b/158123804 )
- Add
viewModel()composable which allows to create or get already created ViewModel similarly to how it works in Activity or Fragment ( I5fdd1 ) Refactored Radius class to be an inline class. Removed companion creation methods in favor of function constructor with default parameter to have the radius along the y-axis match that of the mandatory x-axis radius parameter.
Updated DrawScope.drawRoundRect to consume a single Radius parameter instead of 2 separate float values for the radius along the x and y axis ( I46d1b )
Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters. Deleted Px class in its entirety ( I3ff33 )
Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I086f4 )
Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Id3434 )
Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I97a5a )
TextField's cursor has a blinking animation ( Id10a7 )
Partial gestures no longer require passing around of a GestureToken ( Id7ae5 )
Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I57bff )
Modifier.semantics has been undeprecated to allow usages for high level components. ( I4cfdc )
Rename AnnotatedString.Builder.addAnnotationString to addStringAnnotation. ( I5059e )
Updated Alignment API and added support for absolute alignment (which does not auto-mirror in Rtl context) ( I38cd3 )
Layout and LayoutModifier children can be measured with a different layout direction. ( Ibd731 )
Introduce additional optional rect parameter to ImagePainter to support drawing a subsection of underlying ImageAsset ( I0ea9e )
Fixed a crash in AdapterList when removing items ( Ic64b0 , b/153195921 )
We changed how we measure the first layout you put inside activity.setContent { } block. Previously it was forced to fill the whole activity screen, and now it behaves as if you put your layout inside a Stack: it can be smaller than a screen and will be positioned in the top left screen. If you want the old behaviour you can apply Modifier.fillMaxSize() for your layout. ( Ie88a7 , b/153453714 )
ui-text-compose module is renamed as ui-text. ui-text now contains CoreText and CoreTextField composables ( Ib7d47 )
ui-text module is renamed as ui-text-core ( I57dec )
Moved ui-framework/CoreText, CoreTextField composables under ui-text-compose. You might want to include ui-text-compose in your project. ( I32042 )
runOnIdleComposeandrunOnUiThreadare now global functions instead of methods on ComposeTestRule. ( Icbe8f )[Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using
by state { ... }orby mutableStateOf(...). ( I5312c )DrawLayerModifier and drawLayer() now default clipToBounds and clipToOutline to false. ( I0eb8b , b/152810850 )
Renamed LayoutResult to MeasureResult. ( Id8c68 )
Deprecated Center composable. It should be replaced either with the LayoutSize.Fill + LayoutAlign.Center modifier, or with one of the Box or Stack composables with suitable modifiers applied ( Idf5e0 )
Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. ( If4738 )
DrawVector has been changed from a regular composable function to returning a Modifier drawVector() that will draw the vector as a background to a layout. ( I7b8e0 )
Replace composable function Clip with modifier drawClip(). DrawClipToBounds is a convenient modifier to use when you only need to clip to the layer bounds with a rectangle shape. ( If28eb )
Replaced DrawShadow composable function with drawShadow() modifier. Shadows are now drawn as part of LayerModifier. ( I0317a )
androidx.compose.ViewComposer has been moved to androidx.ui.node.UiComposer androidx.compose.Emittable has been removed. It was redundant with ComponentNode. androidx.compose.ViewAdapters has been removed. They are no longer a supported use case. Compose.composeInto has been deprecated. Use
setContentorsetViewContentinstead. Compose.disposeComposition has been deprecated. Use thedisposemethod on theCompositionreturned bysetContentinstead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move ( Idef00 )Deprecated Wrap composable. It can be replaced either with the LayoutAlign modifier or with the Stack composable ( Ib237f )
Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )
Rename Painter.toModifier to Painter.asModifier as the newly created Modifier has a reference to the original Painter that can be shared across multiple Modifier instances ( I7195b )
Support right-to-left direction in LayoutPadding modifier ( I9e8da )
Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) ( I11cb1 )
Removed ValueHolder class. Restructured AnimatedValue, AnimatedFloat classes to make the animation value field abstract so that subclasses can watch the value update.
- Added model classes for AnimatedValue, AnimatedFloat, etc.
- Added a new set of light-weight @Composable API for animating between values.
- ( I79530 )
Breaking changes to the ambients API. See log and
Ambient<T>documentation for details ( I4c7ee , b/143769776 )Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. ( I896c5 , b/158134875 )
Fixed a ConstraintLayout bug causing a crash on recompositions. ( Ibee5a , b/158164341 )
WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp ( I91b9a , b/149979702 )
Renamed LayoutModifier2 to LayoutModifier. ( Id29f3 )
Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )
LayoutDirectionAmbient is deprecated. To read the layout direction defined by the locale, use localeLayoutDirection on ConfigurationAmbient ( I851b1 )
Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )
ParentData composable is deprecated. You should either create a modifier which implements ParentDataModifier interface, or use LayoutTag modifier if you simply need to tag layout children to recognize them inside the measure block. ( I51368 , b/150953183 )
Add OnPositionedModifier and OnChildPositionedModifier to replace OnPositioned and OnChildPositioned composable functions. ( I2ec8f )
Disallow negative padding in LayoutPadding. LayoutOffset should be used instead for negative position offsets. ( Ifb5b1 )
WithConstraints got LayoutDirection parameter ( I6d6f7 )
Updated the
ComposeFlags.COMPOSER_PARAMflag to betrue, which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. ( I7971c )Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. ( I0245a )
LayoutCoordinates no longer has a position property. The position property does not make sense when considering LayoutModifiers, rotation, or scaling. Instead, developers should use parentCoordinates and childToLocal() to calculate the transform from one LayoutCoordinate to another.
LayoutCoordinates uses IntPxSize for the size property instead of PxSize. Layouts use integer pixel sizes for layouts, so all layout sizes should use integers and not floating point values. ( I9367b )
Improvements to the API surface of Constraints ( I0fd15 )
Added TextDirection.Content ( I48f36 )
Ajdust the Toolbar Menu to show copy, cut, paste properly. ( Id3955 )
Add FloatingToolbar for TextField Selection. ( Ie8b07 )
TextDirectionAlgorithm is renamed as TextDirection ( I75ce8 )
TextDirection is renamed as ResolvedTextDirection ( I3ff38 )
Add HapticFeedback to TextField Selection. ( I58050 )
Add Copy, Cut, and Paste methods to TextField Selection. ( Idb70b )
TestTag and Semantics have been deleted. Use Modifier.testTag and Modifier.semantics instead ( I15ff0 , b/158841414 )
Changed the package name for Locale and LocaleList from androidx.ui.text to androidx.ui.intl ( I8132c )
API change:
AnnotatedString(builder: Builder)is renamed toannotatedString(builder: Builder). ( Ia6377 )API change:
AnnotatedString.Itemis renamed toAnnotatedString.Range. ( I2d44d )Add Toolbar for text related operations. ( I49d53 )
New LifecycleOwnerAmbient is now available. Now an Activity you are using with Compose UI should extend androidx.activity.ComponentActivity (or AppCompatActivity). setContent on android.app.Activity is now deprecated ( Idb25a , b/153141084 )
ui-android-text package name (androidx.text) replaced with androidx.ui.text.platform in order to align with androidx policy. ( I42711 )