Интерфейс создания
androidx.compose.ui
androidx.compose.ui.geometry
androidx.compose.ui.graphics
androidx.compose.ui.platform
androidx.compose.ui.test
( См. справочную документацию API для всех пакетов Compose )
| Последнее обновление | Стабильный релиз | Кандидат на релиз | Бета-версия | Альфа-релиз |
|---|---|---|---|---|
| 13 августа 2025 г. | 1.9.0 | - | - | 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 вашего приложения или модуля:
классный
dependencies { implementation "androidx.compose.ui:ui:1.9.0" } android { buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Котлин
dependencies { implementation("androidx.compose.ui:ui:1.9.0") } android { buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Дополнительные сведения о зависимостях см. в разделе Добавление зависимостей сборки .
Обратная связь
Ваши отзывы помогают улучшить Jetpack. Сообщите нам, если вы обнаружите новые проблемы или у вас есть идеи по улучшению этой библиотеки. Пожалуйста, ознакомьтесь с уже существующими проблемами в этой библиотеке, прежде чем создавать новую. Вы можете проголосовать за существующую проблему, нажав на кнопку со звёздочкой.
Более подробную информацию см. в документации по системе отслеживания проблем .
Версия 1.10
Версия 1.10.0-альфа01
13 августа 2025 г.
Выпущен androidx.compose.ui:ui-*:1.10.0-alpha01 . Версия 1.10.0-alpha01 содержит следующие коммиты .
Изменения API
- Наведение указателя мыши или сенсорной панели в
ComposeViewтеперь автоматически снимает фокус, если наведение указателя не происходит в пределах сфокусированного узла. Это приводит к пользовательскому опыту, характеризующемуся «нажатием для снятия фокуса», что более ожидаемо, чем текущее поведение при использовании устройств ввода с указателем. От этого поведения можно отказаться с помощью нового APIAbstractComposeView.isClearFocusOnPointerDownEnabled. ( I6322b , b/282963174 ) - Представлен интерфейс
FillableDataдля поддержки различных типов компонентов автозаполнения, помимо текста. ( If9bd2 ) - Новый API для динамического включения и отключения общих элементов, который также позволяет учитывать, происходит ли уже переход общего элемента. Новый API для установки альтернативных целевых границ при удалении целевого общего элемента во время перехода. Новый API для получения
LayoutCoordinatesобъектаLookaheadScope. ( I18dd4 , b/409819304 , b/395670637 ) - Введен флаг
isNestedScrollInteropIntegerPropagationEnabledдля управления экспериментом по отправке корректных целых чисел во вложенное взаимодействие прокрутки. ( If8316 ) - Добавлен
requestFocusForChildInRootBounds()вDelegatableNodeдля перемещения фокуса на дочерний элемент, который перекрывает заданный прямоугольник. ( I001ef ) - Удалены флаги
isOnScrollChangedCallbackEnabled,isAdjustPointerInputChangeOffsetForVelocityTrackerEnabled,isFlingContinuationAtBoundsEnabled,isAutomaticNestedPrefetchEnabled,DragGesturePickUpEnabled,isPointerInteropFilterDispatchingFixEnabled,isNestedScrollInteropPostFlingFixEnabled,isNestedScrollDispatcherNodeFixEnabled( I36c18 ). - Добавлена аннотация
@CheckResultдля функций поиска и селектораSemanticsNode, чтобы обеспечить использование возвращаемых значений. ( I6f86e , b/201652748 ) - Улучшить производительность процесса захвата контента ( I3c7c0 )
- Введен
CompositionLocal, который можно использовать для изменения кисти подсветки успешного заполнения Autofill. ( I52329 ) - Представлен новый интерфейс Interpolatable, который позволяет автоматически интерполировать различные типы, предполагая, что один тип умеет преобразовывать другой. Этот интерфейс используется в нескольких типах компоновки, таких как Brush и Shape, но может использоваться и извне. ( I58eab )
- Теперь Scrollable лучше поддерживает двумерные события прокрутки колесика мыши. Добавлен новый тестовый API для тестирования вариантов использования в
MouseInjectionScope. Мы также добавили новую перегрузку для методов прокрутки вMouseInjectionScopeи флаг для управления новым поведением —isMouseWheel1DAxisLockingEnabled( I136df ). - Добавьте
DeviceConfigurationOverridesдля типа и состояния клавиатуры, типа и состояния навигации, состояния сенсорного экрана и типа режима пользовательского интерфейса ( I282f0 ). - Добавлен новый режим
LineHeightStyle.Modeпод названиемTight. Этот режим помогает добиться меньшей высоты строк, даже если это может привести к обрезанию более высоких глифов. ( Id3849 ) -
BaselineShiftтеперь имеет значение Unspecified, что позволяет избежать упаковки.BaselineShift,Hyphens,LineBreak,TextAlignиTextDirectionтеперь имеют вспомогательные функцииisSpecifiedHyphens,TextAlign,TextDecorationиTextDirectionтеперь имеют методыvalueOf()и value, что позволяет эффективно сериализовать/десериализовать. ( I8d44c ) - Добавлен новый интерфейс метода
getDisplayName, позволяющий настраивать отображаемые имена для экземпляров параметров предварительного просмотра. ( I19bdf , b/241699422 ) - При сравнении значений Dp с Unspecified с использованием операторов «меньше» или «больше» теперь всегда возвращается значение «false». Использование
Dp.compareTo(Unspecified)всегда возвращает 0. Установка флагаComposeUiUnitFlags.isDpCompareToChangedв значение «false» вернётDp.compareTo()к прежнему поведению, при котором сравнение Unspecified с операторами «меньше» и «больше» не всегда возвращало значение «false», аcompareTo()с Unspecified соответствует поведениюFloat.compareTo(). ( Ifa88b , b/429221319 )
Исправления ошибок
- Перемещение minSdk по умолчанию из API 21 в API 23 ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
- Исправлена ошибка, из-за которой не создавалось новых
AndroidComposeViewsво время перехода. ( I2e23e , b/340894487 , b/287484338 ) - Исправлена ошибка цвета при использовании векторного рисунка, использующего один цвет, а
fillColorне является ни полностью непрозрачным, ни полностью прозрачным. ( I3b041 , b/328677973 ) - Исправлена ошибка, из-за которой значки, загруженные через
painterResourceс цветами, специфичными для темы, не обновлялись при изменении темы. ( I85ea0 , b/424416571 ) - Введение в семантику
onFillDataиfillableData( I45d9e ) - Платформо-специфичное кодирование состояния теперь всегда включено в
StateRestorationTester. Это согласует поведение теста с реальным восстановлением состояния приложения, например, с Parcelization на Android. ( I38211 , b/408154192 , b/382294247 ) - Исправлены случайные сбои при запросе фокуса. ( 57b31a11 , b/431111149 )
Версия 1.9
Версия 1.9.0
13 августа 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0 . Версия 1.9.0 содержит следующие коммиты .
Важные изменения с версии 1.8.0
- Важные изменения в версии 1.9.0 описаны в этой записи блога.
- Для проверок lint, поставляемых вместе с Compose, теперь требуется версия AGP не ниже 8.8.2. Если вы не можете обновить AGP, вы можете обновить Lint самостоятельно, указав
android.experimental.lint.version=8.8.2(или более новую версию) в файлеgradle.properties. Для запуска проверок lint Compose в среде IDE требуется Android Studio Ladybug или более новая версия.
Версия 1.9.0-rc01
30 июля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-rc01 . Версия 1.9.0-rc01 содержит следующие коммиты .
Исправления ошибок
- Исправлена ошибка, из-за которой значки, загруженные через
painterResourceс цветами, специфичными для темы, не обновлялись при изменении темы системы. ( I85ea0 , b/424416571 ) - Исправлены ошибки в API 21 (Lollipop) и 28 (Pie), из-за которых важные графические методы были переименованы в процессе оптимизации. ( Iebf99 , b/425120571 , b/420462749 )
- Убедитесь, что вновь вставленные модификаторы
onLayoutRectChangedвызываются изначально. ( l9aa91 ), ( lb348a ) - Исправлена ошибка, из-за которой кэш смещения некорректно становился недействительным, что приводило к вызову модификаторов
onLayoutRectChangedс неправильными координатами ( ibd4cd ), ( lddc57 ) - Исправлена ошибка, из-за которой повернутые/перекошенные макеты получали неверные координаты с помощью модификаторов
onLayoutRectChanged( lddc57 , b/426750475 )
Внешний вклад
- Исправлена ошибка, из-за которой элементы
dragAndDropSourceвLazyListисчезали при прокрутке. Спасибо, Виктор Рендина! ( dc3bcd3 , b/425894792 )
Версия 1.9.0-beta03
16 июля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-beta03 . Версия 1.9.0-beta03 содержит следующие коммиты .
Исправления ошибок
- Исправлена ошибка, из-за которой равномерно размытые внутренние тени не перемещались правильно при смещении.
Версия 1.9.0-beta02
2 июля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-beta02 . Версия 1.9.0-beta02 содержит следующие коммиты .
Изменения API
- Изменяет сопутствующий объект на экспериментальный для соответствия классу. ( I8452a )
- Удален экспериментальный флаг
isTrackFocusEnabled( I003fd ).
Исправления ошибок
- Если ни один
WindowInsetsне проникает в содержимоеComposeView, значенияWindowInsetsRulersне предоставляются. ( I71221 )
Версия 1.9.0-beta01
18 июня 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-beta01 . Версия 1.9.0-beta01 содержит следующие коммиты .
Изменения API
- Изменен
ShadowContextна герметичный интерфейс ( I3ce40 ). - Добавляет межмодульный способ создания события косвенного касания (для тестирования) ( I22e4c )
- Делает
IndirectTouchEvent.nativeEventэкспериментальным. ( I6fda5 ) - Пересматривает API-интерфейс на основе отзывов совета API. ( Ibf378 )
- Удалить константу
FrameRateCategory.NoPreference. ПереименоватьModifier.requestedFrameRateвModifier.preferredFrameRate. ( I2f976 ) -
WindowInsetsRulers: значениеrulersIgnoringVisibilityизменено на максимальное. ФункцияgetDisplayCutoutBounds()теперь является функцией расширенияPlacementScope.WindowInsetsAnimationPropertiesизменена наWindowInsetsAnimation, аgetAnimationProperties()— наgetAnimation(). ( I3816f ) - Изменен класс
ShadowParamsнаShadow( I11cca ) - Измените пакет для API частоты кадров с
androidx.compose.ui.uiнаandroidx.compose.ui( I8994e ) - Изменён
InsetsRulers, чтобы он находился в общем коде с именемWindowInsetsRulers. API упрощён, теперь все вставки являютсяWindowInsetsRulers. Свойства анимации, не относящиеся к линейкам, извлечены в классAnimationProperties. Для объединения нескольких классовWindowInsetsRulersможно использоватьWindowInsetsRulers.innermostOf(). ( I2f0c6 , b/415012444 ) - Добавлен инструментальный API для анализа исходной информации, добавленной компилятором Compose. ( Iceaf9 , b/408492167 )
Исправления ошибок
- Флаг
isGetFocusedRectReturnEmptyEnabledбыл удален, поскольку эта функция полностью проверена. ( Ife722 ) - Исправлена ошибка в
performScrollToNode, из-за которой в некоторых случаях не достигался целевой узел. Благодаря этому исправлению в таких случаях целевой узел должен достигаться всегда. Побочным эффектом этого изменения является то, что точное положение прокрутки в конце действия теперь может отличаться, что влияет на тесты скриншотов и тесты, предполагающие точное положение прокрутки. ( I2c8a1 )
Версия 1.9.0-альфа04
4 июня 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-alpha04 . Версия 1.9.0-alpha04 содержит следующие коммиты .
Изменения API
- Добавлены API-интерфейсы модификаторов для настраиваемых теней. ( I2058d , b/160665122 )
- Добавьте свойство
SemanticsModifierNode.isImportantForBounds, которое определяет, следует ли учитывать узел при вычислении границ. Свойство имеет значение true по умолчанию и может быть установлено в false, чтобы указать, что узел не следует учитывать при вычислении границ. ( I7ebec ) - Добавьте фабричную функцию
SemanticsPropertyKeyдля объявления свойств семантики, специфичных для Android, которые становятся доступными как дополнительные возможности доступа черезAccessibilityNodeInfo.getExtras. ( I2ed51 ) - Удалены все использования
ComposeUiFlags.isRemoveFocusedViewFixEnabledи этот флаг объявлен устаревшим. ( I50328 ) - Представлен новый настраиваемый фреймворк для построения теней. Он включает
DropShadowPainterиInnerShadowPainter, а также зависимостиDropShadow/InnerShadow. Инфраструктура построения теней является общей, что позволяет использовать одни и те же сгенерированные тени в нескольких точках вызова без необходимости их повторной генерации n раз. ( I24f7a , b/160665122 ) - Представлены
CompositeShaderиCompositeShaderBrush, создающие комбинированный результат двух шейдеров. Также добавленShaderBrush#transformдля задания матрицы преобразования для шейдера. ( I2621a , b/160665122 )
Исправления ошибок
- Исправлена ошибка в
NestedScrollInteropConnection, из-за которой методы fling располагались в неправильном порядке относительно представлений. ( I56ad4 ) - Ранее диалоговые окна, отображавшиеся на весь экран, не отображались в области выреза экрана. Эта ошибка исправлена, и теперь диалоговые окна с параметрами
decorFitsSystemWindows = falseиusePlatformDefaultWidth = falseмогут отображать область выреза экрана. ( I9e975 ) - Исправлена ошибка, из-за которой зеленый индикатор фокуса
TalkBackне отображался после включения, когда приложение Compose работало в фоновом режиме. ( Ifd12a )
Версия 1.9.0-альфа03
20 мая 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-alpha03 . Версия 1.9.0-alpha03 содержит следующие коммиты .
Изменения API
- Флаг
ComposeUiFlags.isGetFocusedRectReturnEmptyEnabledпозволяет при отсутствии фокусируемого элементаComposeViewустанавливать прямоугольник в значение Empty. Это предотвращает выбор объекта View при поиске фокуса. Это особенно важно, когда редактор метода ввода (IME) имеет параметр NEXT, при котором он может попытаться сфокусироваться наComposeView, аrequestFocus()завершится неудачей. ( Ibd0e2 , b/369256395 ) - Ввести флаг
isNestedScrollDispatcherNodeFixEnabled. ( I0d24a ) - Переименуйте
dialogContentTitleвDialogPropertiesвwindowTitle( Ibd27b ) - Были введены модификаторы
Modifier.onFirstVisibleиModifier.onVisibilityChanged— высокоуровневые модификаторы, построенные на основеModifier.onLayoutRectChanged. Эти модификаторы специально разработаны для решения множества распространённых задач приложений, таких как регистрация показов, автоматическое воспроизведение видео и т. д. Они разработаны с учётом производительности, чтобы их можно было использовать в критически важных сценариях со списками без риска снижения производительности прокрутки. Помимо этих API модификаторов, были добавлены дополнительные API дляRelativeLayoutBoundsдля поддержки этих вариантов использования, а также для упрощения разработчиками создания аналогичных пользовательских модификаторов, точно соответствующих их задачам. ( I759b8 ) - Измените
setDiagnosticStackTraceEnabledна экспериментальный, чтобы учесть будущую разработку этой функции. ( I11db3 ) - Представлены
Modifier.scrollable2D,Scrollable2DStateи сопутствующие API для создания состояний. Также представлены общие функции расширения прокрутки. ( Ic61c8 , b/214410040 ) - 64-битные цветовые значения Compose нельзя напрямую сравнивать с цветовыми пространствами Android
ColorLongs, поскольку для некоторых цветовых пространств идентификаторы цветовых пространств не упорядочены. Для преобразования в цветовые пространства Android и обратно добавлены два новых API:toColorLong()иfromColorLong(). ( I36899 ) - Введен
ViewConfiguration.minimumFlingVelocityдля управления нижней границей скорости подбрасывания. ( I11aab )
Версия 1.9.0-альфа02
7 мая 2025 г.
Выпущен androidx.compose.ui:ui-*:1.9.0-alpha02 . Версия 1.9.0-alpha02 содержит следующие коммиты .
Изменения API
- Добавьте
dialogContentTitleвDialogProperties, который задает заголовок окна содержимого. bf9d670
Исправления ошибок
- Линейки вставок окон временно отключены, пока внутренние тесты исправляются. 8d1402
- Исправлено, как изменения ввода указателя добавляются в
VelocityTrackerвDragGestureNode. Это можно контролировать с помощью нового флагаisAdjustPointerInputChangeOffsetForVelocityTrackerEnabled. 254ddb
Версия 1.9.0-альфа01
23 апреля 2025 г.
Выпущен androidx.compose.ui:ui-*: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 или более новая версия.
Изменения API
- Удаляет флаг, позволяющий выполнять трассировку операторов для отслеживания пути попадания (отладка). ( I1b2a1 )
- Изменены методы
InnerRectRulersиOuterRectRulesна методы. Удалён параметр name из публичного APIRectRulers.DerivedRulersтеперь является параметром конструктора для вертикальных и горизонтальных линеек.MergedHorizontalRulersиMergedVerticalRulersзаменены методамиminOfиmaxOfдля генерации экземпляров. ( Iee89f , b/408192133 ) - Отменить
androidx.compose.ui.LocalSavedStateRegistryOwnerв пользуandroidx.savedstate.compose.LocalSavedStateRegistryOwner. ( I5439f , b/377946781 ) - Добавьте
Modifier.keepScreenOn, чтобы дисплей не переходил в спящий режим во время присутствия ( Ib5af4 , b/408284174 ) - Добавить новое семантическое свойство
Shape, которое может быть задано, когда форма элемента пользовательского интерфейса отличается от его ограничивающего прямоугольника, например, прямоугольник со скругленными углами. ( I1376f ) - Исправлена проблема с диспетчеризацией событий указателя в
AndroidViewsи добавлен флагisPointerInteropFilterDispatchingFixEnabledдля защиты изменений. ( I0e272 , b/372055500 , b/408002332 ) -
FocusRestorerбольше не закрепляет ранее находившийся в фокусе элемент. Пользователям следует использовать ключ, чтобы убедиться, что ранее находившийся в фокусе элемент имеет тот же хэш состава, что и ранее находившийся в фокусе элемент, и чтобы фокус успешно восстанавливался. ( I4203b , b/330696779 ) - Разрешить Compose вызывать
ViewTreeObserver.OnScrollChanged. Это поведение реализовано с помощью флагаisOnScrollChangedCallbackEnabled. Мы также добавили функцию расширенияDelegatableNode dispatchOnScrollChanged. ( I34b9d , b/238109286 ) - Метод
currentCompositeKeyHashтеперь устарел. Вместо него используйтеcurrentCompositeKeyHashCode. Новый API кодирует тот же хеш с большим количеством бит, что экспоненциально снижает вероятность того, что две случайные несвязанные группы в иерархии композиции будут иметь одинаковый хеш-ключ. ( I4cb6a , b/177562901 ) - Для проектов, выпущенных с использованием Kotlin 2.0, требуется использование KGP 2.0.0 или более поздней версии ( Idb6b5 ).
- Добавлена поддержка проверки линта для
FocusRequester, чтобы убедиться, что он запомнен внутри композиции ( I6bf91 ). - Добавлена возможность устанавливать предпочтительную частоту кадров или категорию частоты кадров для Composable, которая должна отображаться на ( Ie5201 )
- Предоставьте нативный
MotionEventна Android. ( I17286 ) - Добавить
getChecked() + setChecked(int), отменитьisChecked + setChecked(boolean)( Iaac9d ) - Модификатор
graphicsLayerтеперь принимаетblendModeиcolorFilter( Iab0e6 ). - Добавлена локальная композиция
LocalResourcesдля запроса ресурсов. ВызовLocalResources.currentперекомпонует объект при изменении конфигурации, поэтому вызовы API, таких какstringResource()вернут обновлённые значения. ( I50c13 , b/274786917 ) - Предоставить экспериментальный API для Composables для обработки косвенных событий касания ( Icff57 )
- В этом выпуске улучшено оповещение о необработанных исключениях, возникающих на этапах макетирования и отрисовки компонуемого контента. Ранее необработанное исключение приводило к сбою программы выполнения тестов и преждевременному завершению набора тестов. Теперь эти исключения можно сообщать более корректно, не завершая набор тестов. ( I9928b , b/314128080 )
- Экспериментальный API
GlobalAssertionsобъявлен устаревшим. Он предназначался для проверки доступности, для этого см.enableAccessibilityChecks(). ( I50aa5 ) -
SemanticsNodeInteraction.performTextInputSelectionбольше не является экспериментальным и теперь поддерживает дополнительный параметрrelativeToOriginal, который позволяет применять выделение либо к исходному непреобразованному тексту, либо к преобразованному тексту. ( I3a905 , b/261561038 , b/277018945 ) - Представить API для создания пользовательских маркированных списков через
AnnotatedString( I1d066 , b/383269496 , b/139326648 ) - Отменить использование
runWithTimingDisabledв пользуrunWithMeasurementDisabled, который более чётко описывает поведение — все метрики приостанавливаются. Кроме того, предоставить доступ к суперклассуMicrobenchmarkScope, поскольку повторное объявление функцииrunWithMeasurementDisabledдля открытия доступа невозможно, так как она встроена. ( I9e23b , b/389149423 , b/149979716 ) - Обновлен API устройств ui-tooling для включения новых устройств. ( Ia2ac1 )
- Добавить планшетный портрет в коллекцию размеров экрана предварительного просмотра, чтобы помочь разработчику учитывать большие окна ( Ia1976 )
- Представляем API для отслеживания значений, позволяющее маркировать/регистрировать значения в заданный момент времени. Значения отображаются в Prefetto в виде новой полосы, которую можно просматривать на временной шкале отслеживания. На Android это реализовано с помощью
Trace.setCounter. ( Idcf48 )
Исправления ошибок
- Исправлена отправка наблюдателей запоминания в приостановленной композиции, чтобы избежать отправки запомненных/забытых в том же применении ( I570b2 , b/404645679 , b/407931790 ).
-
android:dialogThemeтеперь можно настроить для управления свойствами диалогового окна, когдаdecorFitsSystemWindowsимеет значение false ( I7922f , b/246909281 ) - Исправлена ошибка, из-за которой любое событие движения, обнаруженное за пределами диалогового окна, могло привести к закрытию диалогового окна. ( Ia78fd )
- Для проверки lint в Compose теперь требуется AGP версии не ниже 8.8.2 из командной строки и как минимум Android Studio Ladybug для поддержки IDE. Если вы используете более старую версию AGP, вы можете установить
android.experimental.lint.version=8.8.2в gradle.properties, чтобы обновить версию Lint, не затрагивая AGP. ( I6f2a8 ) - Добавлено новое семантическое свойство
InputText, которое фиксирует значениеtextfieldперед применением преобразования вывода. ( Iae46a , b/395911609 , b/176949051 ) - Перемещен API
enableAccessibilityChecks(), который включает проверки доступности для Android, для разделения пакетовcompose:ui:ui-test-accessibilityесли вы не используетеTestRule, иcompose:ui:ui-test-junit4-accessibilityпри вызовеTestRule( I3c318 , b/391560768 ). - Добавлена поддержка трассировок стека компоновки в
LaunchedEffectиrememberCoroutineScope( I705c0 , b/354163858 ).
Внешний вклад
- Изменена экспериментальная функция
runComposeUiTestдля принятия блока приостановки. Также добавлена устаревшая функцияrunComposeUiTestдля обеспечения двоичной совместимости ( I3b88c , b/361577328 ).
Версия 1.8
Версия 1.8.3
18 июня 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.3 . Версия 1.8.3 содержит следующие коммиты .
Исправления ошибок
- Флаг
isGetFocusedRectReturnEmptyEnabledбыл удален, поскольку эта функция полностью проверена. ( Ife722 ) - Флаг
ComposeUiFlags.isGetFocusedRectReturnEmptyEnabledпозволяет при отсутствии фокусируемого элементаComposeViewустанавливать прямоугольник в значение Empty. Это предотвращает выбор объекта View при поиске фокуса. Это особенно важно, когда редактор метода ввода (IME) имеет параметр NEXT, при котором он может попытаться сфокусироваться наComposeView, аrequestFocus()завершится неудачей. ( Ibd0e2 , b/369256395 )
Версия 1.8.2
20 мая 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.2 . Версия 1.8.2 содержит следующие коммиты .
Исправления ошибок
- Исправлена ошибка NPE при удалении диалога во время активного потока событий в диалоге ( 6a7e7f ).
- Исправлена ошибка, из-за которой
onLayoutRectChangeне обновлялся в соответствии с регулируемой временной шкалой при выполнении обновлений только для отрисовки. ( 03b82d )
Версия 1.8.1
7 мая 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.1 . Версия 1.8.1 содержит следующие коммиты .
Исправления ошибок
- Исправлены некоторые проблемы с
onLayoutRectChangedиLazyLayoutd791b11 - Пропускать запросы на повторное измерение для предварительно составленных элементов. Эта ошибка влияла на производительность прокрутки ленивых макетов, поскольку в некоторых случаях предварительная выборка работала неэффективно, а измерение происходило внутри кадра. 742087a
Версия 1.8.0
23 апреля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0 . Версия 1.8.0 содержит следующие коммиты .
Важные изменения с версии 1.7.0
- В Compose 1.8 добавлена поддержка семантического автозаполнения. Убедитесь, что используемые вами версии UI и Foundation — 1.8 или выше, так как для автозаполнения текстовых компонентов требуются последние версии обоих модулей. Подробнее об использовании API и примерах автозаполнения см. в документации по автозаполнению здесь .
- Compose 1.8 поддерживает дополнительные типы тактильной обратной связи:
Confirm,ContextClick,GestureEnd,GestureThresholdActivate,Reject,SegmentFrequentTick,SegmentTick,ToggleOn,ToggleOffиVirtualKey. Доступ к ним осуществляется черезLocalHapticFeedback, а на Android они доступны по умолчанию, если API Vibrator поддерживает тактильную обратную связь. - Несколько API фокусировки теперь стабильны, включая
Modifier.focusRestorer(), а такжеonEnterиonExitFocusProperties( I6e667 ). Теперь вы можете указатьFocusDirectionпри вызовеrequestFocus. Мы добавили APIrequestFocus(FocusDirection)вfocusRequesterиFocusTargetModifierNode, чтобы фокусировка в заданном направлении. (I5d9ec][https://android-review.googlesource.com/#/q/I5d9eca3a2cd283c1b84ad6b77d929ef9a49ce4cc], b/245755256 )
Версия 1.8.0-rc03
9 апреля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-rc03 . Версия 1.8.0-rc03 содержит следующие коммиты .
Исправления ошибок
- Отключает некоторые исправления взаимодействия фокуса, которые вызывали регрессию. ( b9d998 , b/369256395 , b/378570682 , b/376142752 , b388590015/ , b/389994198 , b/391378895 )
Версия 1.8.0-rc02
26 марта 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-rc02 . Версия 1.8.0-rc02 содержит следующие коммиты .
Исправления ошибок
- Исправлена ошибка, из-за которой сфокусированные представления, встроенные в иерархию Compose, вызывали повторную композицию при удалении сфокусированного представления из ленивого списка. ( 765562 )
Версия 1.8.0-rc01
12 марта 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-rc01 . Версия 1.8.0-rc01 содержит следующие коммиты .
Исправления ошибок
- Исправлен сбой, возникающий при удалении активного
AndroidViewпри активной экранной клавиатуре. ( Ic725a ) - Исправлено несколько проблем в новой реализации обработки состояния фокуса. ( b/395895685 )
- Исправлена проблема, блокирующая автозаполнение при использовании
LaunchedEffectдля запроса фокуса на текстовом поле. ( b/392539099 )
Версия 1.8.0-beta03
26 февраля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-beta03 . Версия 1.8.0-beta03 содержит следующие коммиты .
Изменения API
- Перемещен API
enableAccessibilityChecks(), который включает проверки доступности для Android, для разделения пакетовcompose:ui:ui-test-accessibilityесли вы не используете TestRule, иcompose:ui:ui-test-junit4-accessibilityпри вызовеTestRule( I547ef , b/391560768 ). - Добавлено новое семантическое свойство
InputText, которое фиксирует значение текстового поля перед применением преобразования вывода. ( Iae46a )
Исправления ошибок
- Исправлена ошибка, из-за которой службы автозаполнения сохраняли преобразованный выходной текст вместо входного текста. ( Iae46a , b/395911609 , b/176949051 )
Версия 1.8.0-beta02
12 февраля 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-beta02 . Версия 1.8.0-beta02 содержит следующие коммиты .
Новые функции
- Добавлена проверка lint для предупреждения о вызовах
Configuration#screenWidth/heightDp— вместо этого можно использоватьLocalWindowInfo.current.containerSizeдля получения текущего размера окна.
Версия 1.8.0-beta01
29 января 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-beta01 . Версия 1.8.0-beta01 содержит следующие коммиты .
Изменения API
-
ContextualFlowRowиContextualFlowColumnотмечены как устаревшие. Этот экспериментальный компонент был представлен в версии 1.7 и ещё не стабилизирован, а его реализация признана нежелательной. В будущем может быть представлен компонент, решающий те задачи, для которых он изначально и предназначался.-
FlowRowиFlowColumnимеют экспериментальные перегрузки, представленные в версии 1.7, которые включают параметрoverflow. Использование этого параметра устарело, и вместо него можно использовать перегрузки без этого параметра. Поведением переполнения по умолчанию для этих перегрузок будет «Clip», как и с момента их появления. - Многие сценарии использования
ContextualFlowRowмогут быть реализованы с помощью FlowRow, но мы признаем, что это не совсем так.ContextualFlowRowполностью реализуем в пользовательском пространстве, и можно попытаться скопировать его реализацию и адаптировать при необходимости. В будущем мы надеемся решить эти задачи другим способом. ( Ibafec )
-
-
SemanticsNodeInteraction.semanticsId()был удалён. Вместо него используйтеSemanticsNodeInteraction.fetchSemanticsNode().id. ( Ie397a ) - Старые API автозаполнения устарели. Вместо них используйте новый API, основанный на семантике. ( I943ff )
- Переписать API
requestAutofillтак, чтобы он существовал вне менеджера автозаполнения. ( Id1929 )
Исправления ошибок
- Исправлена проблема с фокусом, из-за которой
requestFocus()с бессмысленным параметромpreviouslyFocusedRect(связанным с направлением фокуса) пропускалComposeView. ( Ifdc2f , b/388590015 ) - Исправлена случайная ошибка NPE при использовании
GraphicsLayer.record { this@ContentDrawScope.drawContent() }. Если вы записываетеdrawContent()таким способом, обязательно используйте функцию расширенияGraphicsLayer#recordвнутриDrawScope, а не функцию-членGraphicsLayer. ( I75fc0 , b/389046242 ) - Исправлена ошибка с многоточием в текстовом макете, которая иногда неправильно переводилась во время анимации. Подробнее см. b/389707025 ( Ie55b1 , b/389707025 ).
Версия 1.8.0-альфа08
15 января 2025 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-alpha08 . Версия 1.8.0-alpha08 содержит следующие коммиты .
Изменения API
- Создание абстрактного класса
AutofillManager. ( I0a3b0 ) - Исправлено несколько проблем, связанных с фокусом, включая сбои, когда IME пытается сфокусироваться на
ComposeViewбез фокусируемых элементов, изменение фокуса внутри дочернихAndroidViewsи запрос фокуса, выходящий за пределыAndroidView. ( Ia03c3 , b/369256395 , b/378570682 , b/376142752 ) - Измените
FocusEnterExitScope.cancelFocus()наcancelFocusChange()( I89959 ) - Теперь вы можете рассчитывать составные окклюзии с помощью
RectInfo.calculateOcclusions(). - Добавлена функция расширения в
DelegatableNodeдля регистрации прослушивателя глобальных изменений макета. ( I68b59 )
Исправления ошибок
- Активность, которая используется в качестве хоста для тестируемого компонуемого объекта при использовании
ComposeContentTestRule.setContent, теперь использует темуTheme.Material.Light.NoActionBar, чтобы избежать перекрытияActionBarс тестовым содержимым при использовании SDK 35. Чтобы отказаться от этого поведения, можно удалить зависимость отui-test-manifestи добавить запись активности в AndroidManifest.xml вашего тестового приложения дляComponentActivityс темой по вашему выбору. ( I7ae1b , b/383368165 ) - Шрифты ресурсов с одинаковыми настройками вариации теперь будут избегать чрезмерного кэширования, приводящего к применению неверных настроек вариации. ( If3dff , b/372044241 )
-
AnnotatedString.fromHtmlтеперь поддерживает теги<ul>/<li>. ( I7c2fe , b/299662276 , b/139326648 )
Внешний вклад
- Добавлен новый интерфейс буфера обмена и локальная композиция для него. ( I80809 )
Версия 1.8.0-альфа07
11 декабря 2024 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-alpha07 . Версия 1.8.0-alpha07 содержит следующие коммиты .
Изменения API
- Выставлен владелец из
LayoutNodeдля инструментов. ( I26f7f ) - Имеет композицию
LocalAutofillHighlightColor, локально использующую тип Color. ( I0e05b ) - Сохранить устаревший
UrlAnnotationи его методы, отмеченные как экспериментальные. ( Ic0021 )
Исправления ошибок
- Исправлен сбой
IndexOutOfBoundsExceptionпри использованииLinkAnnotationвнутриBasicTextили Text composable ( be7605 , b/374115892 ). - Исправлена ошибка, из-за которой заполненные текстовые поля с пользовательской формой не обрезали линию индикатора. ( I4f87f , b/380704151 )
- Исправлено отсутствие фонов на длинных скриншотах. ( I4d57a )
- Эта библиотека теперь использует аннотации JSpecify, определяющие значение null , которые являются типовыми. Разработчикам Kotlin следует использовать следующий аргумент компилятора для обеспечения корректного использования:
-Xjspecify-annotations=strict(это значение по умолчанию, начиная с версии 2.1.0 компилятора Kotlin). ( Idfef8 , b/326456246 ) - Обновление поддержки Compose для цветов широкого охвата и HDR при работе на Android Q+. ( Icd8be , b/379135036 )
- Шрифты ресурсов, которые не удалось загрузить, теперь будут автоматически возвращаться к шрифту по умолчанию вместо прежнего поведения, когда в мере возникало исключение. ( Ib6a49 )
- Исправлена проблема с потерей фокуса при отсоединении и присоединении
AndroidView. ( I53446 ) - Принять
requestFocus()из действия, выходящего за пределы границ макета. ( Ia8461 )
Внешний вклад
- Добавьте
BringIntoViewResponderModifierNodeв пользовательский интерфейс, что обеспечит новый способ реализации функциональности Bring Into View, а также позволит реализовать ее на уровне платформы. ( Ia6dd8 )
Версия 1.8.0-альфа06
13 ноября 2024 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-alpha06 . Версия 1.8.0-alpha06 содержит следующие коммиты .
Изменения API
- Добавляет модификатор
stylusHoverIcon. ( Iff20a , b/331289114 ) - Изменяет менеджер автозаполнения на интерфейс. ( I84914 , b/376080755 )
- Добавляет
requestFocus(FocusDirection)кfocusRequesterиFocusTargetModifierNode, чтобы разрешить фокусировку в определенном направлении. ( I5d9ec , b/245755256 ) -
FocusProperties.enterиFocusProperties.exitбыли заменены наonEnterиonExit, использующие область действия приемника вместо параметраFocusDirection. ( I6e667 ) - Добавление поддержки автозаполнения на панель инструментов текста. ( Ie6a4c )
- Изменения API в
Modifier.focusRestorer()( I99c03 ):- Имя параметра изменено на «fallback»
- параметр теперь является
FocusRequester, а не лямбда - параметр теперь не равен NULL, а Default является значением по умолчанию
- Удаляем аннотацию
@Experimentalиз интерфейса менеджера автозаполнения. Эта функция всё ещё находится в разработке и нацелена на этот релиз, но мы не планируем вводить API @Expemiental ( Id8398 ). -
LocalHapticFeedbackтеперь предоставляет реализациюHapticFeedbackпо умолчанию, когда API Vibrator указывает на поддержку тактильных сигналов. В типHapticFeedbackTypeдобавлены следующие элементы:Confirm,ContextClick,GestureEnd,GestureThresholdActivate,Reject,SegmentFrequentTick,SegmentTick,ToggleOn,ToggleOffиVirtualKey. Компоненты Wear Compose, поддерживающие долгое нажатие, такие какButton,IconButton,TextButtonиCardтеперь выполняют тактильные сигналыLONG_PRESSпри наличии обработчика долгого нажатия. ( I5083d ) - Удаляет
OverscrollConfigurationиLocalOverscrollConfigurationи добавляетrememberPlatformOverscrollFactoryдля создания экземпляра/настройки параметров реализации overscroll по умолчанию. Чтобы отключить overscroll, вместоLocalOverscrollConfiguration provides null, используйтеLocalOverscrollFactory provides null. Чтобы изменить цвет свечения/отступ, вместоLocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding)используйтеLocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding). ( Ie71f9 , b/255554340 , b/234451516 ) - Удалён экспериментальный API
GlobalAssertions. Он предназначался для проверки доступности, для этого см.enableAccessibilityChecks(). ( I59322 )
Версия 1.8.0-альфа05
30 октября 2024 г.
Выпущен androidx.compose.ui:ui-*:1.8.0-alpha05 . Версия 1.8.0-alpha05 содержит следующие коммиты .
Новые функции
Автозаполнение выставлено за флагом функций в этом выпуске. Мы работаем над повышением производительности и ищем ранние отзывы об API. Ожидается, что API будут развиваться до стабильной на основе обратной связи.
- Чтобы включить автозаполнение, установите
ComposeUiFlags.isSemanticAutofillEnabled, чтобы True вonCreateи используйте новейший снимок Compose. - Эта версия автозаполнения поддерживает сохранение учетных данных вручную, посредством предложения сильного пароля и навигации. Он также поддерживает заполнение, когда автоматическое поле получает фокус или когда автозаполнение запускается через панель инструментов текста на текстовых компонентах. Компонент станет выделенным, чтобы указать, когда AutoBill завершится.
Изменения API
- Измените интерфейс автозаполнения, чтобы следить за
expect/actualструктуры. ( I22dce ) - Введите
CompositionLocal, который можно использовать для изменения оттенка успешного заполнения AutoFill. ( I32092 ) - Добавлен
Modifier.onRectChangedAPI, который представляет собой API, который позволяет подписаться на положение корня/окна/экрана, а также размерLayoutNode. API решает множество вариантов использования, которые существующий модификаторonGloballyPositionedделает, однако он делает это с гораздо меньшим количеством накладных расходов, и API поставляется с средствами для отступления и снижения обратного вызова, что требует случая использования. ( ID28C7 , B/372765423 , B/372757007 , b/372994338 ) - Расширяет AUTOFILL Manager, чтобы включить API
commit()иcancel(), которые помогают пользователям сохранять вновь введенные учетные данные. ( I2da00 ) - Представляет новый интерфейс
AutofillManager, который можно использовать для автоматической настройки пользователей и флагаisSemanticAutofillEnabledдля включения этой новой версии AutoBill. ( I9d484 ) - Добавлен
Modifier.onRectChangedAPI, который представляет собой API, который позволяет подписаться на положение корня/окна/экрана, а также размерLayoutNode. API решает множество вариантов использования, которые существующий модификаторonGloballyPositionedделает, однако он делает это с гораздо меньшим количеством накладных расходов, и API поставляется с средствами для отступления и снижения обратного вызова, что требует случая использования. ( I3c8fa ) - Добавьте семантические свойства и типы данных для расширенной поддержки автозаполнения. ( I52c7d )
- Все методы в
AnnotatedStringBuilder теперь не экспериментальны ( IA89C8 , B/261561823 )
Исправления ошибок
- Просмотры, встроенные в Compose, теперь могут получать роторные события, если они сосредоточены ( i4d53a , b/320510084 )
- Исправлена проблема, в которой различные типы ресурсов не будут обновлять изменения конфигурации ( IA9B99 , B/352336694 )
- Решение проблемы, которая не позволяла правильно функционировать
TextFieldпри использовании японской клавиатуры Pobox на определенных старых устройствах Sony. ( IA9B99 , B/373743376 ) - Исправлена проблема с диалогами, показывающими внизу экрана вместо центрирования ( IA2EC , B/373093006 )
- Целевая API 35+ больше не заставляет диалогов, чтобы
decorFitsSystemWindowsустанавливались в False. ( IBC94 , B/364492593 ) - Исправьте сбой при перемещении слоев между Windows (например, диалогом и основным контентом) ( i675ba , b/330955281 )
Версия 1.8.0-альфа04
16 октября 2024 г.
androidx.compose.ui:ui-*:1.8.0-alpha04 выпускается. Версия 1.8.0-Alpha04 содержит эти коммиты .
Изменения API
- Добавляет
DelegatableNode#onDensityChangeиDelegatableNode#onLayoutDirectionChangeобратные вызовы, чтобы разрешить обновление состояния узла при их изменении ( i04f3e , b/340662451 ) - Добавляет
WindowInfo#containerSize, чтобы обеспечить размер контейнера содержимого текущего окна. Это можно получить с помощьюLocalWindowInfo. ( IDC38C , B/369334429 , B/360343819 ) - Введите исправление для вложенных прокрутки, которые удаляются из дерева узлов во время продолжающегося броска. Теперь эти узлы отменит фринг и правильно отправят событие
onPostFlingс оставшейся скоростью. Мы также представляем флагNewNestedScrollFlingDispatchingEnabled, чтобы контролировать поведение в случае регрессии. Флаг будет удален до бета. ( I05C37 , B/371168883 ) - Введен
PointerInputModifierNode#touchBoundsExpansion, который можно использовать для увеличения сенсорных границ одного модификатора ввода указателя. ( ICCF02 , B/335339283 ) - Добавляет
WindowInfo#containerSize, чтобы обеспечить размер контейнера содержимого текущего окна. Это можно получить с помощьюLocalWindowInfo. ( I27767 , B/369334429 , B/360343819 ) - Удалите
readOnlyизTextFields', чтобы прикреплять к стабильной версии фундамента. ( I3aaba ) -
ParagraphиParagraphIntrinsicsтеперь снимают список всех аннотаций, применяемых кAnnotatedString, ранее у него был только списокSpanStyles( I12F80 )
Исправления ошибок
- Обновлено, как параграфы обрабатываются в
AnnotatedString. Прежде чем вы сможете создать только непересекающиеся абзацы. ТеперьAnnotatedStringпозволяет полностью перекрывать абзацы, которые будут объединены вместе, и вложенные абзацы, и в этом случае внешний абзац будет разделен на границы внутреннего, а стиль внутреннего абзаца будет объединен со стилем внешнего абзаца ( IC9554 ) - Исправьте сбой в
AnnotatedStringLinkAnnotationдо длины. ( 89AAC6 )
Версия 1.8.0-альфа03
2 октября 2024 г.
androidx.compose.ui:ui-*:1.8.0-alpha03 выпускается. Версия 1.8.0-Alpha03 содержит эти коммиты .
Изменения API
- Обновление версии Kotlin до 1.9 ( I1A14C )
- Представил новую семантическую роль под названием Carousel для подражания поведению списка в пейджерах для A11Y Services. ( ID354B , B/354109776 , B/239672673 )
- Переименовать
invisibleToUser(), чтобыhideFromAccessibility. Его функция остается прежней. Смотрите документацию для более подробной информации. ( IB43A3 )
Исправления ошибок
- Обновление документов для модификатора
SensitiveContent( IB0442 ) - Фиксированная проблема, где определенные общие схемы будут игнорироваться в сочетании с тени высоты на некоторых версиях Android
- Фиксированная проблема, в которой будут применены пустые зажимы, когда были указаны общие наброски клипов на определенных версиях Android.
- Исправлено исключение, брошенное, когда IME активен на внешнем представлении, и следующее действие используется для введения фокуса на
ComposeView. ПоведениеclearFocus()совпадает с поведением представления на API <28, гдеclearFocus()может привести к сфокусированию представления по умолчанию. - Исправлена проблема, где место размещение произошло на отдельных узлах у
LazyList, разделяя управление подкомпозицией для различных проходов макета. - Исправлена проблема, когда программная клавиатура мерцает, когда фокус переключается с
TextFieldнаEditTextили любой другой редактор, основанный на представлении. - Вложенные узлы
onPostFlingтеперь будут правильно отправлять события, после того как они будут отстранены. - Общие улучшения производительности
Версия 1.8.0-альфа02
18 сентября 2024 г.
androidx.compose.ui:ui-*:1.8.0-alpha02 выпускается. Версия 1.8.0-Alpha02 содержит эти коммиты .
Изменения API
-
TextOverflow.StartEllipsisиTextOverflow.MiddleEllipsis, которые позволяют размещать ellipsis в начале или в середине линии текста одной строки. ( I38913 , B/185418980 )
Исправления ошибок
- Fix Dalog
dismissOnClickoutside( 39A3D , B/364508685 ) - Не обрезайте тени содержимого диалога ( E8E2F , B/363027803 )
- Исправить ошибочное поведение, когда поиск фокуса перемещается между Compose и представлением ( 58377 , B/350534714 )
Внешний вклад
-
MapAlignmentLinesв настоящее время принимаетVerticalAlignmentLineилиHorizontalAlignmentLineтипы бетонных. ( I02912 ) - Новый общий
ByteArray.decodeToImageBitmap(): ImageBitmap. ( I83c21 )
Версия 1.8.0-альфа01
4 сентября 2024 г.
androidx.compose.ui:ui-*:1.8.0-alpha01 выпускается. Версия 1.8.0-Alpha01 содержит эти коммиты .
Версия 1.7
Версия 1.7.8
12 февраля 2025 г.
androidx.compose.ui:ui-*:1.7.8 выпускается. Версия 1.7.8 содержит эти коммиты .
Версия 1.7.7
29 января 2025 г.
androidx.compose.ui:ui-*:1.7.7 выпущен. Версия 1.7.7 содержит эти коммиты .
Исправления ошибок
- Исправлено
IndexOutOfBoundsExceptionпри прохожденииAnnotatedStringстрижки с помощьюLinkAnnotationна композицию текста. ( IC96D2 ) - Исправлена проблема с тайм -аутом в тестах в некоторых редких случаях, когда в
AnnotatedStringиспользуетсяLinkAnnotation. ( I04A03 )
Версия 1.7.6
11 декабря 2024 г.
androidx.compose.ui:ui-*:1.7.6 выпущен. Версия 1.7.6 содержит эти коммиты .
Исправления ошибок
- Ранее мы использовали для выпуска ошибки всякий раз, когда сталкивались с ключевым событием, когда сталкивались с ключевым событием, когда система фокусировки ожидала недействительных. Вместо этого мы регистрируем ошибку ( i7ea0 , b/346370327 ).
- Удаленная экспериментальная аннотация из
SemanticsPropertyReceiver.invisibleToUser(). Это будет устареть в 1,8, чтобы быть заменено наSemanticsPropertyReceiver.hideFromAccessibility(). ( I448f0 , b/376479686 ) - Исправлена проблема, которая предотвратила правильную функционирование
TextFieldпри использовании японской клавиатуры Pobox на определенных старых устройствах Sony. ( I94e0e , b/373743376 ) - Исправлена проблема с доступностью, в которой InlineContent
BasicTextTelect не был объявленTalkBack. ( I67bcb , b/376479686 )
Версия 1.7.5
30 октября 2024 г.
androidx.compose.ui:ui-*:1.7.5 выпускается. Версия 1.7.5 содержит эти коммиты .
Исправления ошибок
- Исправленные проблемы, в которых высота и обрезка с помощью пользовательских схем не будут должным образом отображаться.
- Исправляет текстовое сбое, которое происходит с
LinkAnnotationнулевой ширины. ( IC1E2E ) - Исправляет объявление в
Talkbackof кнопки, когда она построена в качестве композиции для клика, композиционного. ( I1f588 )
Версия 1.7.4
16 октября 2024 г.
androidx.compose.ui:ui-*:1.7.4 выпускается. Версия 1.7.4 содержит эти коммиты .
Версия 1.7.3
2 октября 2024 г.
androidx.compose.ui:ui-*:1.7.3 выпущен. Версия 1.7.3 содержит эти коммиты .
Исправления ошибок
- Исправлена проблема, в которой указание общего схема клипа приведет к пустой границе клипа на определенных версиях Android.
- Исправлено исключение, брошенное, когда IME активен на внешнем представлении, и следующее действие используется для введения фокуса на
ComposeView. ПоведениеclearFocus()совпадает с поведением представления на API <28, гдеclearFocus()может привести к сфокусированию представления по умолчанию. - Исправлена проблема, в которой использовался неверный
placeOrderдля недействительной, что было пропущено на кожух, где было пропущено место для пропускания.
Версия 1.7.2
18 сентября 2024 г.
androidx.compose.ui:ui-*:1.7.2 выпущен. Версия 1.7.2 содержит эти коммиты .
Исправления ошибок
- Улучшенная производительность информации о узле доступности и событий семантики путем удаления словесного отслеживания. ( 189156 , B/362530618 )
-
ComposeViewбольше не будет сбои при прохождении исключительно большого размера измерения ( DA5DB , B/347036173 ) - Исправлена проблема с экраном доступности, в которой объявления
LiveRegionна кнопках не были сделаны. ( F66FA7 , B/348590026 )
Версия 1.7.1
10 сентября 2024 г.
- Нет изменений в артефактах Android. Артефакты
-desktopбыли удалены, и были добавлены артефакты-jvmStubsи-linuxx64Stubs. Ни одна из этих целей не предназначена для использования, они являются заполнителями, чтобы помочь JetBrains составить усилия.
Версия 1.7.0
4 сентября 2024 г.
androidx.compose.ui:ui-*:1.7.0 выпускается.
Важные изменения с версии 1.6.0
Важные изменения в версии 1.7.0 рассматриваются в этом блоге .
Версия 1.7.0-rc01
21 августа 2024 г.
androidx.compose.ui:ui-*:1.7.0-rc01 выпускается. Версия 1.7.0-RC01 содержит эти коммиты .
Заметные изменения
- UI: модуль пользовательского интерфейса теперь подчеркивает требование минимальной версии Foundation: Foundation, по крайней мере, 1,7,0-RC01 или новее. Это применяется для исправления несовместимости поведения между пользовательским интерфейсом и фундаментом в отношении изменений
NestedScrollSource, которые произошли в начале 1,7.0-Alpha01.
Версия 1.7.0-beta07
7 августа 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta07 выпускается. Версия 1.7.0-beta07 содержит эти коммиты .
Исправления ошибок
- Функции
SemanticsNodeInteractionFunctions, связанные с вводом,performTextReplacement,performTextInputиperformTextClearanceтеперь собираются бросить ошибки утверждения, когда они будут вызовом на чтение толькоTextFields. ( I4ae8f )
Версия 1.7.0-beta06
24 июля 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta06 выпускается. Версия 1.7.0-beta06 содержит эти коммиты .
Версия 1.7.0-beta05
10 июля 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta05 выпускается. Версия 1.7.0-beta05 содержит эти коммиты .
Исправления ошибок
- Исправлена ошибка, при которой изменение программного клавиатуры заставит
TextFieldне принимать ввод с новой клавиатуры, пока фокус не будет потерян и не будет восстановлен. - Исправлена проблема, в которой попытки сохранить содержимое слоя вызывают непреднамеренные побочные эффекты при рендеринге с содержанием
SurfaceView.
Версия 1.7.0-beta04
26 июня 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta04 выпускается. Версия 1.7.0-beta04 содержит эти коммиты .
Исправления ошибок
- Измеряйте сбои при измерении очень больших текстовых линий (например, 10K символов) ( 8157ab )
- Отключить поддержку программного рендеринга для API
GraphicsLayer. ( 35dd8 ) - Исправить для сбоя в логике устойчивости слоя. ( 70b13e )
- Повторная оптимизация объектов слоя была возвращена, так как это вызвало проблемы с рендерингом. ( 70b13e )
Версия 1.7.0-beta03
12 июня 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta03 выпускается. Версия 1.7.0-beta03 содержит эти коммиты .
Версия 1.7.0-beta02
29 мая 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta02 выпускается. Версия 1.7.0-beta02 содержит эти коммиты .
Изменения API
- Переименовано
IsEditableSemanticsProperties.EditableСобственность в настоящееisEditableявляется логическим и всегда указываетсяSemanticsPropertyReceiver.editableтекстовые поля. ( I8acd8 ) - Переименовать параметр доступности. ( I3d440 )
- Обновленный API для стиля ссылок:
TextLinkStylesтеперь является частью конструктораLinkAnnotationи методаAnnotatedString.fromHtml( i90b2b ). Также удалилиTextDefaultsиз материала ( i5477b )
Исправления ошибок
- Переименованные
LayoutCoordinates.introducesFrameOfReferencetoLayoutCoordinates.introducesMotionFrameOfReference, чтобы лучше отражать ее цель. Переименованная связанная функция для расчета координат на основе этого флага. ( I3a330 )
Версия 1.7.0-beta01
14 мая 2024 г.
androidx.compose.ui:ui-*:1.7.0-beta01 выпускается. Версия 1.7.0-BETA01 содержит эти коммиты .
Изменения API
- Переименованные в
performCustomAccessibilityActionLabelledдляperformCustomAccessibilityActionWithLabelиperformCustomAccessibilityActionWhereгде можноperformCustomAccessibilityActionWithLabelMatching. ( I5387f ) -
AnnotatedString.hasEqualsAnnotationsтеперь являетсяhasEqualAnnotations( i685c0 ) - Обновил API для получения материалов тематических ссылок в тексте. В частности, удалили методы из
TextDefaultsдля построения тематическихLinkAnnotationsи разбора HTML с тематическими ссылками. Вместо этого добавил классTextLinkStyles, который позволяет стилизовать ссылки в качестве параметра в текстовый композиционный. ( I31b93 )
Исправления ошибок
- Исправляет дополнительные варианты использования при динамическом добавлении модификаторов ввода указателя во время событий 63E1504
Версия 1.7.0-альфа08
1 мая 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha08 выпускается. Версия 1.7.0-Alpha08 содержит эти коммиты .
Изменения API
- Добавляет поддержку реализации изменчивой формы.
Shape#createOutlineтеперь наблюдается внутри слоев графики, поэтому значения состояния чтения внутри приведут к недействительным при изменении состояния, что позволяет получить более эффективную анимацию формы. ( ID1629 , B/326070216 ) - Переименованное
isPositionedByParentWithDirectManipulationдляintroducesFrameOfReference. Обратите внимание, что теперь он обладает обратным эффектом, что означает, что по умолчанию большинствоLayoutCoordinatesвводят ряд ссылок, и, только при размещении под прямым манипуляциям свойство будет ложным. Чтобы запросить позицию только с теми, которые вводят систему отсчета, используйтеpositionInLocalFrameOfReference(...). ИлиpositionInLocalLookaheadFrameOfReferenceизLookaheadScope. ( IFC5F7 ) - API -интерфейсы
LookaheadScopeстали стабильными ( I21507 ) - Изменение действий Lambda для
getScrollViewportLengthв соответствии с отзывом Совета API. ( IBC74A ) - Обновленные API -интерфейсы
GraphicsLayerдля употребления параметров плавания вместо int. Удаленные значенияUnsetOffset/UnsetSize IntSizesentinel в пользу уже существующих неуточненных констант на плавании на основе смещения и размера встроенных классов ( i2fb03 , b/333863462 ) - При вводе ввода мыши во время тестов,
MouseInjectionScope.click(),MouseInjectionScope.doubleClick(),MouseInjectionScope.tripleClick(),MouseInjectionScope.longClick()теперь принимаетbutton: MouseButton, чтобы сделать их более универсально. Значение по умолчанию -MouseButton.Primaryдля всех методов. ( I31a23 , b/190493367 , b/261439695 ) - Переименован
onClickedвonClickInsideLinkInteractionListener. ( IAA35C ) - Переименовать
TextInclusionStrategy.isInsideдоisIncluded. СделайтеParagraph/MultiParagraph#getRangeForRect()Вернуть тип не нулевой. ( I51f26 )
Исправления ошибок
- Фиксированный длинный снимки экрана для прокрутки контейнеров с помощью
reverseScrolling=true. ( I7c59c )
Внешний вклад
- Добавлена поддержка предварительной выборки предметов у вложенных
LazyLists(например,LazyColumn, которая делает вложенныеLazyRows). Ожидается, что это изменение уменьшит падения рамки во время прокрутки этихLazyLists. По умолчанию по умолчанию предварительно переопределить первые 2 вложенных элемента, однако это поведение может контролироваться новойLazyLayoutPrefetchStrategy(nestedPrefetchItemCount)иLazyListPrefetchStrategy#onNestedPrefetchAPI. ( I51952 )
Версия 1.7.0-альфа07
17 апреля 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha07 выпускается. Версия 1.7.0-Alpha07 содержит эти коммиты .
Изменения API
-
ClickableTextпомечен как устаревший. Чтобы добавить ссылки в текст, создайтеAnnotatedStringсLinkAnnotationсоответствующей вашей ссылке, и передайте этуAnnotatedStringс композиционным текстом. ( I34d4b , b/323346994 ) - Представьте
ViewConfiguration.HandwritingGestureLineMarginдля рукописных жестов. Поддержка жестаJoinOrSplitдляBasicTextField( IE6E13 , B/325660505 ) -
FocusProperties.enterиFocusProperties.exitбольше не экспериментальны.FocusDirection.EnterиFocusDirection.Exitбольше не экспериментальные.FocusRequester.Cancelбольше не экспериментально ( i461a1 , b/261564106 ) - При запросе координат макета вы теперь можете использовать аргумент
excludeDirectManipulationOffset, чтобы исключить смещение, установленное родителями, которые поставили их детей с использованиемPlaceable.PlacementScope.withDirectManipulationPlacement. Аналогичным образом, макет, который часто меняет положение его детей, теперь может разместить их с использованиемwithDirectManipulationPlacement(например, прокрутки, реализовано по умолчанию). Это помогаетapproachLayoutанимации, основанной на основе, чтобы быть более интуитивно понятными, имея теперь возможность дифференцировать то, что компенсирует анимировать, и что применить напрямую при принятии решения о анимации их подхода. ( I60ec7 ) - Флаг функции для длинных скриншотов был удален. ( I28648 , b/329128246 )
-
LazyColumnтеперь будет правильно отображать липкие заголовки на длинных скриншотах. ( I8d239 , b/329296635 ) - Источники
NestedScrollперетаскивания заменяютсяUserInputиSideEffect, чтобы приспособиться к расширенному определению этих источников, которые теперь включают анимацию (побочный эффект) и колесо мыши и клавиатуру (UserInput). ( I40579 ) -
ApproachLayoutModifierNodeиModifier.approachLayoutв настоящее время стабильны, с новымisMeasurementApproachInProgress()иisPlacementApproachInProgress()для замены старогоisMeasurementApproachComplete()иisPlacementApproachComplete()соответственно. - Удаленный устаревший модификатор
intermediateLayout. ( I3e91c ) - Переименовать
GraphicsLayer#buildLayerдля записи, чтобы отразить методы начала/эндрепирования API -файлов, таких какRenderNodeи изображение. - Обновленная
rememberGraphicsLayerдля использованияrememberObserver. ( I312C1 , B/288494724 , B/330758155 ) -
UrlAnnotationустарела, вместо этого используйтеLinkAnnotation.Url. Если вы используете тематическую тематику материала, используйте объектTextDefaultsдля создания аннотации с применением материала ( I8D180 , B/323346545 ) - Текстовые ссылки получили вариант стиля состояния в дополнение к обычному стилю, завис и сфокусирован ( I5F864 , B/139312671 )
-
String.parseAsHtmlпереименован вAnnotatedString.Companion.fromHtml. ( I43dcd ) - Добавлены аргументы стиля (
linkStyle,focusedLinkStyle,hoveredLinkStyle) и слушатель взаимодействия ссылки на методparseAsHtml. При анализе html-меченной строки с тегами<a>метод будет построитьLinkAnnotation.Urlдля каждого такого тега и передавать объекты стиля и слушатель взаимодействия ссылок на каждую аннотацию. ( I7c977 ) -
LinkAnnotationтеперь принимает аргументы на стиля на основе состояний иLinkInteractionListener. Добавьте эту аннотацию вAnnotatedString, чтобы получить гиперссылку. ПропустивfocusedStateи/илиhoveredStateвы можете определить визуальнуюconfigurationдля ссылок, когда они сфокусированы и/или зависают. ( I81ce4 , b/139312671 ) -
ImeOptions.hintLocalesбольше не обязуется. Если вы хотите пройти пустой список локалов, используйтеLocaleList.Empty. ( IC5BC4 )
Исправления ошибок
- Иногрово обрабатывает данные о плохих/коррумпированных исторических событиях (игнорирует плохое смещение данных).
- Исправляет неожиданные события указателя, когда модификатор ввода указателя добавляется динамически перед другим модификатором ввода указателя во время активного потока событий ввода указателя (например, между выходом в Enter и Hover [Mouse/Stylus]).
Версия 1.7.0-альфа06
3 апреля 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha06 выпускается. Версия 1.7.0-Alpha06 содержит эти коммиты .
Новые функции
- Добавлен метод
parseAsHtmlдля стилизовых строк: он позволяет преобразовать строку, помеченную тегами HTML вAnnotatedString. Обратите внимание, что не все теги поддерживаются, например, вы еще не сможете отображать списки пулей. ( I84D3D , I30626 , B/139326648 ) - Реализованная экспериментальная поддержка длинных скриншотов в составных контейнерах с использованием официального API Android API (
ScrollCaptureCallback). Эта функция является экспериментальной и может в настоящее время неправильно обрабатывать все случаи. По этой причине он в настоящее время отключен по умолчанию. Чтобы забрать, установите флагComposeFeatureFlag_LongScreenshotsEnabledна True. ( I2B055 , B/329296471 )
Изменения API
-
fun ClipEntry.getMetadata()изменяется наval ClipEntry.clipMetadata. ( I50155 ) - Удален
ClipboardManager.getClipMetadataиClipboardManager.hasClip. Пожалуйста, используйтеclipEntry.getMetadata()чтобы прочитать метаданные текущего записи клипа. Также проверьте результатClipboardManager.getClip, если он нулевой или не понимает, имеет ли буфер обмена текущим клип. ( I50498 ) - Теперь вы можете передать объекты
GraphicsLayerв функцииplaceable.placeWithLayer()( i1b22f ) -
ClipboardManager.setClipтеперь принимает NULL, чтобы иметь возможность очистить буфер обмена. ( I7d2e9 ) - Добавлены идентификаторы ресурсов для оказания помощи в сокрытии представлений, используемых в качестве деталей реализации в рамках инструментала сборки ( I99531 )
- Добавлено
GraphicsLayer#toImageBitmapметод приостановки для поддержки содержимого рендеринга растрового изображения вGraphicsLayer. Это аппаратная ускоренная операция рендеринга на уровне API 22+ (включительно), которая поддерживает более 99% всех устройств Android. На уровне 21 API Android это возвращается на рендеринг программного обеспечения. ( I9e114 ) - Вспомогательный метод преобразования прямоугольного
RectFвComposeRect( i39925 , b/325660505 ) - Все параметры
KeyboardOptionsтеперь имеют неопределенное значение по умолчанию. Добавлено методKeyboardOptions.merge. - Переименованные
KeyboardOptions.autoCorrectАутокоррекция сautoCorrectEnabledи сделала его нулевым, где NULL указывает, что значение не было указано. ( Ia8ba0 , b/295951492 ) - Вариант
BasicTextField(state)иBasicSecureTextFieldтеперь используютKeyboardActionHandlerвместоKeyboardActionsдля обработки действий, предпринимаемых программной клавиатурой. ( I58dda )
Версия 1.7.0-альфа05
20 марта 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha05 выпускается. Версия 1.7.0-Alpha05 содержит эти коммиты .
Новые функции
- Представьте новый API
GraphicsLayerдля записи команд рисования в списке отображения, а также дополнительные свойства, которые влияют на рендеринг списка отображения. Это обеспечивает границу изоляции, чтобы разделить сложную сцену на более мелкие части, которые можно обновлять индивидуально друг друга, не воссоздавая всю сцену. Преобразования, сделанные вGraphicsLayerмогут быть сделаны без повторной записи списка дисплея. В отличие отModifier.graphicsLayer,GraphicsLayerпозволяет рендеринг композиционного контента в других местах и полезен в случае анимированного использования, когда ожидается, что контент будет отображаться в разных сценах.
Изменения API
-
GraphicsLayer.draw(Canvas)больше не публичный API. Пожалуйста, используйте функцию расширенияDrawScope.drawLayer(GraphicsLayer)вместо этого, чтобы нарисовать слой. ( I7a7c0 ) - Split
restrictedConstraints()на два метода:fitPrioritizingWidth()иfitPrioritizingHeight()( i6d7fd ) - Введен
HardwareCanvasStub для Android L ( I1C3B5 , B/288494724 ) - Обновление Compose Framework для обнаружения локальной композиции
GraphicsContext, наряду с обновлением владельца,DelegateableNodeиdrawWithCacheРеализации модификатора, чтобы обнаружить доступ кGraphicsContextдля доступа к общему доступу, которые будут автоматически очищать экземплярыGraphicsLayer, когда модификаторы разорваны. ( I64a2f , b/288494724 ) - Введен
InterceptPlatformTextInputдля помощи в написании низкоуровневых тестов, связанных с IME, и других низкоуровневых вариантов использования IME.PlatformTextInputTestOverrideустарел. ( I862ed , b/322680547 ) - Была добавлена функция расширения
GraphicsLayer.setOutline(Outline). ( IB81F4 ) - Представьте конструктор функции
GraphicsContextдля создания завода для создания экземпляровGraphicsLayer( IB98D6 , B/288494724 ) - Появляемый API
GraphicsLayerдля предоставления разработчика определял гибкость в захвате команд рисунков, которые можно использовать для рисования в другом месте, а также применять различные визуальные эффекты к конечным результатам. ( I80245 , B/288494724 ) - Представьте
Paragraph#getRangeForRect, который возвращает диапазон текста, покрытый данной областью прямоугольника. ( IEE516 , B/325660505 ) - Удален экспериментальный переопределение
BasicTextс помощьюonLinkClickedArcome. Замена API для поддержки гиперссылок будет следовать в будущем. ( I107d5 )
Исправления ошибок
- Добавлен
GraphicsLayerОжидайте/Фактическое определение API для поддержки захвата и воспроизведения команд рисования с дополнительными визуальными эффектами и преобразованием композиции. Введите интерфейсGraphicsContext, чтобы содержать графические зависимости, включая создание и управление экземплярамиGraphicsLayer. ( I4a8d6 , b/288494724 ) - Исправлена проблема с 1D -поиском фокуса, где фокус застрял бы в
ComposeView, который был встроен среди других взглядов. ( I08fd4 )
Внешний вклад
-
LocalLifecycleOwnerперенесён из Compose UI вlifecycle-runtime-compose, чтобы его вспомогательные API на основе Compose можно было использовать вне Compose UI. Спасибо Джейку Уортону за вклад. ( I6c41b , b/328263448 ) - Последовательно обнаруживают смещение плавания свойства на все подтипы выравнивания на основе смещения. ( I69f0f , b/328088992 )
Версия 1.7.0-альфа04
6 марта 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha04 выпускается. Версия 1.7.0-Alpha04 содержит эти коммиты .
Изменения API
- Функция почерка поддержки Stylus для BasicTextField2 на устройствах после Android U. ( i002e4 )
- В этом CL мы добавляем семантическое действие
GetScrollViewportLength, чтобы мы могли подготовить информацию о компонентах, прокручиваемых в системе A11Y. Этот CL также применяет использование указанного имущества в прокручиваемых списках Foundation. ( IC5FA2 ) -
FocusRequester.createRefsтеперь стабилен ( i4d92c , b/261436820 ) - Введен
DelegatableNode.requireView(), чтобы позволить модификаторам узлы для получения текущегоViewAndroid без чтения локального композиции. ( I40768 ) - Новый API
Path.reverse()Чтобы обратить внимание на направление пути ( i36348 ) - Добавлены
hintLocalesвKeyboardOptions, чтобы предоставитьTextFieldsвозможность намекнуть на IMES конкретными локалами для предварительного выставления предпочтительного языка. - Разместите свойство
platformLocaleотLocale, которая возвращает базовый объект платформы, например,java.util.Locale. ( I921c6 )
Версия 1.7.0-альфа03
21 февраля 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha03 выпускается. Версия 1.7.0-Alpha03 содержит эти коммиты.
Изменения API
- Введение
ContextualFlowRowи улучшенногоFlowRow/Columnс максимальными линами и переполнением. Мы рады объявить об усовершенствованиях экспериментальнойFlowRowиFlowColumn, в настоящее время показывая Maxlines и поддержку переполнения, наряду с дебютомContextualFlowRowиContextualFlowColumn. Это обновление предназначено для обеспечения оптимальных компонентов производительности, гдеContextualFlow*идеально подходит для большого количества элементов, использующих небольшую конфигурациюmaxLinesи Dynamic +N, см. Больше кнопок, аFlowRowиFlowColumnидеально подходит для небольшого количества элементов, менее 100 элементов. Важно: для поддержания существующего поведения вFlowRowилиFlowColumn, где все элементы составляются независимо от того, соответствуют ли они максимум поперечной оси, установитеoverflowдляFlowRowOverflow.VisibleилиFlowColumnOverflow.Visibleво время инициализации. ИсследуйтеContextualFlowRowSampleиFlowRowSampleдля примеров этих новых функций в действии. ( IB9135 , B/293577082 ) - Добавьте свойство семантики
maxTextLength, которое должно быть установлено на текстовых полях, которые отфильтровали максимально допустимое количество символов. ( I24d9f , b/170648072 ) -
Modifier.inspectable, обертка устарела. Этот API создаст больше признаков вашего модификатора, чем необходимо, поэтому его использование теперь не рекомендуется. Разработчикам рекомендуется реализовать методinspectableProperties()наModifierNodeElement, если они хотели бы разоблачить свойства модификатора для инструментов. ( IB3236 ) - Новый конструктор для
PopupProperties, который позволяет полностью управлять флагамиWindowManager.LayoutParams. ( IBB33E , B/312485503 ) - Введен
DelegatableNode.requireLayoutCoordinates()LayoutCoordinatesModifier.NodeonPlacedIA8657 ) - Введен
DelegatableNode.currentLayoutCoordinatesкак способ получить текущиеonPlacedLayoutCoordinatesModifier.Node. ( IAEBAA ) -
BasicTextField2и связанные с ними API -интерфейсы вandroidx.compose.foundation.text2Пакет перемещены наandroidx.compose.foundation.text. ( I9f635 ) - Добавлен новый API API
ApproachLayoutModifierNodeдля поддержки создания пользовательской логики подхода в явном модификаторе. Также добавил новый экспериментальный APIDeferredTargetAnimationдля анимаций, цель которой неизвестна в экземпляре. ( I60745 ) - Новый
PathAPI, чтобы запрашивать направление пути и извлечь контуры сPath. ( I63d04 ) - Добавлено
PathHitTestиPath.contains(Offset), чтобы проверить, содержит лиPathопределенную точку. ( I3b218 ) -
TextLayoutResultтеперь разоблачает методgetLineBaseline(lineIndex). Это позволяет считывать базовую линию произвольной линии текста в дополнение к существующим удобным свойствамfirstBaselineиlastBaseline. ( IDE4E8 , B/237428541 ) - Добавлен метод для сравнения только аннотаций двух
AnnotatedStrings. ( I32659 )
Исправления ошибок
- Исправлена проблема с обратной совместимостью с
SemanticsPropertyReceiver.performImeActionиSemanticsActions.PerformImeAction. ( ID0528 , B/322269946 )
Версия 1.7.0-альфа02
7 февраля 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha02 выпускается. Версия 1.7.0-Alpha02 содержит эти коммиты.
Изменения API
- Исправлена проблема бинарной совместимости с
SemanticsPropertyReceiver.performImeAction. ( I65865 , b/322269946 ) - Конструктор
PopupProperties, который принимает параметрusePlatformDefaultWidthбольше не экспериментальный. ( I8f8d2 ) - Добавлена перегрузка
ComposeTestRule.waitUntil, которая принимает строку описание условия, чтобы включить в сообщение тайм -аута. ( I9413e ) - Новая семантика API
unset()для удаления семантики, которые добавляются в той же цепочке модификаторов. Новая семантическая собственностьisOpaque. ( I8C583 , B/317966058 , B/246056649 ) - Удалено
originalEventPositionиз метода копирования в общественном APIPointerInputChange. ( I7bead )
Исправления ошибок
- Исправлена ошибка A11Y, позволяющая не табсам и нерадиобуттонам, когда выбираются при выборе. ( I2181c )
-
VelocityTrackerтеперь будет иметь исправление для добавления точек по умолчанию. Исправление все еще можно отключить, установивVelocityTrackerAddPointsFixна false, если есть какие -либо проблемы. ( IB3877 , B/269487059 ) - Исправлена задом наперед бинарная несовместимость в
TextStyleиParagraphStyle. ( I179F0 , B/320819734 )
Внешний вклад
- Добавлен новый конструктор
DialogPropertiesбез специфичных для платформы параметров. ( I45829 ) - Добавлен новый конструктор
PopupPropertiesбез параметров, специфичных для платформы. ( I9a038 )
Версия 1.7.0-альфа01
24 января 2024 г.
androidx.compose.ui:ui-*:1.7.0-alpha01 выпускается. Версия 1.7.0-Alpha01 содержит эти коммиты.
Изменения API
- Расширенный
ClipboardManager, добавивClipEntryиClipMetadataдля поддержки произвольного контента, такого как изображения. - Добавляет API
DeviceConfigurationOverrideвui-test, чтобы локально переоценивать поведение тестирования контента, например, указать доступный размер, локали, направление макета, шкалу шрифта или тема.
Версия 1.6
Версия 1.6.8
12 июня 2024 г.
androidx.compose.ui:ui-*:1.6.8 выпущен. Версия 1.6.8 содержит эти коммиты .
Исправления ошибок
- Фиксированные несоответствия в масштабировании шрифтов, когда шкала шрифта меньше, чем самая низкая таблица. В этом случае мы теперь интерполируем между линейной шкалой 1X и самой низкой определенной таблицей, так что размер шрифта монотонно увеличивается по мере увеличения шкалы. ( ICBAE3 )
Версия 1.6.7
1 мая 2024 г.
androidx.compose.ui:ui-*:1.6.7 выпущен. Версия 1.6.7 содержит эти коммиты .
Версия 1.6.6
17 апреля 2024 г.
androidx.compose.ui:ui-*:1.6.6 выпускается. Версия 1.6.6 содержит эти коммиты .
Исправления ошибок
- Исправляет редкий сбой
BasicTextField.
Версия 1.6.5
3 апреля 2024 г.
androidx.compose.ui:ui-*:1.6.5 выпускается. Версия 1.6.5 содержит эти коммиты .
Версия 1.6.4
20 марта 2024 г.
androidx.compose.ui:ui-*:1.6.4 выпущен. Версия 1.6.4 содержит эти коммиты .
Версия 1.6.3
6 марта 2024 г.
androidx.compose.ui:ui-*:1.6.3 выпущен. Версия 1.6.3 содержит эти коммиты .
Версия 1.6.2
21 февраля 2024 г.
androidx.compose.ui:ui-*:1.6.2 выпущен. Версия 1.6.2 содержит эти коммиты.
Версия 1.6.1
7 февраля 2024 г. androidx.compose.ui:ui-*:1.6.1 выпущен. Версия 1.6.1 содержит эти коммиты.
Исправления ошибок
- Fixed a backwards compatibility issue with
SemanticsPropertyReceiver.performImeActionandSemanticsActions.PerformImeAction. ( Ie0bb2 , b/322269946 ) - Layouts now issue an error while measuring when one returns an abnormally large size. This kind of error normally happens when the measurement uses maximum constraints directly without checking for
Constraints.Infinity. The check will help developers find problems with the layout having the wrong size rather than in a layout that contains it. ( I339a9 )
Версия 1.6.0
24 января 2024 г.
androidx.compose.ui:ui-*:1.6.0 is released. Version 1.6.0 contains these commits.
Версия 1.6.0-rc01
10 января 2024 г.
androidx.compose.ui:ui-*:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.
Исправления ошибок
- Optimized vector graphics implementation to improve performance by minimizing additional recompositions.
Версия 1.6.0-beta03
13 декабря 2023 г.
androidx.compose.ui:ui-*:1.6.0-beta03 is released. Version 1.6.0-beta03 contains these commits.
Новые функции
- It is now possible for a
LayoutCoordinatesto be detached without the node being detached. Guard against that in the compose Layout Inspector ( If693 )
Исправления ошибок
-
PlatformImeOptionsis now a concrete class instead of an interface. ( If40a4 ) - Fixed extra downstream recompositions caused by
LocalSoftwareKeyboardControllerandLocalTextInputServicebeing provided new values every time a root recomposed. ( I42190 , b/310510985 )
Версия 1.6.0-beta02
29 ноября 2023 г.
androidx.compose.ui:ui-*:1.6.0-beta02 is released. Version 1.6.0-beta02 contains these commits.
Версия 1.6.0-beta01
15 ноября 2023 г.
androidx.compose.ui:ui-*:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.
Изменения API
- 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 thedragAndDropTargetModifier to 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. aDragAndDropTargetfactory function has been added to receive from drag and drop sessions ( Iebf3a ) 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 )Improves traversable node api names to make them more understandable. ( Ia4474 )
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 rests of the test apis will filter out deactivated nodes by default. ( I2ef84 , b/187188981 )Removed
FocusDirection.InandFocusDirection.OutuseFocusDirection.EnterandFocusDirection.Exitinstead ( I2f660 )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 )FontStyle(int)constructor is deprecated, useFontStyle.NormalorFontStyle.Italicinstead. ( I66610 )Renamed
FontScalableinterface toFontScaling( Ie804a )
Исправления ошибок
-
SoftwareKeyboardController.show()will no longer show the software keyboard if no text editor is focused. ( I2165a , b/301477279 ) - Hardware key Up events for keys that haven't received a Down event in the same Compose View will now be ignored. ( Ib37b4 , b/305518328 )
- Add renderer support for Sweep Gradient in
ArcLine. ( I4d5bb ) - Implement equals and hashcode for
PageSize.Fixed. ( Ie3ede , b/300134276 ) - 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 )
-
TestDispatchers passed as theeffectContextto Compose tests will now be used to create the test and frame clocks. ( Ia7178 )
Версия 1.6.0-альфа08
18 октября 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha08 is released. Version 1.6.0-alpha08 contains these commits.
Изменения API
-
Modifier.dragAndDrawSourcehas had theonDrawDragShadowlambda renamed todrawDragDecorationandDragAndDropInfohas had the size parameter renamed todragDecorationSize. ( Id0e30 , b/303904810 ) - Introduce
SemanticsNodeInteraction.isDisplayed()andSemanticsNodeInteraction.isNotDisplayed()to check if a matched node is visible or not without also asserting on it. ( I2c196 , b/302100809 ) - Introduced a special
Unspecifiedvalue forTextAlign,TextDirection,HyphensandLineBreakfields of theParagraphTextStyleto replacenull. Because these classes are inline classes, by replacing nullable with the Unspecified, we avoid primitive type boxing. Constructors, getters and other methods inTextStyleand Paragraph style were updated to accept the mentioned parameters as non-null types. ( I4197e , b/299490814 ) - Add
GoogleFontoverload for reading aGoogleFontfrom XML. ( If8f59 ) - Made
LoremIpsumPreviewParameterProvideran open class. ( I41bf5 , b/266918816 , b/300116360 )
Исправления ошибок
-
FontFamilyResolvernow usesDispatchers.Mainfor cache management coroutines. ( Ie8dd9 ) -
AndroidViewBindingnow synchronously removesFragmentinstances inflated by including aFragmentContainerViewin your layout as part of itsonReleaseby usingcommitNow(instead of thecommitit was using previously), thus fixing issues with Live Edit's method with replacing the composition upon changes. ( I58fbf )
Версия 1.6.0-альфа07
4 октября 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha07 is released. Version 1.6.0-alpha07 contains these commits.
Изменения API
- Introduced
PlatformTextInputMethodTestOverridefor writing tests for custom text editors. ( Id159b ) - Adds
dragAndDropSourceModifier for starting drag and drop sessions, anddragAndDropTargetModifier for receiving from drag and drop sessions. ( Ib7828 , b/286038936 ) - Added
ColorListandColorSetcollections that avoid allocations. ( I744bd ) - 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 )
Исправления ошибок
- Optimized XML vector drawables parsing. ( Ibb015 )
Версия 1.6.0-альфа06
20 сентября 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha06 is released. Version 1.6.0-alpha06 contains these commits.
Изменения API
- Additional optimizations to Material icons. ( I3e08d )
- Adds ability to traverse up/down modifier tree to find similar nodes. ( I2d234 )
- Added
onRestoreFailed()callback to thefocusRestorer()modifier ( Ie1d43 ) - Added androidx annotations to various graphics APIs to specify
ColorInt,FloatRange,IntRange,Sizeand more. ( Id65c8 , b/290950582 ) - Add
showSystemUi=truetoPreviewScreenSizesdefinition ( Ib61d3 )
Изменения поведения
- 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 )
Версия 1.6.0-альфа05
6 сентября 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha05 is released. Version 1.6.0-alpha05 contains these commits.
Изменения API
- Enable content capture in
AndroidComposeViewAccessibilityDelegateCompat. ( Ib2969 ) - Fling velocities in View components like
ScrollViewandRecyclerVieware capped atViewConfiguration.ScaledMaximumFlingVelocity. Compose now contains its own version ofmaximumFlingVelocitywhich now applies toDraggable. ( Ibf974 ) - Adds initial scaffolding to support platform drag and drop APIs. ( If84ce )
- Add
deviceIdintoRotaryScrollEvent( Iba3bf ) - Updated
ui-toolingDevices API to include newer devices ( Ib25b4 )
Версия 1.6.0-альфа04
23 августа 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha04 is released. Version 1.6.0-alpha04 contains these commits.
Изменения API
- Added a method to deactivate
ReusableComposition, removing observations but keeping nodes in place. The deactivated composition can be activated again by callingsetContent. ( Ib7f31 ) - Add
ReusableCompositioninterface for managing lifecycle and reuse of subcompositions. ( I812d1 , b/252846775 ) -
Modifier.focusGrouphas been promoted to stable APIs. ( I7ffa3 ) - Added androidx annotations to various graphics APIs to specify
ColorInt,FloatRange,IntRange,Sizeand more. ( I70487 , b/290950582 ) - Updated
ColorFilterAPI to have concrete subclass types for improved inspectability of parameters. ( I5fe29 ) - Introduce wear-tooling-preview library to list valid wear devices that can be used for UI previews ( Ib036e )
- Created the
FontScalableinterface to handle the font scaling part of the Density interface. ( I2cf3f )
Version 1.6.0-alpha03
9 августа 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.
Изменения API
- New type of enter/exit transition that scales the content based on the size of the animating container during enter & exit animation.
LookaheadScopeComposable fun and interface are now stable. ( Ifb2ce ) - Added support for configuring
privateImeOptions( Idb772 )
Исправления ошибок
-
PopupPositionProvider.calculatePositionwill now automatically update the popup's position when state read in the calculation is changed. ( I676a1 , b/292257547 ) - 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 ) - Expanded application of global assertions in UI testing. ( I1f90d )
Версия 1.6.0-альфа02
26 июля 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.
Изменения API
- Added a service locator interface that can be implemented by implementors of Composition that allows an implementation of Composition that delegates to another composition delegate service lookups to the original Composition. This should not be called directy and is used to enable creating experimental APIs in the runtime that can be found from wrapped versions of the composer such as the UI module does. ( I296b9 )
- Completely redesigned
PlatformTextInput*API. ( I6c93a , b/274661182 , b/267235947 , b/277380808 ) -
SoftwareKeyboardControllerandLocalSoftwareKeyboardControllerare no longer experimental.LocalSoftwareKeyboardControlleris also now a properCompositionLocal. ( I4c364 ) -
LookaheadLayoutandLookaheadLayoutScopehave been deprecated for a few releases and are now removed. The replacement APIs areLookaheadScopethat can work with any Layout. ( I12ac3 ) - Added
SemanticsNodeInteraction.requestFocusas a more convenient and discoverable way to request focus in tests. ( Ie8722 ) - Add experimental APIs for registering global assertions, for use by testing frameworks in the future. ( I12d77 )
Исправления ошибок
-
AndroidView'supdatecallback's first invocation will now be defered until the view is attached, instead of running when the composition that introduces theAndroidViewis applied. This fixes a bug where theupdatecallback wouldn't be invalidated if a state it read was changed immediately by an effect. ( Ie9438 , b/291094055 )
Версия 1.6.0-альфа01
21 июня 2023 г.
androidx.compose.ui:ui-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
Новые функции
- Support lookahead in
LazyList. This allowsLazyListin the lookahead pass to bypass any animation (eg item placement animation,AnimatedVisibility, etc) and to calculate the lookahead size and position for all children. After the lookahead pass, children ofLazyListcould animate independently to the reality as seen in the lookahead pass.
Behavior Change: includeFontPadding is now false by default in Compose
includeFontPadding is now false by default ( 21d806 ) in Compose.
includeFontPadding is a legacy attribute that controls whether or not to include extra padding on top of the first line and last line of the text to accommodate any characters that may extend above or below the text baselines.
Updating this Compose version will modify how all texts render in your UI by removing the extra padding on top of the first line and last line of every text you display.
Depending on your UI requirements and the font metrics you're using, the changes should be minimal. However you might encounter blockers such as: - Broken screenshot tests. Fix the UI if required, and regenerate the golden images. - Text is slightly misaligned. Remove any custom negative paddings or add padding if required.
You can opt-in to includeFontPadding by using PlatformTextStyle for each text:
Text(
text = myText,
style = TextStyle(
lineHeight = 2.5.em,
platformStyle = PlatformTextStyle(
includeFontPadding = true/false
)
/* … */
)
)
You can opt-in to includeFontPadding for all your texts by configuring your Material styles. Note that parameter names will vary between M2 and M3.
val Typography = Typography(
body1 = TextStyle(
fontFamily = /* … */,
fontSize = /* … */,
platformStyle = PlatformTextStyle(
includeFontPadding = false
)
/* … */
)
)
MaterialTheme(
typography = Typography,
/* … */
)
You can find more about Compose includeFontPadding in developer documentation and this blog post .
If you experience issues/bugs connected with this change, file a bug using the issue tracker .
Изменения API
- Support
InputConnection#requestCursorUpdates( I0c69b ) - Added
FocusRequester.saveFocusedChildandFocusRequester.restoreFocusedChild( Ic557e , b/272302679 , b/275157318 ) - 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 ) - Optimized accessibility for performance and memory allocations. ( Iede48 )
- Added semantics properties and actions to support text translation. ( I4a6bc )
- New property in
IntrinsincMeasureScopeand its implementations (egMeasureScope) to indicate whether the current measure pass is a lookahead pass. ( I7a812 ) - Updated
DrawScopeapi to introduce the ability to retarget rendering into a different canvas with alternative density/layoutdirection and size. - Updated
DrawContextto support configuration of density and layout direction as well as making the canvas configurable. ( Ie1f9b , b/225408150 ) - Added
Paragraph#fillBoundingBoxesto calculate character bounding boxes. ( If30ee ) - Added a set of common
MultiPreviews( Ia5a27 )
Исправления ошибок
- Added
FocusTargetModifierNodeinterface that can be used to create a customFocusTarget. ( I9790e ) - Renamed the
fallback*parameters on theTextMeasurerconstructor todefault*. ( I940a5 ) - Renamed
SemanticsPropertyReceiver.performImeActiontoonImeActionandSemanticsActions.PerformImeActiontoOnImeAction. ( I8e841 ) - Adds Wheel to differentiate a mouse scroll from a drag in nested scrolling (specifically, in
NestedScrollConnection). ( Ie57e4 ) - Added
asComposePaintAPI to replacetoComposePaintas the returned object wraps the originalandroid.graphics.Paint( I22b4c ) - Deprecate
SemanticsProperties.imeActionand replace with a new parameter toSemanticsActions.performImeAction. ( I4a587 ) - Added support for selection by mouse. Touch based selection will expand by word, and shrink by character. ( Ic0c6c , b/180639271 )
-
Paragraphmethods that used to throwAssertionErrorfor out of bounds offsets now throwIllegalArgumentExceptionasMultiParagraphdoes. ( I549d3 , b/243338896 )
Версия 1.5
Версия 1.5.4
18 октября 2023 г.
androidx.compose.ui:ui-*:1.5.4 is released. Version 1.5.4 contains these commits.
Версия 1.5.3
4 октября 2023 г.
androidx.compose.ui:ui-*:1.5.3 is released. Version 1.5.3 contains these commits.
Исправления ошибок
- ( b/301209788 )
TextFieldwould sometimes incorrectly apply previous commands when focusing and inputting Korean input, leading to lost characters.
Версия 1.5.2
27 сентября 2023 г.
androidx.compose.ui:ui-*:1.5.2 is released. Version 1.5.2 contains these commits.
Исправления ошибок
- Added workaround for crashes when accessibility scroll API was accessed from background thread.
- Fix unattached nodes being added to the semantics tree.
Версия 1.5.1
6 сентября 2023 г.
androidx.compose.ui:ui-*: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.ui:ui-*:1.5.0 is released. Version 1.5.0 contains these commits.
Версия 1.5.0-rc01
26 июля 2023 г.
androidx.compose.ui:ui-*:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.
Исправления ошибок
- Fixed crash happening when
SubcomposeLayoutis used insidemovableContentOf().
Версия 1.5.0-beta03
28 июня 2023 г.
androidx.compose.ui:ui-*:1.5.0-beta03 is released. Version 1.5.0-beta03 contains these commits.
Исправления ошибок
- Added FocusTargetModifierNode interface that can be used to create a custom FocusTarget. ( Ifb1d6 )
- Fixed an issue with Dialog and Popup composables that could result in the child window not resizing as expected when
usePlatformDefaultWidth=true. ( I112ee )
Версия 1.5.0-beta02
7 июня 2023 г.
androidx.compose.ui:ui-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Изменения API
- Added
asComposePaintAPI to enable consumption of anandroid.graphics.Paintinstance to be used in Compose
Исправления ошибок
- Added
asComposePaintAPI to replacetoComposePaintas the returned object wraps the originalandroid.graphics.Paint( I22b4c )
Версия 1.5.0-beta01
24 мая 2023 г.
androidx.compose.ui:ui-*:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
Изменения API
- Removed allocations in recomposition, color animations, and
AndroidComposeView( Ib2bfa ) - Adds helper fun
CacheDrawModifierNode()to allow delegation ( Icf8f9 ) - Introducing
isLookingAheadproperty, accessible fromMeasureScope, to observe lookahead results and influence main pass if desired. ( Ibf4c3 ) - New semantics property
traversalIndex, a float used to reorder nodes inTalkBacktraversal (lower values come before). ( I9a81b , b/186443263 ) - Renaming the Semantics property
isContainertoisTraversalGroup( I121f6 ) -
ColorProducernow has anoperator fun invokeinstead ofproduce( I4a9a2 ) - Add
Pathtransform API to apply translation/scale/rotation transformations to path objects. ( I23434 , b/233772232 ) -
ColorProducer's method is calledproduce. ( I78bde ) - Rename
toFrameworkColorSpacetotoAndroidColorSpace( I4f547 ) - Rename
ColorLambdatoColorProducer. ( I73b1a ) - Introduce APIs to convert between Android and Compose colorspace types. ( Ie7db4 , b/279979665 )
- Added a color parameter to
BasicTextto allow efficiently animating or setting text color. ( Iffd88 , b/246961787 ) - Renamed
TextRange.constraintoTextRange.coerceIn. ( I31be2 ) - Added optimized
TextStyle.merge(...)with full parameter list. ( Iad234 , b/246961787 ) - Stabilized many Text APIs that include
Brush,DrawStyle,TextMotion,DrawScope.drawText,Paragraph.paint(Brush),MultiParagraph.paint(Brush). ( I2f740 , b/261581564 , b/261581931 , b/261561245 ) -
PlatformTextStyle.includeFontPaddingis undeprecated. Our original intent was to remove the field, however the feedback shows that developers need this configuration option. Therefore removing deprecation from the field ( I98e96 , b/277703184 ) - Added public
TextRange.constrainmethod. ( I97912 ) -
UrlAnnotations inAnnotatedStrings can now be opened via accessibility services likeTalkBack. ( If4d82 , b/253292081 ) - Added the
InsertTextAtCursorsemantics action for text fields. ( I11ed5 ) -
LineHeightStyle.Alignment(topRatio)constructor is promoted to stable API. ( I79c32 , b/261565383 ) -
TextMeasurerand related APIs are no longer experimental. ( I74647 , b/261581753 ) - Added the
PerformImeActionsemantics action to invoke the IME action on text editor nodes. ( Ic606f , b/269633506 ) -
PlatformTextInputAPIs are no longer experimental for Android. ( I668eb ) - value parameter name for
Enum.valueOfchanged ( Ia9b89 ) - more thrown exceptions from enum valueOf ( I818fe )
- Introduced new low-level
PlatformTextInputAdapterAPI for building custom text input implementations that talk directly to platform APIs. ( I58df4 ) - Added
BlendModeparameter toDrawScope.drawText,Paragraph.paint, andMultiParagraph.paintmethods to support different blending algorithms when drawing text on Canvas. ( I57508 ) - Rename
Font.MaximumAsyncTimeouttoFont.MaximumAsyncTimeoutMillis. Rename only. ( I07af5 ) - Updated DPI values of
@Previewreference devices ( Id6151 , b/254528382 ) - Add
brush,alphaparameters toBasicTextto allow efficiently animating or setting text brush. - Define box-free lambda types for Float, Double, Long, Int, Short in :ui:ui-unit ( I6f18d , b/246961787 )
Исправления ошибок
- Removed multiple allocations in pointer velocity tracking ( I26bae )
- Reduced allocations in layout and pointer input management ( I5333a )
- Optimize Vector memory usage and first-frames rendering ( I2f3c6 )
- Removed allocations when drawing lines and points with Canvas ( I9f535 )
- Add docs for
AndroidFont.fontVariationSettings( I7d9e2 )
Внешний вклад
- Improved performance and reduce allocations in Vector APIs ( I906cb )
Версия 1.5.0-альфа04
10 мая 2023 г.
androidx.compose.ui:ui-*:1.5.0-alpha04 is released. Version 1.5.0-alpha04 contains these commits.
Новые функции
-
Modifier.NodeDelegation Improvements Added an enhanced ability to delegate to otherModifier.Nodeinstances from aDelegatingNode. This can be done with thedelegateandundelegateAPIs. Prior to this change, every API from the delegating node needed to be delegated explicitly to the delegated node. After this change, node interfaces will get delegated implicitly unless theDelegatingNodeis explicitly overriding them. ( 67352bc )
Изменения API
- Introduce
NestedScrollModifierNode, aNestedScroll Modifier.Nodethat can be delegated to. ( I69513 ) - Added
onResetandonReleaseparameters to theAndroidViewBindingcomposable, mirroring theAndroidViewcomposable and enabling support for View reuse withViewBinding. ( I00b1e , b/276802519 ) - Updated Compose Path API to support rewind operations to support usecases of frequent Path manipulation with faster re-use. ( I7b797 )
- Added optimized
TextStyle.merge(...)with full parameter list. ( Iad234 , b/246961787 ) - Stabilized many Text APIs that include
Brush,DrawStyle,TextMotion,DrawScope.drawText,Paragraph.paint(Brush),MultiParagraph.paint(Brush). ( I2f740 , b/261581564 , b/261581931 , b/261561245 ) -
PlatformTextStyle.includeFontPaddingis undeprecated. Our original intent was to remove the field, however the feedback shows that developers need this configuration option. Therefore removing deprecation from the field ( I98e96 , b/277703184 )
Исправления ошибок
- Fixed regression where keyboard wasn't showing for text fields inside dialogs not created by the
Dialogcomposable. ( I82551 , b/262140644 )
Версия 1.5.0-альфа03
19 апреля 2023 г.
androidx.compose.ui:ui-*:1.5.0-alpha03 is released. Version 1.5.0-alpha03 contains these commits.
Новые функции
- New default behavior for
SubcomposeLayoutinLookaheadScope:SubcomposeLayoutsthat don't have conditional slots (egTabRow,Scaffold,BoxWithConstraints, etc) now work nicely with lookahead animations.
Изменения API
- New default
intermediateMeasurePolicythat reuses measure policy from lookahead pass allowsSubcomposeLayoutsubtypes without conditional slots such asScaffold,TabRow, andBoxWithConstraintsto work with lookahead by default. ( Id84c8 ) - The recomposer created for an Android window will now only block calls to
withFrameNanosinstead of all composition when it receives anON_STOPnotification. This means windows associated with stopped activites will continue to recompose for data changes but the animations, or any other caller ofwithFrameNanos, will block. ( Id9e7f , b/240975572 ) - Changes
motionEventSpyto stable. ( Ic5ec4 , b/261560988 ) - Added public
TextRange.constrainmethod. ( I97912 ) -
PlatformTextStyle.includeFontPaddingis no longer deprecated to encourage developers to use this compatibility API to switch and test settingincludeFontPaddingfalse. ( I98e96 , b/277703184 )
Версия 1.5.0-альфа02
5 апреля 2023 г.
androidx.compose.ui:ui-*:1.5.0-alpha02 is released. Version 1.5.0-alpha02 contains these commits.
Изменения API
- New
SubcomposeLayoutAPI that takes an additional intermediate measure policy for handling measure/layout logic during lookahead-based animations. ( I017d3 ) - PointerInput is now lazy and uses Modifier.Node for better performance ( read about the minor behavior change ). ( 15dab9 )
- Changes experimental APIs to stable with Key events. ( I9c7d8 , b/261566839 , b/261567368 )
- Changes experimental APIs to stable in
PointerInputChange. ( I1b543 , b/261560988 , b/261565762 , b/261565749 ) - Adds a way to instantiate a
SuspendingPointerInputModifierNodefor more complexModifier.Nodeimplementations. ( Ic4933 ) -
UrlAnnotations inAnnotatedStrings can now be opened via accessibility services likeTalkBack. ( If4d82 , b/253292081 ) - Added an API to intercept hardware keys before they are sent to the soft keyboard ( I4f4c6 , b/186800395 )
- 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 )
Исправления ошибок
- Text test actions now require text fields to be enabled. ( Iab328 )
Версия 1.5.0-альфа01
22 марта 2023 г.
androidx.compose.ui:ui-*:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.
Изменения API
- Modifier.intermediateLayout now doesn't require an explicit LookaheadScope. The measure block in intermediateLayout has IntermediateMeasureScope as receiver, which provides convenient CoroutineScope, LookaheadScope and MeasureScope.( Ibe2e5 )
- LookaheadLayout has been replaced by LookaheadScope, which is no longer a Layout. This allows chid content in a LookaheadScope to be directly controlled by parent's MeasurePolicy. ( Ibe2e5 )
- Adds
Modifier.Node#coroutineScopeto allow Modifier.Nodes to launch coroutines. ( I76ef9 ) - Allow Modifier.Nodes to read CompositionLocals by implementing the CompositionLocalConsumerModifierNode interface. ( Ib44df )
- Propagation of @Deprecated class to property. ( I882d1 )
Версия 1.4
Версия 1.4.3
3 мая 2023 г.
androidx.compose.ui:ui-*:1.4.3 is released. Version 1.4.3 contains these commits.
Исправления ошибок
- Fixed an issue where
AndroidViewmay not be laid out correctly when used with certain Modifiers. ( I4dc77 , b/274797771 ) - Fixed a bug in 2D Focus Search that affected
DropDownMenus ( b/276811828 ) - Fixed a bug in custom focus enter/exit properties that only ran the enter/exit block the first time the lambda was invoked ( b/277234245 )
- Fixed a regression in the focus system that caused a crash while reading
focusProperties. ( b/271324781 , b/274897776 )
Версия 1.4.2
19 апреля 2023 г.
androidx.compose.ui:ui-*:1.4.2 is released. Version 1.4.2 contains these commits.
Исправления ошибок
- Fixed an issue where
AndroidViewwould not reuse its modifiers correctly, potentially resulting in unexpected behavior and crashes. ( Ib67ee , b/275919849 ) - Fixed regression where keyboard wasn't showing for text fields inside dialogs not created by the
Dialogcomposable ( I82551 , b/262140644 )
Версия 1.4.1
5 апреля 2023 г.
androidx.compose.ui:ui-*:1.4.1 is released. Version 1.4.1 contains these commits.
Исправления ошибок
- Fixes an issue with
ParentDataModifiernot affectingAndroidView( b/274797771 )
Версия 1.4.0
22 марта 2023 г.
androidx.compose.ui:ui-*:1.4.0 is released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
- Added a new
PinnableContainerAPI that allows lazy list items to be pinned, so that they are not disposed when they are scrolled out of bounds. For example,Modifier.focusable()uses this mechanism to pin the currently focused item. ( Ib8881 , b/259274257 , b/195049010 ) - The focus system is rewritten using the new experimental
Modifier.NodeAPIs. ( I7f4d7 , b/247708726 , b/255352203 , b/253043481 , b/247716483 , b/254529934 , b/251840112 , b/251859987 , b/257141589 ) - Added in
IsContainersemantics property on Surfaces. This property will be used in a later change that determines traversal order based on the semantic meaning of elements such as surfaces. ( I63379 ) - Added a new accessibility role
DropdownList. This can be used to replicateTalkBack's behavior when focusingandroid.widget.Spinner. ( I177e5 , b/236159001 ) - You can now use
PlatformTextStyle(emojiSupportMatch)to optionally disable emoji support processing for a single Paragraph. ( Ia7100 , b/139326806 ) - Android Compose UI tests will now run layout passes for each frame when executing frames to get to idle (eg via
waitForIdle). This may affect tests that assert on individual frames of layout animations. ( I8ea08 , b/222093277 ) - 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 )
Версия 1.4.0-rc01
8 марта 2023 г.
androidx.compose.ui:ui-*:1.4.0-rc01 is released. Version 1.4.0-rc01 contains these commits.
Изменения API
- Added an overload of
AndroidViewcomposable function, which accepts theonResetparam. It allows View instances to be reused when their node in the composition is discarded and reused in a compatible way. This is especially useful forLazyRowsandLazyColumnsof Views. ( I3f10d , b/230099236 ) - Introduced new low-level
PlatformTextInputAdapterAPI for building custom text input implementations that talk directly to platform APIs. ( I58df4 )
Исправления ошибок
-
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 )
Версия 1.4.0-beta02
22 февраля 2023 г.
androidx.compose.ui:ui-*:1.4.0-beta02 is released. Version 1.4.0-beta02 contains these commits.
Изменения API
- Removed the
modifierElementOf()API. Please extend fromModifierNodeElementdirectly instead. ( I2256b ) - 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 )
Исправления ошибок
- Accessibility focus order algorithm improved, for example top/bottom bars are more often read first/last respectively ( 74e9c5 )
Версия 1.4.0-beta01
8 февраля 2023 г.
androidx.compose.ui:ui-*:1.4.0-beta01 is released. Version 1.4.0-beta01 contains these commits.
Изменения API
-
PinnableContainer.PinnedHandle.unpin()was renamed torelease()( I4667a ) - Added
waitUntilNodeCount,waitUntilAtLeastOneExists,waitUntilExactlyOneExistsandwaitUntilDoesNotExistas experimental API toComposeTestRule, extending thewaitUntilAPI to accept any matcher and any count of nodes. SeeComposeTestRulefor further documentation. ( Ifa1b9 , b/226934294 ) - Rename
Font.MaximumAsyncTimeouttoFont.MaximumAsyncTimeoutMillis. ( I07af5 ) - Removed
GoogleFont.Provider.AllFontsListUriand linked to it in ktdoc instead. ( I16f29 )
Исправления ошибок
- Add docs for
AndroidFont.fontVariationSettings( I7d9e2 )
Версия 1.4.0-альфа05
25 января 2023 г.
androidx.compose.ui:ui-*:1.4.0-alpha05 is released. Version 1.4.0-alpha05 contains these commits.
Изменения API
- 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 ) - Add a new API to track 1 dimensional velocity ( If5a82 )
-
FocusRequesteris now marked as@Stable. ( I580ee ) - Remove an experimental annotation from the
DialogPropertiesconstructor that takes ausePlatformDefaultWidthparameter. ( Ic4048 ) - Added function to calculation position and tangent at a distance on a path - with
PathMeasure.getPosition()andPathMeasure.getTangent()( I3b47c ) - Removed accidentally exposed public setter on
PlatformParagraphStyle. ( I07f47 ) - More type/nullability of inline/deprecated-hidden functions ( I24f91 )
- Add
AnnotatedString.hasStringAnnotationsto query for annotations with zero-allocations. ( I94dfe , b/246960758 ) - Added a new overload for
TextMeasurer.measurefunction which takes in aStringas text. ( I47b2d , b/242705342 ) -
LineBreakandHyphensAPIs in TextStyle are graduated to stable. ( Ic1e1d )
Внешний вклад
-
notifyFocusedRectmethods inTextInputSessionandTextInputServiceare not deprecated again. ( I23a04 , b/262648050 )
Версия 1.4.0-альфа04
11 января 2023 г.
androidx.compose.ui:ui-*:1.4.0-alpha04 is released. Version 1.4.0-alpha04 contains these commits.
Новые функции
- Added a new
PinnableContainerAPI that allows lazy list items to be pinned, so that they are not disposed when they are scrolled out of bounds. For example,Modifier.focusable()uses this mechanism to pin the currently focused item. ( Ib8881 , b/259274257 , b/195049010 ) - The focus system is rewritten using the new experimental
Modifier.NodeAPIs. ( I7f4d7 , b/247708726 , b/255352203 , b/253043481 , b/247716483 , b/254529934 , b/251840112 , b/251859987 , b/257141589 ) - Added in
IsContainersemantics property on Surfaces. This property will be used in a later change that determines traversal order based on the semantic meaning of elements such as surfaces. ( I63379 ) - Added new accessibility role
DropdownList. This can be used to replicateTalkBack'sbehavior when focusingandroid.widget.Spinner. ( I177e5 , b/236159001 ) - You can now use
PlatformTextStyle(emojiSupportMatch)to optionally disable emoji support processing for a single Paragraph. ( Ia7100 , b/139326806 ) - Android Compose UI tests will now run layout passes for each frame when executing frames to get to idle (eg via
waitForIdle). This may affect tests that assert on individual frames of layout animations. ( I8ea08 , b/222093277 ) - 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 )
Изменения API
- Replaced
maxSize: IntSizeargument indrawTextwithsize: Sizeto be inline with otherDrawScopefunctions.sizeis set toSize.Unspecifiedby default which should not change the previous default behavior. ( Icd27d ) - Removed deprecated experimental font constructor. ( I8a724 , b/261435386 )
- The ui tooling data class
Groupnow has a field,isInline, that indicates if the group is for a call to an inline composable function. IfisInlineistruethen the call is to an inline composable function. However, the value might be false for calls to inline composable functions that are from modules that are compiled with a version of the compose compiler plugin that doesn't generate the inline function information. ( Idb846 ) - Graduated a number of previously experimental APIs to stable
- Rotary Scroll Event API is now stable ( I42ad3 , b/261561229 )
-
FontVariationAPI is now stable ( I8779f , b/241016309 ) - All
Font()constructors are now stable API ( I5948b , b/261435386 ) -
DeviceFontFamilyNameis now stable ( I8b640 , b/261435386 ) -
AndroidFontconstructor withvariationSettingsis now a stable API, and can be used to create new types of font descriptors. ( I5adcc , b/261565807 ) -
createFontFamilyResolverAPI is now stable. This can be used to catch uncaught exceptions during async font loading. ( Ibb481 , b/261435386 ) -
Font.loadingStrategyAPI is now stable. ( I5937c , b/261435386 ) -
GoogleFontAPI is now stable. ( Ic90b0 , b/261435386 ) -
TextUnit(float, TextUnitType)is now stable API. ( I90c84 , b/261561612 ) -
pluralStringResourceis now stable API. ( I09849 , b/261439703 )
Версия 1.4.0-альфа03
7 декабря 2022 г.
androidx.compose.ui:ui-*:1.4.0-alpha03 is released. Version 1.4.0-alpha03 contains these commits.
Изменения API
- Removing
ExperimentalComposeUiApifromPointerIcon( I23af8 ) - Introduce Page accessibility actions:
PageUp,PageDown,PageLeft,PageRight. Note that these are only available from API 29. ( Ida4ab ) - Updated
rememberNestedScrollConnectionparameter view from root view to host view. ( Ia5200 ) - 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.
- Renamed
CompositingStrategy.AlwaystoOffscreento indicate that thegraphicsLayerwill always be rendered into an intermediate buffer ( I47dc1 ) - Layout overload with multiple content slots is now stable ( I10566 , b/248294649 )
- Added experimental new APIs
PerfettoTrace.record {}andPerfettoTraceRuleto capture Perfetto traces (also known as System Traces) as part of a test, to inspect test behavior and performance. ( I3ba16 ) - 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 ) - Added EmojiCompat to Compose ( Ibf6f9 , b/139326806 )
- Added new wallpaper parameter to
@Previewfor dynamic colour support ( I9f512 )
Исправления ошибок
- Snapshot apply notifications are now sent after the
Recomposerfinishes applying changes. ( Iad6c0 , b/222093277 ) - Introduced changes in
captureToImageto allow for capturing multi window screenshots. This is useful for screenshot tests that use compose PopUps. ( I169c5 )
Обновления зависимостей
- Compose UI and Compose Material now depend on Lifecycle 2.5.1. ( I05ab0 , b/258038814 )
Версия 1.4.0-альфа02
9 ноября 2022 г.
androidx.compose.ui:ui-*:1.4.0-alpha02 is released. Version 1.4.0-alpha02 contains these commits.
Изменения API
- Updated
GraphicsLayerScopeto expose the current size of thegraphicsLayer. This is useful for computinggraphicsLayertransformations as a function of the Composable size. ( If8c43 , b/181387080 ) - Introduced
CompositingStrategyto determine when to leverage an offscreen compositing layer for rendering ofgraphicsLayercontent. Auto maintains the default behavior which internally leverages a layer if alpha is applied or aRenderEffect/Overscroll. Always will always introduce an offscreen buffer whereModulateAlphawill avoid leveraging an offscreen buffer and instead will modulate each of the recorded drawing instructions within thegraphicsLayer.ModulateAlphausage will still leverage an offscreen buffer forRenderEffect/Overscrollusages ( I25e82 , b/256382834 ) -
invalidateSubtree()was added toModifier.Nodeto allow invalidating entire hierarchies for layout and drawing. ( I4bd90 ) - Promote
rememberNestedScrollInteropConnectionto stable. Introduced the ability to pass a root view torememberNestedScrollInteropConnection. This can help the custom view better react to scrolling constraints, specially in non-standard views (egModalBottomSheetDialog). ( I9e107 ) - Added
ObserverNodeinterface that can be used byModifier.Nodeimplementations that need to be notified when a value that they had previously read has changed ( I5728b , b/247716483 ) - Added a new constructor to
Paintthat accepts a nativeandroid.graphics.Paint. Also added an extension functiontoComposePaint()that converts an existing native Paint object to Compose Paint. ( Ica91b ) - Add new
FontFamily.Resolver.resolveAsTypefacefor use on Android. ( I8950b ) - Add
ToolingStateto allow tooling to change internal states of Composable ( Ie6614 ) - Refactor tooling to have better support for new added animations ( I8677b )
- Added
minLinesparameter into material and material3 Text,TextFieldandOutlinedTextFieldwhich allows setting the minimum height of the component in terms of number of lines ( I4af1d )
Версия 1.4.0-альфа01
24 октября 2022 г.
androidx.compose.ui:ui-*:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
Изменения API
- 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 ) - Deprecating recycling of acccessibility objects in androidx. We've found performance changes to be negligible in even the oldest supported versions. ( I0a961 )
- Added
DrawStyleas an Experimental attribute toTextStyleandSpanStyleto enable drawing outlined text. ( If24b8 , b/155421273 ) -
AnnotatedString.Buildernow implementskotlin.text.Appendable. ( I1a061 , b/231030444 ) -
AnnotatedString.Buildernow has anappend(AnnotatedString, start: Int, end: Int)method to append a substring of anAnnotatedStringand the intersecting styles. - Added
DrawStyleparameter toParagraphandMultiParagraphpaint functions that enables drawing outlined text. ( Ic8102 , b/155421273 )
Внешний вклад
- Thanks for
vighneshfor adding TV Devices to Previews ( Ie15cd )
Версия 1.3
Версия 1.3.3
11 января 2023 г.
androidx.compose.ui:ui-*:1.3.3 is released. Version 1.3.3 contains these commits.
Исправления ошибок
- Fix for a crash sometimes happening on Android 9 when Activity is saving the state of the Compose View. ( I0b755 , b/260322832 )
Версия 1.3.2
7 декабря 2022 г.
androidx.compose.ui:ui-*:1.3.2 is released. Version 1.3.2 contains these commits.
Исправления ошибок
- Updated to use Profobuf 3.21.8, which avoids a security alert in
protobuf-javalite:3.19.4(CVE-2022-3171) ( b/255545055 )
Версия 1.3.1
9 ноября 2022 г.
androidx.compose.ui:ui-*:1.3.1 is released. Version 1.3.1 contains these commits.
Версия 1.3.0
24 октября 2022 г.
androidx.compose.ui:ui-*:1.3.0 is released. Version 1.3.0 contains these commits.
Important changes since 1.2.0
- New experimental API suite
LookaheadLayout(enabling previously impossible animation behaviors) - New experimental API suite
Modifier.Node(higher-performance alternative toModifier.composed) - Improved window insets support.
- Focus support for D-Pads and hardware keyboard in LazyLists.
- Maximum supported elevation in dialogs and popups has been reduced to 8dp (behavior breaking change for some customized design systems – rationale in beta01 release notes )
- Many minor, nonbreaking API improvements
- Many bugfixes and performance improvements
Версия 1.3.0-rc01
5 октября 2022 г.
androidx.compose.ui:ui-*:1.3.0-rc01 is released. Version 1.3.0-rc01 contains these commits.
Изменения API
- Added new experimental API Hyphens to support automatic hyphenation in Text ( Iaa869 )
Исправления ошибок
-
DeviceFontFamilyNamefonts will not configurewghtanditalvariation settings by default, instead using platform setting for loadedTypeface. ( Ia7a6d , b/246989332 ) - Fixed
LazyColumnmemory leak -onModifierLocalsUpdatedwas not being called with the default value when modifiers were reused ( b/230168389 )
Версия 1.3.0-beta03
21 сентября 2022 г.
androidx.compose.ui:ui-*:1.3.0-beta03 is released. Version 1.3.0-beta03 contains these commits.
Изменения API
- Add options to customize line breaking in Text. ( I86907 )
- Changed
size:IntSizeargument withconstraints: ConstraintsinTextMeasurer.measuremethod to support minimum width constraints. ( I37530 , b/242707525 )
Исправления ошибок
- AndroidX Activity's
BackHandlerAPI now works within aDialogcomposable. ( I35342 )
Версия 1.3.0-beta02
7 сентября 2022 г.
androidx.compose.ui:ui-*:1.3.0-beta02 is released. Version 1.3.0-beta02 contains these commits.
Изменения API
- Added an experimental overload for Layout which accepts a list of multiple composable content lambdas, which allows to threat measurables put into different content lambdas differently ( Ic1b4e )
Changes to experimental Focus APIs:
-
FocusDirection.InandFocusDirection.Outare deprecated and replaced byFocusDirection.EnterandFocusDirection.Exit. ( Ia4262 , b/183746982 ) - Added two new focus properties enter and exit to specify a custom behavior for
FocusManager.moveFocus(Enter)andFocusManager.moveFocus(Exit). ( I5f3f9 , b/183746982 ) - You can now use
FocusRequester.Cancelto cancel a focus move.FocusRequester.Cancelcan be used in any of the following focus properties: up, down, left, right, next, previous, start, end, enter and exit. ( Ib300f )
Версия 1.3.0-beta01
24 августа 2022 г.
androidx.compose.ui:ui-*:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
Modifier Node Refactor
The layer which handles Modifier/Modifier.Element instances and coordinates their behavior on LayoutNodes has been majorly refactored. As it stands this was a refactor which did not affect the public API of any of the many modifiers in Compose, and can be viewed as an implementation-only change. Despite that, this is an important change for various reasons. ( Ie4313 )
Сводка изменений
The added experimental Modifier.Node APIs provide an abstraction that allows for state to be maintained on an instance that will be retained with the lifecycle of the layout node, and will be allocated per-layout-node and per-usage of the corresponding Modifier.Element that produced it.
Broadly speaking, this abstraction provides an alternative mechanism to produce stateful modifiers without relying on the mechanics of the Modifier.composed API.
Риск
This change is strictly binary compatible with prior releases, and is intended to be backwards compatible in terms of observable behavior as much as practical and reasonable. That said, there are few subsystems of compose this refactor did not touch, and it is likely that behavior has changed in ways that were not covered by our tests and have not yet been found and fixed .
Please upgrade to this release with caution. If you believe this has broken something for you, please let us know.
Экспериментальные API
Various experimental APIs have been added, all relating to the new concept of a "Modifier Node". Modifier.Node's are created as a result of
-
fun modifierElementOf(…): Modifier -
abstract class ModifierNodeElement -
abstract class Modifier.Node -
abstract class DelegatingNode -
interface LayoutModifierNode -
interface DrawModifierNode -
interface SemanticsNode -
interface PointerInputNode -
interface ModifierLocalNode -
interface ParentDataModifierNode -
interface LayoutAwareModifierNode -
interface GlobalPositionAwareModifierNode -
interface IntermediateLayoutModifierNode
Behavior breaking change
Maximum supported elevation in dialogs and popups has been reduced to 8dp.
The maximum supported elevation for Compose dialogs and popups has been reduced from 30dp to 8dp. This change affects both material and ui custom dialogs and popups. This change is made to mitigate an accessibility bug on Android versions below S, and to ensure that accessibility services within those windows are able to interact with the content inside the dialog or popup.
You will only be impacted by this change if you are creating a custom dialog or popup implementation with an elevation set to levels higher than 8dp. Consider lowering the elevation of your dialog or popup. If you need to opt-out from this new behavior, consider forking your own dialog or popup with the desired elevation set. This is not recommended, as accessibility might be negatively impacted and it is on the developer to ensure the bottom part of the dialog or popup is interactable and readable by accessibility services.
Изменения API
- Fixed an issue where
painterResourcewouldn't update on configuration changes ( I58e73 , b/228862715 ) -
rememberTextMeasurerno longer takesFontFamily.Resolver,Density, orLayoutDirectionparameters. Please use theTextMeasurerconstructor to provide custom values for these parameters. ( Ia1da3 ) - Added
DialogProperties.decorFitsSystemWindowsproperty to allow Dialogs to supportWindowInsets. ( I57742 , b/229378542 ) - Moved font constructors back to original kotlin file to retain binary compatibility. No change from last stable release. ( Ieb2f3 )
- Removed unnecessary operator from several equals definitions - this has no effect. ( I6c309 )
-
FontVariation.Settingis a sealed interface, to allow future clamping APIs. ( I11021 , b/143703328 ) - Add
CompositionGroup.findParameterstoSlotTree.kt. This allows tools to retrieve parameters for aCompositionGroupwithout having to parse the entire slot table. ( I124fe )
Версия 1.3.0-альфа03
10 августа 2022 г.
androidx.compose.ui:ui-*:1.3.0-alpha03 is released. Version 1.3.0-alpha03 contains these commits.
Изменения API
-
LayoutCoordinates.findRootCoordinates()is now public ( I7fa37 , b/204723384 ) - Added experimental API to get the
LayoutCoordinatesin thePlacementScope. This lets developers know where the current layout is to place children relative to its position. ( I5482b , b/238632578 ) - Added
LayoutCoordinates.transformFromto get the Matrix transformation from oneLayoutCoordinatesto another. ( Ic5ab1 , b/238632578 ) - Deprecated
SemanticsModifier.idand moved the semantics id toLayoutInfo.semanticsIdinstead. ( Iac808 , b/203559524 ) - Resource Fonts now support setting font variation settings (API 26+). ( I900dd , b/143703328 )
- Variable font support in
DeviceFontFamilyNameFont( Ic1279 , b/143703328 ) - Font constructors now accept a list of
FontVariation.Settingfor configuring variable fonts on O+ devices. ( I11a9d , b/143703328 ) - Add
FontVariationAPI for defining and using variable fonts. ( I3c40c , b/143703328 ) -
LineHeightStyle.Alignmentconstructor is now public (experimental) ( I4bbbe , b/235876330 ) - Paragraph is now expect|actual and defined for Android and Desktop. ( Id387e , b/239962983 )
- Interface Paragraph is now sealed interface Paragarph. There is no use case for subclassing paragraph, and we recommend reaching out if this change impacts you. ( If5247 , b/239962983 )
- Removed experimental annotation from
PlatformTextStyleandLineHeightStyle. ( I64bef ) - Deprecate
TextInputService.show|hideSoftwareKeyboard. Please useSoftwareKeyboardControllerinstead in app code andTextInputSessionin IME-management code. ( I14e4c , b/183448615 ) - Add new API for existing animation types ( I26179 )
Исправления ошибок
- Added
@RequiresPermissionto APIs that require granting thePOST_NOTIFICATIONSpermission on SDK 33 and above. ( Ie542e , b/238790278 )
Версия 1.3.0-альфа02
27 июля 2022 г.
androidx.compose.ui:ui-*:1.3.0-alpha02 is released. Version 1.3.0-alpha02 contains these commits.
Изменения API
- Added a new property
PointerInputChange#pressureto retrieve the pressure. ( I45a5e , b/205164819 ) - Added
rememberTextMeasurerto easily create and rememberTextMeasurerinstances in composition. ( I8d66e ) -
Rect,RoundRect, andMutableRectnow support the Kotlininsyntax for calling thecontainsfunction. ( Ie42b0 , b/238642990 ) - Remove unnecessary functions from
KeyInjectionScope, as they can be easily implemented with simpler parts of the API. The functions that have been removed includepressKeys,keysDownandkeysUp. ( I81d77 ) - Refactored constant and parameter names in
KeyInjectionScopeto include the suffix 'Millis' where the units of said constants and parameters are milliseconds. ( Iabef5 ) - Added
toStringForLog()method toEditCommandto help troubleshoot text editing issues. ( I53354 , b/228862731 ) - Added
drawTextextension function onDrawScopeto provide a way to draw multi-styled text on composables and modifiers that operate on aDrawScopelikeCanvasanddrawBehind. ( I16a62 , b/190787898 ) - Introduce a new experimental API called
TextMeasurerthat enables arbitrary text layout computation that creates identical results toBasicText, independent from Compose runtime. ( I17101 ) - Add
mapTreetoSlotTree.kt. This allows tools to inspect theSlotTreewithout making an in memory copy first like asTree does. For the Layout Inspector this gives a performance improvement of about a factor 10. ( I5e113 ) - Changed Compose Preview to be stored in binary output files, in order to allow developers to write and reuse
MultiPreviewannotations from libraries. ( I85699 , b/233511976 )
Исправления ошибок
- When adding
InputEventChangeevents toVelocityTracker 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 ) - Fix NPE caused by
AnnotatedString.toUpperCasewhen annotations are present. ( I0aca2 , b/210899140 )
Версия 1.3.0-альфа01
29 июня 2022 г.
androidx.compose.ui:ui-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
Изменения API
- New
LookaheadLayoutthat supports a lookahead pass before the actual measure/layout. This allows a pre-calculation of the layout when it changes, while permitting the post-lookahead measure/layout to use the pre-calculated size/position to animate the size and positions towards the target.SubcomposeLayoutsare not yet supported, but will be in an upcoming release. ( I477f5 ) - Add optional alpha parameter to Brush flavor of
TextStyleandSpanStyleto modify opacity of the wholeText. ( Ic2fac , b/234117635 ) - Introduced the
UrlAnnotationannotation type and associated methods to supportTalkBacklink support inAnnotatedStrings. ( I1c754 , b/231495122 ) - Moving utility functionality to runtime ( I4f729 )
Исправления ошибок
-
TextLayoutResult.getLineForOffsetdoes not throw. ( Idc5d6 , b/235876324 )
Внешний вклад
- Added a new API
WindowInfo.keyboardModifiersto observe its state within composable functions or via snapshotFlow ( Icdb8a )
Версия 1.2
Версия 1.2.1
10 августа 2022 г.
androidx.compose.ui:ui-*:1.2.1 is released. Version 1.2.1 contains these commits.
Исправления ошибок
- Fixed nullpointer in the inspector ( b/237987764 )
- Fixed class cast exception during remember in the inspector ( b/235526153 )
Версия 1.2.0
27 июля 2022 г.
androidx.compose.ui:ui-*:1.2.0 is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
Improvements in focus traversal:
- Focus-driven-scrolling of Lazy lists now works, using the new
BeyondBoundsLayoutcore API - New behavior customization APIs in
FocusOrderandFocusProperties - Improved behavior with physical keyboard or TV remote
- Focus-driven-scrolling of Lazy lists now works, using the new
New APIs for:
- Оконные вставки
- Core primitives for gesture-driven, infinite and layout animations
-
GraphicsLayercapabilities, includingRenderEffect
Many bugfixes and performance improvements
Версия 1.2.0-rc03
29 июня 2022 г.
androidx.compose.ui:ui-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Версия 1.2.0-rc02
22 июня 2022 г.
androidx.compose.ui:ui-*:1.2.0-rc02 is released. Version 1.2.0-rc02 contains these commits.
Версия 1.2.0-rc01
15 июня 2022 г.
androidx.compose.ui:ui-*:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
Изменения API
- Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
- Added higher-order functions to
KeyInjectionScopefor injecting key presses while other keys are held down or toggled on. These functions includewithKeysDown,withKeysToggledetc. Also added properties for checking if a particular meta key is down, for example,isCtrlDownto check if either control key is depressed. Refer toKeyInjectionScopefor documentation on each function. ( I9f6cd , b/229831515 ) - 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 ) - Rename
runComposeUiTestWithoutActivity {}torunEmptyComposeUiTest {}, which aligns it withcreateEmptyComposeRule()( I6fed7 )
Версия 1.2.0-beta03
1 июня 2022 г.
androidx.compose.ui:ui-*:1.2.0-beta03 is released. Version 1.2.0-beta03 contains these commits.
Изменения API
- Added
pressKeyTimesas well asisCapsLockOnand friends toKeyInjectionScope. Additionally, the API now supports mouse and keyboard combined injection patterns such as clicking a mouse button with a meta key held down. ( I4c8da , b/229831515 ) - Added experimental support for injecting key events. Use
performKeyInputto send key events, or send them through thekeyproperty ofMultiModalInjectionScopeduring a multi modal input gesture withperformMultiModalInput. SeeKeyInjectionScopefor documentation of the API. ( Ic5000 , b/229831515 ) - Add new
GoogleFont.Provider.AllFontsListUrifor retrieving the canonical internet source of Google Fonts supported by Android. - Improve error messages rethrown when GoogleFonts fail to load in compose. ( I0416c )
Исправления ошибок
- 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 ( I51ec3 , b/216582726 , b/223440806 , b/227709803 ) - The
Show Layout Boundssetting will now be applied for composables immediately after toggling it from the quick settings tile, without having to leave and re-enter the activity. ( I843d5 , b/225937688 ) - Accessibility string lookup does not trigger font loading. Previously, it would attempt to load fonts for
StyleSpans, which lead to crashes ifFontFamily.Resolverhad been overwritten. ( I4609d ) - 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 )
Версия 1.2.0-beta02
18 мая 2022 г.
androidx.compose.ui:ui-*:1.2.0-beta02 is released. Version 1.2.0-beta02 contains these commits.
Изменения API
- Reusing functionality in other preview types ( I19f39 )
Исправления ошибок
-
ViewCompositionStrategy.DisposeOnDetachedFromWindowIfNotInPoolingContainerhas been renamed toDisposeOnDetachedFromWindowOrReleasedFromPoolto better reflect that when disposals do occur, rather than simply when they do not occur. ( If15ca )
Version 1.2.0-beta01
11 мая 2022 г.
androidx.compose.ui:ui-*:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
Новые функции
- This is the first beta release of 1.2!
Изменения API
- Added experimental
BeyondBoundsIntervalthat can be used by custom implementations ofLazyListwhen they layout items beyond visible bounds ( Ifabfb , b/184670295 ) - Keyed versions of
Modifier.composedare now stable API ( Ie65e4 , b/229988420 ) - Simplified the
rememberNestedScrollConnectionAPI to use composition locals to acquire the current view information ( I67ca7 ) - The
@ComposableTargetannotation and annotations marked by@ComposableTargetMarkercan now be used at the file scope using the@fileprefix. Using a target annotation at the file scope will cause the compiler to assume all composable functions in the file are intended to be target the associated applier. For example, using@file:UiComposabledeclares that all@Composablefunctions target the Compose UI applier. A function that needs to target another applier must explicitly supply the target marker annotation for the desired applier. ( I40804 ) Introduced new experimental, platform independent, test API: an
interface ComposeUiTestand afun runComposeUiTest(block: ComposeUiTest.() -> Unit), that can be used to run Compose Ui tests without the need for aTestRule. To run a test without aComposeTestRule, pass the test as a lambda torunComposeUiTest, and use the methods and members in the receiver scopeComposeUiTest, which are the same ones as inComposeContentTestRule.The Android specific
interface AndroidComposeUiTestandfun runAndroidComposeUiTest(block: AndroidComposeUiTest.() -> Unit)are added to provide access to the underlying Activity, similar toAndroidComposeTestRule. For even more control, you can instantiate aclass AndroidComposeUiTestEnvironmentyourself.The Desktop implementation is the
class DesktopComposeUiTest, but no Desktop specific run functions are offered at the moment.Migrating a test from a
ComposeTestRuletoComposeUiTestcan be done like this (Android example). Из:@RunWith(AndroidJUnit4::class) class MyTest { @get:Rule val rule = createComposeRule() @Test fun test() { rule.setContent { Text("Hello Compose!") } rule.onNodeWithText("Hello Compose!").assertExists() } }К:
@RunWith(AndroidJUnit4::class) class MyTest { @Test @OptIn(ExperimentalTestApi::class) fun test() = runComposeUiTest { setContent { Text("Hello Compose!") } onNodeWithText("Hello Compose!").assertExists() } }For now,
ComposeContentTestRuleandComposeTestRuledon't extend fromComposeUiTest, which means extension functions onComposeUiTestcan't be called yet on theTestRuleinterface. WhenComposeUiTestgraduates to stable API,ComposeContentTestRuleandComposeTestRulewill be changed to extend fromComposeUiTest. ( Ib4e90 )LineHeightBehavioris renamed asLineHeightStyleLineVerticalAlignmentis renamed asLineHeightStyle.AlignmentRenames
LineHeightTrimis renamed asLineHeightStyle.TrimDefault constructor values from
LineHeightStyleis removed ( I582bf , b/181155707 )Added
BrushtoTextStyleandSpanStyleto 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 )PlatformParagraphStyle.lerpandPlatformSpanStyle.lerpfunctions are changed to be top level functions ( I9a268 )
Исправления ошибок
-
PointerInputChange::copydocumentation now correctly states that it is a shallow copy. ( I182f5 ) - Support ellipsis when height is limited and doesn't fit all text lines ( Ie528c , b/168720622 )
- 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 )
Внешний вклад
-
MouseInjectionScope.scroll(delta = someDelta)is now inverted on Android if we scroll vertically (if someDelta is positive, it will scroll downward) ( Ifb697 , b/224992993 )
Версия 1.2.0-альфа08
20 апреля 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha08 is released. Version 1.2.0-alpha08 contains these commits.
Изменения API
- The
pluralStringResourcefunctions were marked as experimental in order to allow evolution to support better internationalization in the future. ( If24e4 ) - 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 ) - PointerIcon is now a
@Stableinterface ( I9dafe ) - 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 ) - Enable Nested Scroll interop between Compose and View in the direction Compose > View. This means that a compose parent will be able to receive nested scroll deltas from a nested scroll view. ( If7949 , b/174348612 )
- New
SemanticsProperty testTagsAsResourceId, which can be used to make Compose conform with UIAutomator tests designed for the View system. ( I39c20 ) - 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 instructors reordered positional arguments to before optional arguments. ( Idafaa )
-
AndroidFontnow takes typefaceLoader as a constructor parameter. ( I2c971 )
Версия 1.2.0-альфа07
6 апреля 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha07 is released. Version 1.2.0-alpha07 contains these commits.
Изменения API
- New function
Snapshot.withoutReadObservation { ... }was added. It allows users to run the passed lambda without subscribing to the changes of the state values read during this block. You could find it useful in use cases when you want to benefit from the snapshot based thread safe write/reads, but want to be able to read the value without causing unnecessary recomposition or remeasure. ( I9f365 , b/214054486 ) - The
consumeWindowInsetsextension property ofComposeViewallows developers to disable consumption of AndroidWindowInsets. This allows separateComposeViewsin the hierarchy to each applyWindowInsetswithout interfering with each other. ( I0ef08 , b/220943142 ) - Added
KeyboardType.Decimalas an alternative toKeyboard.Numberfor specifically including decimal separator in IME. ( Iec4c8 , b/209835363 ) -
PointerEventType.ScrollandPointerEvent.scrollDeltaare stable APIs now ( I574c5 , b/225669674 ) - Enable Nested Scroll interop between View and Compose for cooperating View classes. This means compose is now able to dispatch scroll deltas to a (cooperating) View parent. ( I5d1ac , b/174348612 )
- Updated
FontFamily.Resolverto integrate System-wide bold text accessibility setting ( I6c1e7 ) -
Font(AssetManager, String, ...)is deprecated, replaced withFont(String, AssetManager, ...). This is an experimental API. ( I1c7a4 ) - Add new font descriptor
Font(DeviceFontFamilyName)to optionally lookup system-installed fonts during font fallback chains. ( I30468 , b/219754572 ) - Added temporary compatibility configuration for
includeFontPaddingin TextStyle/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 ) - Add
GoogleFont.Provider.isAvailableOnDeviceextension for debugging help. ( I64e31 ) - Add
GoogleFont.Providerconstructor for use with@ArrayRes( Ic5ee1 , b/225984280 ) -
Compose GoogleFontis now calledFont(GoogleFont), API remains stable otherwise. ( I125f2 )
Исправления ошибок
- Added lint check to material/Scaffold to ensure that the inner padding is being used ( Ifb111 )
Версия 1.2.0-альфа06
23 марта 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha06 is released. Version 1.2.0-alpha06 contains these commits.
Изменения API
- Added
RequestFocussemantics action to request focus on the focusable target. ( I17b71 ) - 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 ) Updated shadow/ambient colors to be trailing parameters of
Modifier.graphicsLayerfor API compatibility ( I3f864 , b/160665122 )Added default implementations to shadow/ambient color on
GraphicsLayerScopeto ensure non-breaking API changesAdded event time to RSB events ( Ief8ae )
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 )Upgrading both
RecyclerViewandComposewill now result in much better scrolling performance for RecyclerViews with Compose views as children.Add
ViewCompositionStrategy.Defaultas a means of retrieving the built-in default strategyAdd
ViewCompositionStrategy.DisposeOnDetachedFromWindowIfNotInPoolingContainer, which is the new default strategy and properly handles pooling containers such as RecyclerView. ( If7282 )Added support for annotating annotations classes with @Preview as a first step for adding the Multipreview feature. Such annotations could be used to annotate Composable methods or other annotation classes, which could then be considered as indirectly annotated with the given @Preview. ( I12eff )
Reference devices added to the Devices list for @Preview ( I071c9 )
Исправления ошибок
- Updated Vector graphics APIs to use the proper composable annotation @VectorComposable instead of @UiComposable ( I942bc )
- Remove crossinline from
AnnotatedString.Builder.withStyle( If84d5 )
Внешний вклад
- compose-ui: Add
ambientShadowColorandspotShadowColorproperties toGraphicsLayerScope( I1ba1a , b/160665122 ) - Plural resources are now supported via the
pluralStringResourcefunctions. ( Ib2f23 , b/191375123 )
Версия 1.2.0-альфа05
9 марта 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha05 is released. Version 1.2.0-alpha05 contains these commits.
Изменения API
-
TextToolbarnow takes lambda arguments instead ofActionCallback. ( Ib2eb9 , b/197950089 ) - Updated nullability in core and appcompat to match Tiramisu DP2 ( I0cbb7 )
- Measured interface now exposes parentData property ( I3313f )
-
Modifier.onPlacedand theOnPlacedModifierinterface are now stable. ( Ib5482 ) - Hooray! Compose animation now supports 'Animator duration scale' setting from Developer Options. ( I5a4fc , b/161675988 )
- Added a
BeyondBoundsLayoutmodifier local ( If8b51 , b/184670295 ) - Text: includeFontPadding is now turned off by default. The clipping issues as a result of
includeFontPadding=falseis handled and no clipping should occur for tall scripts. ( I31c84 , b/171394808 )
Исправления ошибок
-
ComposeContentTestRule.setContentwill now throw anIllegalStateExceptionif you try to set content when there already is content. ( I888a5 , b/199631334 ) - Fix crash caused by clipboard content while reading from clipboard on Android. ( I06020 , b/197769306 )
- Improve RSB scrolling samples. ( I6a596 )
Внешний вклад
- Updated to use Kotlinx coroutines 1.6.0 ( I3366d )
Версия 1.2.0-альфа04
23 февраля 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha04 is released. Version 1.2.0-alpha04 contains these commits.
Изменения API
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 aComposableTargetannotation 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 )Font(resId, ...)now takes loadingStrategy on stable API. ( Ief3d2 )FontLoadingStrategyis now stable API. ( I1ee35 , b/174162090 )Support async font loading in Text ( I77057 , b/214587005 )
Add bridge API for converting custom
Font.ResourceLoaderintoFontFamily.Resolver. ( Ia0060 )
Исправления ошибок
- Provided
FontFamily.Resolverare passed to subcompositions such as Popup. - Provided
Font.ResourceLoaderare passed to subcompositions such as Popup. ( I48fa5 )
Версия 1.2.0-альфа03
9 февраля 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.
Изменения API
-
notifyFocusedRectmethods inTextInputSessionandTextInputServiceare now deprecated and won't be called. UseBringIntoViewRequesterinstead. ( Ia4302 , b/192043120 , b/216842427 , b/178211874 ) - Introduced
destroyDisplayListDatamethod onRenderNodestub class ( I1e659 , b/216660268 ) - Added a new api which allows to premeasure children of
SubcomposeLayoutyou precomposed. ( I857ea ) Added
movableContentOfwhich converts a composable lambda into a lambda that moves it state, and corresponding nodes, to any new location it is called. When the previous call leaves the composition the state is temporarily preserved and if a new call to the lambda enters the composition then the state, and associated nodes, are moved to the location of the new call. If no new call is added the state is removed permanently and remember observers are notified.If a
movableContentOflambda is called multiple times in the same composition, new state and nodes are created for each call and, as calls leave the composition and new calls enter, the state is moved from the first leaving calls to the entering calls in the order they are called. All state not claimed by new calls is removed permanently. ( Ib4850 )FontFamilyResolveris now available viaLocalFontFamilyResolver.currentAdded
createFontFamilyResolver(context)andcreateFontFamilyResolver(context, coroutineScope)to create new FontFamily resolvers outside of compose usage.Paragraph and MultiParagraph now take
FontFamily.ResolverTextLayoutResult.layoutInput.fontFamilyResolvernow contains the resolver used for this layout, deprecatedTextLayoutResult.layoutInput.resourceLoaderas it is no longer used. ( Id5a45 , b/174162090 )Support for async and optional font loading, with fallback behavior. This path is used by Text and TextField, and exposed through FontFamilyResolver
Support for preloading fonts via
FontFamilyResolver.preloadFontFamilyResolver.setAsyncLoadContextallows setting the global coroutine context used for loading async fonts. ( I87fe8 , b/174162090 )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 seeAndroidFont.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 )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 )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 )Exposes HSV and HSL function in
Coloras non-experimental API. The Oklab color space is now public API. ( I08fb6 , b/180731008 )Deprecated
AndroidComposeTestRule.AndroidComposeStatement, which was not meant to be in public API and didn't do anything for you anyway. ( Ibc46b )Internal generated kt class rename ( Ia0b9e , b/174162090 )
Removed
FontLoadingStrategy.values( I42a9d , b/174162090 )Global font loader is now called
FontFamilyResolver. ( I4f773 , b/174162090 )Use new font loading system for desktop. ( I9ce5c , b/174162090 )
FontFamily.Resolver.resolvereturnsState<Any>( I4406c , b/174162090 )
Исправления ошибок
- 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 ) - The soft keyboard input type no longer flickers when changing focus between text fields. ( I1bf50 , b/187746439 )
Версия 1.2.0-альфа02
26 января 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha02 is released. Version 1.2.0-alpha02 contains these commits.
Изменения API
- Added
Modifier.onRotaryScrollEvent()andModifier.onPreRotaryScrollEvent()for wear devices with a rotating side button ( I18bf5 , b/210748686 ) - Add experimental
View.createLifecycleAwareRecomposerextension ( I0cde6 )
Внешний вклад
-
PointerEvent.scrollDelta.yis now inverted on Android (now it returns 1 instead of -1 if we tilt mouse wheel to the right) ( Ia9811 )
Версия 1.2.0-альфа01
12 января 2022 г.
androidx.compose.ui:ui-*:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
Изменения API
- Deprecated
FontFamily.canLoadSynchronously. This property has no semantic meaning. ( Ica5ef ) - Added identity field to
CompositionDatafor generating invariant ids in the Layout Inspector. ( Ic116e ) - Added Wear OS device ids to Preview devices list ( I93232 )
Обновления зависимостей
- Now depends on Kotlin
1.6.10.
Версия 1.1
Версия 1.1.1
23 февраля 2022 г.
androidx.compose.ui:ui-*:1.1.1 is 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.ui:ui-*:1.1.0 is 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
Версия 1.1.0-rc03
26 января 2022 г.
androidx.compose.ui:ui-*:1.1.0-rc03 is released. Version 1.1.0-rc03 contains these commits.
Исправления ошибок
- Updated to support Compose Material 1.1.0-rc03
Версия 1.1.0-rc01
15 декабря 2021 г.
androidx.compose.ui:ui-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
Исправления ошибок
- Fixed a bug that caused missing accessibility scroll actions ( I7cbfb )
-
SemanticsNodeInteraction.captureToImage()will now also work ifHardwareRenderer.isDrawingEnabled()isfalse, by enabling it for the duration of the call ( Idf3d0 )
Версия 1.1.0-beta04
1 декабря 2021 г.
androidx.compose.ui:ui-*:1.1.0-beta04 is released. Version 1.1.0-beta04 contains these commits.
Новые функции
- Updated to be compatible with Kotlin
1.6.0
Изменения API
- Cleaned up nullability in
androidx.core.view( I7078a , b/204917439 ) - Experimental APIs were added that allow users to consume PointerInputchange as a whole or check whether it was consumed or not. ( I2e59d )
- Adds support for mouse scroll wheel events in the UI layer. ( Ia14eb , b/198214718 )
- Add experimental
Modifier.composedoverloads that accept keys to compare for equality and qualify for skipping optimizations. ( Ice799 , b/205851704 ) -
ComposeNotIdleExceptionnow extends fromExceptioninstead of directly fromThrowable. Note that this means that catch clauses that were catchingExceptionmight now catchComposeNotIdleExceptions, where they wouldn't do that previously. ( I9c217 )
Исправления ошибок
- Fix text handles not moving when IME visibility changes. ( I25f2e )
Версия 1.1.0-beta03
17 ноября 2021 г.
androidx.compose.ui:ui-*:1.1.0-beta03 is released. Version 1.1.0-beta03 contains these commits.
Изменения API
- Added new modifier Modifier.onPlaced to allow placement change to be observed. Additional changes to child modifier's offset can therefore be made based on the observed placement change. ( I558fd )
- Removed
InjectionScope.flush()andInjectionScope.dispose(). Flushing of all events and disposing of the scope now happens at the end of the called perform*Input() method like before. ( I2bed8 ) - Removed
MultiModalInjectionScope.TouchandMultiModalInjectionScope.Mouse. In order to inject touch and mouse events for multi-modal gestures, you can now useMultiModalInjectionScope.touch()andMultiModalInjectionScope.mouse(), both of which accept a lambda that has the receiver scope of that modality. ( Idde18 )
Исправления ошибок
- The default value for
durationMillisinTouchInjectionScope.swipeWithVelocityis now calculated such that the swipe is feasible. ( I19deb )
Версия 1.1.0-beta02
3 ноября 2021 г.
androidx.compose.ui:ui-*:1.1.0-beta02 is released. Version 1.1.0-beta02 contains these commits.
Изменения API
- 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 )
- New animation APIs for supporting tooling. Specifically, they allow tooling to inspect the animations & their configurations in a Transitions. ( I4116e )
Внешний вклад
- Added Modifier.pointerHoverIcon ( I95f01 )
Версия 1.1.0-beta01
27 октября 2021 г.
androidx.compose.ui:ui-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
Изменения API
- Added experimental
BringIntoViewAPI that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 ) - New animation APIs for supporting tooling. Specifically, they allow tooling to inspect the animations & their configurations in a Transitions. ( I4116e )
Версия 1.1.0-альфа06
13 октября 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha06 is released. Version 1.1.0-alpha06 contains these commits.
Изменения API
- Remove
ExperimentalComposeUiApifromViewRootForInspectorandLayoutInfo.ownerViewId( I5c2e3 ) - A child-less overload for Layout was added, with improved efficiency ( Ib0d9a )
- Removed
InternalCompilerApifrom Composer methods that are required to be called cross-module ( I1aa0b ) -
SemanticsNodeInteraction.performSemanticsActionnow returns theSemanticsNodeInteractionon which the function was called. ( I9e5db ) - Added LocalInputModeManager CompositionLocal to detect TouchMode/NonTouchMode. ( I6a83c , b/175899786 )
- Added
viewConfiguration: ViewConfigurationtoLayoutInfoto allow consumers get the correct value for things like long press timeout. ( I76ca6 )- Added
viewConfiguration: ViewConfigurationtoInjectionScopeto allow tests to adjust input injection based on things like long press timeout or touch slop. - Changed default duration of long press and double tap for both touch and mouse input to be based on the values in
InjectionScope.viewConfiguration.
- Added
- Implementation of ExposedDropdownMenu based on ExposedDropdownMenuBox with TextField and DropdownMenu inside ( If60b2 )
- dismissOnOutsideClick was added to PopupProperties, replacing dismissOnClickOutside which was deprecated. The new property receives the click position and the anchor bounds, providing finer control over whether onDismissRequest should be invoked or not. For example, this can be useful to prevent anchor dismissal for touches on the anchor.
- updateAndroidWindowManagerFlags was added to PopupProperties, offering low-level control over the flags passed by the popup to the Android WindowManager. The parameter of the lambda will be the flags calculated from the PopupProperties values that result in WindowManager flags: eg focusable. The result of the lambda will be the final flags which will be passed to the Android WindowManager. By default, updateAndroidWindowManagerFlags will leave the flags calculated from parameters unchanged. This API should be used with caution, only in cases where the popup has very specific behavior requirements. ( I6e9f9 )
-
Recomposer.statehas been deprecated and replaced byRecomposer.currentStateto change its type to a StateFlow ( Ic2ab3 , b/197773820 ) - Added
flush()anddispose()toInjectionScope. Use them when you want to flush all queued up events immediately and when you want to dispose of the scope, respectively. ( Ifb73a ) - Added
performScrollToNode(matcher: SemanticsMatcher)that scrolls a scrollable container to the content that is matched by the given matcher. ( Ic1cb8 ) -
InjectionScopenow implementsDensity, allowing you to easily convert between px and dp inperformTouchInputand friends. ( I8fe1f )
Исправления ошибок
- AndroidView now propagates LocalLifecycleOwner and LocalSavedStateRegistryOwner to its view via ViewTreeLifecycleOwner and ViewTreeSavedStateRegistryOwner. ( I38f96 , b/179708470 )
- Fix WearOS SwipeToDismissBox sometimes not handling swipes. ( I9387e )
- The default time between injected input events has been changed from 10ms to 16ms. This potentially changes the outcome of tests that perform input gestures, like a specific swipe. ( I829fd )
Версия 1.1.0-альфа05
29 сентября 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.
Изменения API
- Added support for inter-modifier communication ( Id5467 , b/198826874 )
- Added experimental historical pointers to PointerEventChange. ( Ic1fd8 , b/197553056 , b/199921305 )
- Added
density: DensityandlayoutDirection: LayoutDirectiontoLayoutInfo. This allows consumers ofLayoutInfoto interpret the dimensions and position exposed inLayoutInfoproperly. ( I002f1 ) - Added experimental support for injecting mouse events. Use
performMouseInputto start sending mouse events, or send mouse events through theMouseproperty ofMultiModalInjectionScopeduring a multi modal input gesture withperformMultiModalInput. SeeMouseInjectionScopefor documentation of the available API. ( Iaa4a8 , b/190493367 )
Исправления ошибок
- Fixed accessibility support for scrollables (both lazy and non-lazy) with respect to scrolling ( I6cdb0 )
- Improved
TouchInjectionScope.swipeWithVelocity. It now accepts a wider range of input variables and will suggest changes to the input if a swipe can't be created ( I40fbe , b/182477143 )
Версия 1.1.0-альфа04
15 сентября 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha04 is released. Version 1.1.0-alpha04 contains these commits.
Изменения API
-
PointerEventnow has aPointerEventTypeto support hover events. ( I091fa ) - Allow children to accept pointer input outside of parent's pointer input bounds. Parents may intercept those calls with a property PointerInputScope.alwaysInterceptChildEvents ( I9eae3 , b/192479655 )
- 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 ) - Redo implementation of inspectable ( I927bc , b/191017532 )
- Changed parameter name of inspectable to match composed ( I3a482 , b/191017532 )
Introduced
performTouchInputandTouchInjectionScopeas a replacement forperformTouchInputandTouchInjectionScope, paving the way for other modalities (like mouse).TouchInjectionScopehas the same methods asGestureScope, with the exception ofmovePointerToandmovePointerBy, which have been renamed toupdatePointerToandupdatePointerBy. All other methods are the same.The behavior of
TouchInjectionScopeis almost identical toGestureScope, with two small details:- When sending a down event while pointers had been moved without sending a move event (in other words,
updatePointerTo()has been used, but notmove(), and thendown()is called), the previous implementation would advance the event time and send a move event before sending the down event. The new implementation still sends the move event, but doesn't advance the event time in this specific scenario. - When sending an up event while pointers had been moved without sending a move event (similar as above), the previous implementation would advance the event time and send a move event before sending the up event. The new implementation does neither: the new positions of the pointers will only be reflected through the up event.
Finally,
TouchInjectionScopeintroduces a new methodcurrentPosition(pointerId: Int)to get the current position of the given pointer. ( If1191 , b/190493367 )- When sending a down event while pointers had been moved without sending a move event (in other words,
Исправления ошибок
- Allow clip to extend touch target bounds beyond the clip region for minimum touch target purposes. ( I43e10 , b/171509422 )
- Support for stretch overscroll has been added on Android 12 devices. ( Iccf3c , b/171682480 )
Версия 1.1.0-альфа03
1 сентября 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.
Новые функции
- Updated Compose
1.1.0-alpha03to depend on Kotlin1.5.30. ( I74545 )
Изменения API
- Added
Modifier.inspectablefor wrapping other modifiers. ( I1909b , b/191017532 ) - Added
BlurredEdgeTreatmentAPI to simplify blur use cases into more commonly used combinations of clip flags and TileModes. Most use cases involve either letting blurred content render outside the original content bounds and blurring regions outside these bounds with transparent black, or clipping content to content bounds sampling the closest edge for blur kernels that extend beyond content bounds. ( I6b4b7 , b/166927547 ) - Added support for RenderEffect in compose desktop. Introduced OffsetEffect as well as the blur modifier as a simple way to introduce blur visual effects to a portion of the composition hierarchy. ( I0f6aa , b/166927547 )
- Introduced RenderEffect API that can be optionally configured on a
Modifier.graphicsLayerto alter the contents of the layer itself. This can be used to blur contents of a composable and child composables within a composition hierarchy. ( I47c4d , b/166927547 ) - AwaitPointerEventScope now has withTimeout() and withTimeoutOrNull() ( I507f0 , b/179239764 , b/182397793 )
- Added minimum touch target size to ViewConfiguration for use in semantics and pointer input to ensure accessibility. ( Ie861c )
- Add TileMode.Decal support which is useful in defining edge behavior for blur based RenderEffects. ( I7e8ed , b/166927547 )
-
performScrollToIndex,performScrollToKey,hasScrollToIndexActionandhasScrollToKeyActionare now stable API ( I142ae , b/178483889 ) - Added test method to get the clipped bounds. ( I6b28e )
Исправления ошибок
- Removed isBounded method from BlurredEdgeTreatment in favor of explicitly checking if the shape parameter is null. ( I85d68 )
Версия 1.1.0-альфа02
18 августа 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.
Изменения API
- PointerEvent now has support for reading mouse button state and keyboard modifier state. ( I6310c , b/180075467 )
- Injected gestures now use the MainTestClock's time as the source of truth for time. The current time for injected events in
performGesturewill be initialized to the current time of the MainTestClock. ( Ifb364 , b/192064452 ) - Added
DpRect(DpOffset, DpSize)constructor ( I2cf16 , b/194219828 ) - Added DpSize class ( I7abb1 , b/194219828 )
Исправления ошибок
- Updated Vector graphics xml parsing to support ColorStateLists as root color tint properties on VectorDrawables. ( I86915 , b/195668138 )
Версия 1.1.0-альфа01
4 августа 2021 г.
androidx.compose.ui:ui-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
Изменения API
-
RelocationRequester.bringIntoViewnow accepts a rectangle as a parameter which enables us to bring a part of a composable into view ( Ice2c5 , b/194330245 ) -
AnimatedImageVectorand the related APIs are now in the newandroidx.compose.animation:animation-graphicsmodule. ( I60873 ) - Added experimental modifier to handle relocation requests. ( I65a97 , b/178211874 )
Introduced BrushPainter API to support drawing of an arbitrary Brush within a Painter, similar to ColorPainter
Updated Brush API to have an intrinsic size parameter that is queried within BrushPainter ( Ia2752 , b/189466433 )
Updated DrawScope#drawImage method 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 )
Added
GestureScope.advanceEventTimemethod to give more control over the timing of events in a gesture ( Ibf3e2 )
Исправления ошибок
- In order to better support chaining of draw modifiers, make sure the Modifier.paint implementation calls drawsContent. Previously Modifier.paint was expected to a leaf node in the chain of Modifiers, however, by doing so it prevents it from being configured on a composable container (ex. box) or adding additional decorations on top such as
Modifier.paint().border(). By having Modifier.paint call drawContent after drawing the contents of the given painter, we have better behavior consistency in behavior with the modifier pattern. ( Ibb2a7 , b/178201337 , b/186213275 ) - Dialogs now follow the platform sizing behaviour. Set
usePlatformDefaultWidthto false to override this behaviour. ( Iffaed , b/192682388 ) - Moved
InfiniteAnimationPolicyto :compose:ui ( I5eb09 , b/160602714 ) - Scrolling via semantics actions for lazy lists and regular scrolling components is now animated ( Id9066 , b/190742024 )
Версия 1.0
Версия 1.0.5
3 ноября 2021 г.
androidx.compose.ui:ui-*:1.0.5 is released. Version 1.0.5 contains these commits.
Исправления ошибок
- Fixed a crash tracking derivedStateOf instances. ( aosp/1792247 )
Версия 1.0.4
13 октября 2021 г.
androidx.compose.ui:ui-*:1.0.4 is released. Version 1.0.4 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.31
Версия 1.0.3
29 сентября 2021 г.
androidx.compose.ui:ui-*:1.0.3 is released. Version 1.0.3 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.30
Версия 1.0.2
1 сентября 2021 г.
androidx.compose.ui:ui-*:1.0.2 is 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.ui:ui-*:1.0.1 is released. Version 1.0.1 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.21.
Версия 1.0.0
28 июля 2021 г.
androidx.compose.ui:ui-*:1.0.0 is 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 )
Версия 1.0.0-rc02
14 июля 2021 г.
androidx.compose.ui:ui-*:1.0.0-rc02 is released. Version 1.0.0-rc02 contains these commits.
Исправления ошибок
- Dialogs now follow the platform sizing behaviour. Set
usePlatformDefaultWidthto false to override this behaviour. ( Iffaed , b/192682388 )
Версия 1.0.0-rc01
1 июля 2021 г.
androidx.compose.ui:ui-*:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.
Новые функции
- Split ui-tooling module into
ui-toolingandui-tooling-preview( Iefa28 , b/190649014 )
Изменения API
- Removed deprecated experimental
FocusManager#moveFocusInandFocusManager#moveFocusOut( I227d7 , b/170154986 , b/186567354 , b/168510304 ) - Canvas now supports a contentDescription parameter for accessibility. ( Ib547c )
-
useDefaultMaxWidthinPopupPropertieswas renamed tousePlatformDefaultWidth. ( I05710 ) - Dialogs are now able to use the entire screen width. ( I83929 , b/190810877 )
- Added experimental support for HSV and HSL color representations. ( Id7cf8 , b/180731008 )
Изменения поведения
- Compose
@Previewnow provides aLocalActivityResultRegistryOwnerthat allows you to preview Composables that use APIs likerememberLauncherForActivityResult()that depend on that owner existing. ( Ib13d1 , b/185693006 ) - Compose
@Previewnow provides aLocalOnBackPressedDispatcherOwnerthat allows you to preview Composables that use APIs likeBackHandlerthat depend on that owner existing. ( Ia1c05 , b/185693006 )
Исправления ошибок
- Moved
InfiniteAnimationPolicytoandroidx.compose.ui:ui( I5eb09 , b/160602714 ) - AnimatedImageVector was temporarily removed in order to change the module structure. ( I41906 , b/160602714 )
Версия 1.0.0-beta09
16 июня 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta09 is released. Version 1.0.0-beta09 contains these commits.
Изменения API
- Change enum Role and LiveRegionMode into inline classes with private constructor ( Id1890 )
- KeyboardCapitalization is converted into an inline class. ( Id5a1c )
- Change HapticFeedbackType to inline class. ( I255ec )
- Modifier.pointerInteropFilter is @ExperimentalComposeUiApi. ( Iede6c )
- TextAlign, FontSynthesis and TextDirection are now inline classes. ( I212fe )
- TextOverflow is changed to an inline class. ( I433af )
- FontStyle is now an inline class. ( I9e48b )
Исправления ошибок
- Key constants are @ExperimentalComposeUiApi for now. Consuming code can declare private constants prior to stabilization. ( Ia5d48 )
- Compose tests can now be run on Robolectric. The following limitations have so far been identified:
- There is no native bitmap, so
ImageBitmap()leads to a NullPointerException. - There is no drawing, so
captureToImage()will indefinitely await the next draw pass (ie it deadlocks). - There is no font loaded, so any text will be measured incorrectly. All characters have a fixed height of around 20px and width of 1px.
-
ComposeTestRule.waitUntil {}does not run the main thread while it's waiting, making it effectively the same asComposeTestRule.mainClock.advanceTimeUntil {}More limitations are expected to be identified in the future. ( I284fa )
- There is no native bitmap, so
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.
Версия 1.0.0-beta08
2 июня 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta08 is released. Version 1.0.0-beta08 contains these commits.
Изменения API
-
NestedScrollSourceenum is replaced by an inline class. ( Ie321b , b/187055290 ) -
FocusManager.clearFocus(forcedClear = true)is renamed toFocusManager.clearFocus(force = true)( Ia0c41 ) - Refactored enum usages to inline classes to avoid issues with exhaustive when statements when new enum values are added. ( I2b5eb )
- Remove
@ExperimentalComposeUiApifromPopupProperties. ( I01fa6 ) -
PointerTypewas changed from an enum to an inline class ( If5058 ) - 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 ) -
Modifier.onSizeChanged()andModifier.onGloballyPositioned()are not inlined functions anymore ( I727f6 , b/186109675 ) -
KeyboardTypeenum 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 )
-
PlaceholderVerticalAlignis converted into an inline class. ( If6290 ) - TextUnitType is an inline class now. ( I4cba9 )
-
AnnotatedString.withAnnotationfunctions are now ExperimentalTextApi instead of ExperimentalComposeApi. ( I0cd0a )- TextUnit constructor with TextUnitType is now ExperimentalTextApi instead of ExperimentalComposeApi.
Исправления ошибок
- Fixed the bug introduced in beta07 where LazyColumn/Row items were displayed partially after the scroll ( I8c9ac , b/188566058 )
- Now
detectDragGesures,detectVerticalGestures, anddetectHorizontalGestureswill consume the position change automatically, no need to call change.consumePositionChange in the onDrag callbacks ( I42fc4 , b/185096350 , b/187320697 ) - LayoutModifiers providing alignment lines was fixed. A bug causing the parent not being remeasured when the alignment lines of the children were changing was fixed. ( I4401f , b/174315652 )
-
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 )
Версия 1.0.0-beta07
18 мая 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta07 is released. Version 1.0.0-beta07 contains these commits.
Изменения API
- Added
ViewRootForInspectorinterface for use in inspector ( Ib70df ) -
SubcomposeLayoutStatenow supports setting count of reusable slots. The layout will keep up to this count slots active instead of disposing them in order to reuse the slot next time we need a new one ( Ieb981 ) - KeyEventType enum is replaced by an inline class. ( Id670a , b/187055290 )
-
FocusDirectionenum is replaced by an inline class. ( Ib6d03 , b/187055290 , b/184086802 ) - Introduces ability to hoist the SubcomposeLayout state which allows you to precompose the content into a requires slotId which would make the next measure pass faster as once we try to subcompose with the given slotId next time there will be no composition needed. ( I42580 , b/184940225 )
- Added Clip Selection Handle ( Iff80d , b/183408447 )
- Removed unused APIs related to LayoutInspector support. ( I2ac78 )
Исправления ошибок
- 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 )
-
TextGeomerticTransformandTextDecorationonAnnotatedStringwill be applied as given. ( I61900 , b/184760917 )
Версия 1.0.0-beta06
5 мая 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta06 is released. Version 1.0.0-beta06 contains these commits.
Изменения API
- Solve Conflict with Navigation Gesture ( I1145e )
-
@ComposeCompilerApino longer@RequiresOptIn( Iab690 ) - 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
- Added ownerViewId to GraphicLayerInfo ( I19f62 )
- Added Font() overloads to load fonts from assets, File and FileDescriptor ( I5d382 )
- Added accessibility API
errorthat allows to mark a node that contains invalid input ( I12997 , b/180584804 , b/182142737 ) - Added
Font()overloads to load fonts from assets, File and FileDescriptor ( I43007 ) - AnnotatedString save support to
TextFieldValue.Saver. AddedaddTtsAnnotationand withAnnotation utility functions toAnnotatedString.Builder( I8cbdc , b/178446304 ) - Added TextUnit constructor function
TextUnit(value: Float, type: TextUnitType)( I7ecce , b/178446304 )
Версия 1.0.0-beta05
21 апреля 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta05 is released. Version 1.0.0-beta05 contains these commits.
Изменения API
- Added experimental
FocusManager.moveFocus(In)andFocusManager.moveFocus(Out)( Ic5534 , b/183746743 ) - Added experimental
performTextInputSelectionAPI ( I2dcbb , b/178510628 ) -
InputEventCallbackinterface is deprecated. It was not possible to use the interface in any public API; and there was no usage of it in the code. ( I34a02 , b/184003208 ) - Deprecated
TextLayoutResult/createTextLayoutResultfunction. It is an unused public function which was added for testing. The function does not do anything usable for Compose text APIs. The function is now deprecated and will be removed later. ( I80413 )
Исправления ошибок
- 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 )
Версия 1.0.0-beta04
7 апреля 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta04 is released. Version 1.0.0-beta04 contains these commits.
Изменения API
- Rename
hideSoftwareKeyboardandshowSoftwareKeyboardonSoftwareKeyboardControllertohide()andshow()respectively.- Provide the full CompositionLocal interface for LocalSoftwareKeyboardController, allowing it to be set (especially useful in tests) ( I579a6 )
- LiveRegion accessibility API is added. If node is marked as a live region, the accessibility services will automatically notify the user about its changes ( Idcf6f , b/172590946 )
- TextOverflow.Visible is introduced. ( Ic8f89 )
Исправления ошибок
- Fixed the issue when items of
LazyColumn/LazyRowlocated on the edges were incorrectly positioned after fast fling ( Ie4d13 , b/183877420 ) -
AndroidViewBindingnow properly removes fragments inflated viaFragmentContainerViewwhen theAndroidViewBindingis removed from the compose hierarchy. ( Ib0248 , b/179915946 ) -
AndroidViewBindingnow correctly nests fragments inflated viaFragmentContainerViewwhen yourComposeViewis within aFragment, fixing issues with saving and restoring the state of those fragments. ( I70eb0 , b/179915946 ) - Compose ViewBinding now depends on Fragment
1.3.2and now consistently shows fragments inflated viaFragmentContainerViewafter configuration changes. ( I0743d , b/179915946 )
Версия 1.0.0-beta03
24 марта 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta03 is released. Version 1.0.0-beta03 contains these commits.
Изменения API
- Deferred check for ViewTree dependencies of ComposeView ( I8dbbf , b/182466548 )
- Added optional
startX/endXandstartY/endYparameters toswipeUp/swipeDown/swipeLeft/swipeRightfunctions inGestureScope. ( I49e2d , b/182063305 )
Версия 1.0.0-beta02
10 марта 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.
Изменения API
- 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 ) - Removed the following
SemanticsMatchers:-
hasWidth(width, tolerance) -
hasHeight(height, tolerance) -
hasLeftPosition(left, tolerance) -
hasTopPosition(top, tolerance) -
hasRightPosition(right, tolerance) -
hasBottomPosition(bottom, tolerance)( If16bd )
-
- Marked the following
SemanticsMatchersas @ExperimentalTestApi:-
hasWidth(width, tolerance) -
hasHeight(height, tolerance) -
hasLeftPosition(left, tolerance) -
hasTopPosition(top, tolerance) -
hasRightPosition(right, tolerance) -
hasBottomPosition(bottom, tolerance)( Ia600c )
-
- Added the following
SemanticsMatchers:-
hasWidth(width, tolerance) -
hasHeight(height, tolerance) -
hasLeftPosition(left, tolerance) -
hasTopPosition(top, tolerance) -
hasRightPosition(right, tolerance) -
hasBottomPosition(bottom, tolerance)( I2f502 )
-
Исправления ошибок
- Enforce restrictions on public usage of experimental APIs ( I6aa29 , b/174531520 )
-
androidx.compose.ui:uino longer depends on AppCompat or Fragment. If you are using a ComposeView in your application, and you are using Fragment and/or AppCompat, make sure that you are using AppCompat 1.3+ / Fragment 1.3+ - these versions are needed to correctly set lifecycle and saved state owners required for ComposeView. ( I1d6fa , b/161814404 ) - Fix for broken
rememberSaveable { mutableStateOf(0) }when used inside a destination of navigation-compose. ( I1312b , b/180042685 , b/180701630 ) - Added new
LocalSoftwareKeyboardControllercomposition local API to replace previous SoftwareKeyboardController interface on TextField. ( I658b6 , b/168778053 ) - Fixed rare NoSuchElementException in
ComposeRootRegistry'stearDownRegistry()( Iddce1 )
Версия 1.0.0-beta01
24 февраля 2021 г.
androidx.compose.ui:ui-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
This is the first release of Compose 1.0.0 Beta.
Изменения API
- onStart callback has been added to
detectDragGestures( I67269 , b/179995594 ) - Modifiers for sizing to intrinsics are no longer experimental. ( I15744 )
- 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 )
- Add AccessibilityMananger interface and LocalAccessibilityMananger in CompositionLocals ( I53520 )
- Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
- Typealiases replaced by underlying types:
-
ColorStopis nowPair<Float, Color> -
SpanStyleRangeis now `AnnotatedString.Range -
ParagraphStyleRangeis nowAnnotatedString.Range<ParagraphStyle> -
StringAnnotationis nowAnnotatedString.Range<String> - ( I8dd1a )
-
- 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 )
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 )Deprecated methods from ui modules were removed ( I646f6 )
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 )
Modifier.tapGestureFilterhas been removed. UseModifier.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 )
imageResource and vectorResource are now extension functions on ImageBitmap and ImageVector companions respectively.
load{Image,Vector,Font}Resourcefunctions have been deleted. ( I89130 )AnimationClockObservable and subclasses have been removed. AnimatedFloat has been removed. ( Icde52 , b/177457083 )
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 @TestOnly top 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 )
ComponentActivity.setContent()was removed from compose:ui. Use the one fromandroidx.activity:activity-compose:1.3.0-alpha01.viewModel()andLocalViewModelStoreOwnerwere removed from compose:ui. Use the ones fromandroidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha01( I6f36b )Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )
CustomEvens support from PointerInputModifier has been removed ( I02707 , b/175294473 )
SnapshotStateObserver is not Experimental anymore ( Id2e6a )
Deleted some previously deprecated APIs ( Ice5da , b/178633932 )
longPressGestureFilter and doubleClickGestureFilter have been removed. use Modifier.pointerInput with helper functions eg detectTapGestures ( I2fedf , b/175294473 )
Removed String.format API refactored usages in various toString methods to not leverage String.format internally. ( Id1290 )
Removed dp assertions ( I798d2 )
Removed androidx.compose.runtime:runtime-dispatch ( I55feb )
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 )
FlingConfig has been renamed to FlingBehavior now allows for customization of suspend animation rather than predefined Decays. ( I02b86 , b/175294473 )
Added a helper function that is helpful to set the same action for all ImeAction callbacks ( I63447 , b/179226323 )
Removed SoftwareKeyboardController callback from all text fields to be replaced by a new API shortly. ( Iae869 , b/168778053 )
FontSpan and FontWeigthStyleSpan are no longer used and removed. ( Ie5b56 , b/177423444 )
Made the following Material API changes:
- Added contentPadding parameter to Top/BottomAppBar to allow customizing the default padding.
- Reordered parameters in BackdropScaffold to follow API guidelines for required parameters being before optional parameters.
- Moved
iconparameter in BottomNavigationItem to be afterselectedandonClick. - Renamed
alwaysShowLabelsparameter in BottomNavigationItem toalwaysShowLabel. - Renamed
bodyContentparameters in a few components to justcontent. - Reordered parameters in
ButtonDefaults.buttonColors(). Please note that because the type of the parameters have not changed, this will not cause an error in your code - please ensure you are either using named parameters or update the ordering manually, otherwise your code will not work the same as previously. - Added
secondaryVariantparameter todarkColors(). This color is typically the same assecondaryin dark theme, but adding for consistency and further customization. - Removed ElevationDefaults and animateElevation() from the public API surface since they were not commonly used / useful.
- Renamed
onValueChangeEndinSlidertoonValueChangeFinishedand made it nullable. - Renamed
textparameter inSnackbartocontentfor consistency. - Added
contentPaddingparameter toDropdownMenuItemto allow customizing the default padding and madecontentbe an extension onRowScope. - Renamed
ModalDrawerLayouttoModalDrawer. - Renamed
BottomDrawerLayouttoBottomDrawer. - ( I1cc66 )
Исправления ошибок
- Added API to use AnimatedVectorDrawable resources in Compose. Use animatedVectorResource to load an
<animated-vector>XML as an AnimatedImageVector and animate it with painterFor ( I8ea91 ) - Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I658b6 , b/168778053 )
Версия 1.0.0-альфа12
10 февраля 2021 г.
androidx.compose.ui:ui-*:1.0.0-alpha12 is released. Version 1.0.0-alpha12 contains these commits.
Изменения API
- Support for ViewGroups was removed from UiApplier. The Deprecated emitView composables were removed. ( Ifb214 )
- Modifier.pointerInput now requires remember keys to indicate when the pointer input detection coroutine should restart for new dependencies. ( I849cd )
- CompositionReference renamed to CompositionContext ( I53fcb )
- Bounds has been renamed to DpRect ( I4b32a )
- Testing update: hasText() will check for both input and label/hint/placeholder texts in the text field ( Iab803 )
- viewModel() composable and LocalViewModelStoreOwner were moved to androidx.lifecycle.viewmodel.compose. You will now need to add a separate dependency androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha01 in order to use it. ( I7a374 )
- Allow nullable action in AccessibilityAction, change action label in AccessibilityAction and CustomAccessibilityAction from CharSequence to String ( I0dc82 )
- 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 )
- Added an
Modifier.focusOrder()that accepts a FocusRequester without specifying a custom focus order a lambda. This is useful when we only need to specify a reference but not a custom focus order for a composable ( I4f52a , b/179180978 ) - 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 )
- Moved Popup to be platform specific. AndroidPopupProperties has been renamed to PopupProperties, and
isFocusablehas been moved to afocusableparameter inPopupProperties( Ieeea5 ) - Moved Dialog to be platform specific. Renamed AndroidDialogProperties to DialogProperties. ( I4ef69 , b/179138130 )
- Made LayoutNode internal ( I8a7b1 , b/175103944 )
- Constraints.enforce was replaced with Constraints.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 )
- Made OwnerLayer/OwnerScope/OwnerSnapshotObserver internal ( I4ffaf , b/175103944 )
- toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )
- IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )
- Snapshot API was updated to be more consistent with API guideline as well as hiding internal implementation classes from the public API. ( Id9e32 )
- Added expand and collapse semantics actions. Added expand and halfExpand in ModalBottomSheetState ( Ib5064 )
- 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 )
- The deprecated BaseTextField is now removed. Use BasicTextField instead. ( I71368 )
- 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 hasstateSaverparameter. 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 )
-
emptyContent()and(@Composable () -> Unit).orEmpty()utilities have been deprecated as they no longer have any positive performance impact or value ( I0484d ) -
snapshotFlowandwithMutableSnapshotare no longer experimental ( I6a45f ) - 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 )
- UiSavedStateRegistry was renamed to SaveableStateRegistry, AmbientUiSavedStateRegistry was renamed to AmbientSaveableStateRegistry and both moved to androidx.compose.runtime.saveable package. ( I30224 )
- 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 )
- Outline.* classes are not data classes anymore ( I4879e , b/178001427 )
- Removed
view.captureToImage()without any replacement. ( I7fcd2 ) - Introduced ColorMatrix API used to modify rgb values of source content Refactored ColorFilter API to be an interface and match the implementation of PathEffect. ( Ica1e8 )
- Add layoutDirection param to Shape's createOutline. This allows to create layout direction aware shapes. ( I57c20 , b/152756983 )
- onImeActionPerformed is deprecated. use KeyboardActions instead ( If0bbd , b/179071523 )
- 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 ) - canDrag has been removed from the Modifier.scrollable. ( Id66e7 , b/175294473 )
- Renamed LayoutCoordinates.parentCoordinates to LayoutCoordinates.parentLayoutCoordinates to allow for a new parentCoordinates property. The parentCoordinates property now offers the parent modifier's LayoutCoordintes. This will make for more complete use cases for onSizeChanged() and onGloballyPositioned() ( Idfbfd , b/177926591 )
- tapGestureFilter, doubleTapGestureFilter, longPressGestureFilter and pressIndicaitonGestureFilter have been deprecated. Use Modifier.clickable or Modifier.pointerInput with detectTapGestures function instead. ( I6baf9 , b/175294473 )
- SaveableStateRegistry's unregisterProvider was removed. Instead registerProvider() now returns SaveableStateRegistry.Entry object which you can use to unregister ( Ic4274 , b/178583739 )
- rememberSavedInstanceState() was renamed to rememberSaveable() and moved to androidx.compose.runtime.saveable package. ( I1366e , b/177338004 )
- Removed CoreText and CoreTextField from public API
- Removed deprecated SelectionContainer overload
- ( I99c19 )
- Tests in which Compose is used in hierarchies that are added/removed directly to the WindowManager are now more stable. ( Ie81ed , b/175765614 )
- 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 )
- Saver, listSaver(), mapSaver(), autoSaver was moved from androidx.compose.runtime.savedinstancestate to androidx.compose.runtime.saveable ( I77fe6 )
- EditCommands accept AnnotatedString. However this is an API only change and multi-style text editing is not implemented yet. ( I4c3ea )
- Uptime and Duration have been removed. ( Ib9bf4 , b/177420019 )
- CompositionData.asTree() and related APIs moved to separate ui-tooling-data module and marked as experimental ( Ic95b8 )
- 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 )
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 )
Remove unintentionally public StringBuilder.deleteAt function ( Id6ed9 )
Исправления ошибок
- ComposeViews placed in view hierarchies that are children of another composition now host child compositions of their ancestors ( I92883 )
- Updated compose's imageFromResource API to reuse the resource drawable cache when loading ImageBitmap objects. ( If3627 , b/178751994 )
Версия 1.0.0-альфа11
28 января 2021 г.
androidx.compose.ui:ui-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.
Изменения API
- WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
- Key.DPadUp is deprecated. Use Key.DirectionUp instead. ( Iab335 , b/177954892 )
- Owner interface from now on internal. ( If8e35 )
- Added FocusManager.moveFocus() API to move focus programmatically. ( I045cb , b/177681839 )
- Changes PopupPositionProvider to use window-relative coordinates, not global coordinates. Renames parentGlobalBounds to anchorBounds, and changes windowGlobalBounds to be windowSize: IntSize ( I2994a )
- 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 )
- AmbientSavedStateRegistryOwner was added similarly to already existing AmbientLifecycleOwner and AmbientViewModelStoreOwner ( I9a3e8 , b/176756365 )
- Updated vector graphics API to support parsing of tinting applied to the root of vector graphics. ( Id9d53 , b/177210509 )
- Added toolType to PointerInputChange to differentiate devices ( Iac787 , b/175142755 )
- AmbientWindowManager is renamed to AmbientWindowInfo ( I2686a , b/177084714 , b/177084983 )
- Deprecated global coordinates methods and made new window-based coordinates methods. ( Iee284 )
- Added Modifier.toolingGraphicsLayer which adds a graphics layer modifier when inspection is turned on. ( I315df )
- 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 )
- 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 )
- Updated GraphicsLayerScope implement density to support conversions of dp into raw pixels. ( Ied528 , b/176819695 )
- Updated matrix API to follow row major ordering and provide index constants to assist with conversions between different matrix representations to match framework conversion logic between SkMatrix and Matrix4 internally. ( I432e6 )
- Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )
- Move String.fintPrecedingBreak and String.fingFollowingBreak to InternalTextApi. ( I657c4 )
- androidx.compose.ui.util.isSurrogatePair has been removed from public API. ( Ia9494 )
- Renamed TransformedText.transformedText to TransformedText.text
- TransformedText is no longer a data class ( Ie672a )
- Removed
data classfrom the following classes:- InlineTextContent
- LocaleList ( I605c7 )
- The following classes are not data classes anymore:
- Аннотированная строка
- Стиль абзаца
- SpanStyle
- TextStyle
- FontWeight
- TextDecoration
- TextGeometricTransform
- TextIndex
- TextLayoutResult
- TextLayoutInput ( Iaff99 )
- Changed VisualTransformation to be a functional interface ( I3bba4 )
- Added a function reference parameter type ( I5e1bd )
- Add transformed bounds to InspectorNode ( Ice42f )
Исправления ошибок
- onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
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 )
Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )
Remove displaySize as it should be avoided. Typically it is better to use size of onRoot() or window size at least. ( I62db4 )
OnSizeChanged was reporting the size of the layout's contents. It now reports the size at its position within the modifier chain. ( I36b78 , b/177562900 )
The emit() API and all overloads have been deprecated and renamed to ComposeNode. The APIs are identical, just a different name in order to follow the naming conventions of Compose ( I4137b )
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 )
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 )Deprecated arithmetic operations between 2 or more TextUnits. Deprecated TextUnit.Sp and TextUnit.Em functions in preference to the extension functions such as Int.sp and Int.em. ( I48369 )
Resources in libraries with no explicitly declared public resources (ex. via public.xml) are now private by default. ( Ia1dcc , b/170882230 )
ScrollableColumn/Row were deprecated. Using ScrollableColumn is less efficient compared 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 the 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)anditemsIndexed(Array)( I803fc , b/175562574 )Please use ImeAction.None instead of ImeAction.NoAction
- Please use ImeAction.Default instead of ImeAction.Unspecified ( Ie1bcc )
Leverage TestCoroutineDispatcher in testing ( I532b6 )
Renamed TextInputService.onStateUpdated as updateState ( Id4853 )
TransitionDefinition-based Transition has been deprecated ( I0ac57 )
TextUnitType.Inherit is removed. Please use TextUnitType.Unspecified instead. ( I9ff64 )
Версия 1.0.0-альфа10
13 января 2021 г.
androidx.compose.ui:ui-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.
Критические изменения
Restructuring of the internal compiler API allows batching changes to the nodes generated as a result of composition into the "apply changes" phase of composition, after all
@Composablefunctions have completed.This is a behavioral breaking change that might affect application code as nodes are no longer available from internal and experimental APIs until after changes have been applied. This can usually be worked around by surrounding code with such dependencies in a
SideEffectcomposable to defer execution of the code until after the nodes have been created and initialized. ( I018da )
Изменения API
- Added Modifier.focusOrder() that can be used to specify a custom focus traversal order ( I90cf5 , b/175899543 , b/170155556 , b/170155429 )
- Removed deprecated focusObserver use onFocusChanged or onFocusEvent instead ( I3ecb9 , b/175156387 )
- 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 )
- Removed unused PxSquared, PxCubed, PxInverse. Changed Size.center() to be a property. ( I973f7 )
- ui-test module will now be able to configure the creation of Recomposers for UIs under test ( Ibebd8 )
- Modified Velocity to have component parts and mathematical operations. ( Ib0447 )
- Renamed
@ExperimentalTestingto@ExperimentalTestApito be consistent with similar experimental api annotations ( Ia4502 , b/171464963 ) - Renamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
- Removed unused DpInverse, DpSquared, and DpCubed classes. ( I4d62b )
- Constraints#satisfiedBy was renamed to isSatisfiedBy. ( I9cf5c )
- Add a callback to notify Owner when layoutnode bounds change. ( I72fd1 )
- Added isSpecified, isUnspecified, and useOrElse for inline classes with an Unspecified constant. ( I93f7b , b/174310811 )
Expand [Abstract]ComposeView APIs to allow recycling Compose-based views, disposing their composition to recreate again later. Add APIs for installing and discovering window-scoped Recomposers and CompositionReferences for creating child compositions.
Add ViewCompositionStrategy for configuring the composition disposal strategy of [Abstract]ComposeViews; default behavior is dispose on window detach. ( I860ab )
Removed Any.identityHashCode() public api ( I025d7 )
Removed toStringAsFixed API in favor of using String.format instead directly. ( Iaba6b )
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 )
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 )
Introduced Outline.bounds property to obtain the bounding rect for various outline implementations. ( I16e74 , b/175093504 )
Deprecated TestUiDispatcher. Use Dispatchers.Main instead ( Ic171f , b/175385255 )
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 )
Renamed Position to DpOffset and removed getDistance() ( Ib2dfd )
Changed fun Dp.isFinite() to a val Dp.isFinite ( I50e00 )
Исправления ошибок
- Recomposer now exposes a Flow of its current state, allowing monitoring its activity and the activity of associated effects. ( Ifb2b9 )
- The native keyEvent can now be accessed through keyEvent.nativeKeyEvent ( I87c57 , b/173086397 )
-
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 )
- New coroutine-based API
Animatablethat ensures mutual exclusiveness among its animations.- New DecayAnimationSpec to support multi-dimensional decay animation
- ( I820f2 , b/168014930 )
Версия 1.0.0-альфа09
16 декабря 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.
Изменения API
- Deprecated KeyEvent.Alt is now removed. Use KeyEvent.isAltPressed instead. ( Idd695 )
- Modifier.keyInputFilter and Modifier.previewKeyInputFilter are deprecated use Modifier.onKeyEvent and Modifier.onPreviewKeyEvent instead ( Idbf1b , b/175156384 )
- Modifier.focusObserver is deprecated. Use Modifier.onFocusChanged or Modifier.onFocusEvent instead ( I30f17 , b/168511863 , b/168511484 )
- For suspending pointer input APIs, renamed HandlePointerInputScope to AwaitPointerEventScope and handlePointerInput() to awaitPointerEventScope(). ( Idf0a1 , b/175142755 )
- 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 )
- Custom events were removed from suspending pointer input API ( Ia54d5 , b/175142755 )
- Introduced several new functions in SelectionRegistrar and also renamed onPositionChange to notifyPositionChange. ( Ifbaf7 )
- More members of LayoutNode we marked as internal ( I443c6 )
- LayoutInfo was introduced to be used by tooling and testing ( I9b190 )
- AndroidOwner made internal ( Ibcad0 , b/170296980 )
- Removed ExperimentalPointerInput annotation ( Ia7a24 )
- Nested scroll system added. Refer to Modifier.nestedScroll for more details ( I36e15 , b/162408885 )
- subcomposeInto(LayoutNode) was made internal ( Id724a )
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 dismissOnBackPress and dismissOnClickOutside properties to AndroidDialogProperties. These allow configuring when the dialog's onDismissRequest lambda will be invoked. ( If5e17 )
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 Modifier.clearAndSetSemantics to clear descendants' semantics and set new ones. ( I277ca )
Moved ContentDrawScope to ui-graphics module to be with DrawScope. ( Iee043 , b/173832789 )
Introduced PathEffect graphics API to provide different patterns to stroked shapes. Deprecated usage of NativePathEffect in favor of expect/actual implementation of PathEffect. ( I5e976 , b/171072166 )
Added IdlingResource interfaces to Compose, as a Compose supported variant of Espresso's idling resources. They can be registered and unregistered through the ComposeTestRule ( I433f3 )
Removed global (un)registration of ComposeIdlingResource and global (un)registration of clocks into ComposeIdlingResource ( I32660 )
Исправления ошибок
- 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 )
Deprecate LazyColumnFor, LazyRowFor, LazyColumnForIndexed and LazyRowForIndexed. Use LazyColumn and LazyRow instead ( I5b48c )
Deprecated BuildCompat.isAtLeastR ( Idb37e )
Added buildAnnotatedString factory function in order to build an AnnotatedString. Deprecated annotatedString builder function. ( Idfe0b )
Removed extension methods on Float and Double to convert values to radians. Moved to be a private function within the implementation PathParser which was the only place where it was used ( I25f52 )
Версия 1.0.0-альфа08
2 декабря 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha08 is released. Version 1.0.0-alpha08 contains these commits.
Изменения API
- Add semantics action Dismiss ( I2b706 )
- 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 feedback. ( I0bd29 , b/173834241 )
- New methods placeable.placeWithLayer() and placeable.placeRelativeWithLayer() were added which allows custom layouts and layout modifiers to place a child with introducing a graphics layer for their drawing. Having that we can first optimize redrawings, so when we need to move a child we don't have to redraw its content, second we can apply draw transformations for a child ( Ibd8f6 , b/170296989 , b/171493718 , b/173030831 )
-
<T>was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 ) - Added Modifier.scale/rotate APIs as conveniences for drawLayer.
- Renamed
Modifier.drawOpacitytoModifier.alpha - Renamed
Modifier.drawShadowtoModifier.shadow( I264ca , b/173208140 )
- Renamed
- 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 )
- Added WindowManager.isWindowFocused to check if the host window is in focus, and a WindowFocusObserver that provides an onWindowFocusChanged callback. ( I53b2a , b/170932874 )
- Updated TransformOrigin API to have destructuring syntax to return
pivotFractionXandpivotFractionYascomponent1andcomponent2( If43c4 , b/173586560 ) - 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 ) - Added API to check if Alt, Ctrl, Meta or Shift modifier keys were pressed when a keyevent was dispatched. ( I50ed9 )
- Added a new
Modifier.drawLayer()overload. It takes a lambda block on a new GraphicsLayerScope where you define the layer parameters in a way which allows to skip recomposition and relayout when the state change happens. DrawLayerModifier is now internal in preparation to migrating its logic into placeable.placeWithLayer() method of LayoutModifier ( I15e9f , b/173030831 ) - Deprecated Ambients named with
Ambientas their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 ) - Moved
androidx.compose.ui.text.Typefacetoandroidx.compose.ui.text.font.Typeface( Ic2b81 ) - Semantics argument mergeAllDescendants was renamed to mergeDescendants. ( Ib6250 )
- 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 guidelines. Added typealias of VectorAssetBuilder to link to ImageVector.Builder for compat. ( Icfdc8 )
- Renamed ImageAsset and related methods to ImageBitmap. ( Ia2d99 )
- Add zIndex param for the PlacementScope's place() so Modifier.zIndex() now works as a LayoutModifier and any custom layout can set zIndexes for their children right in the placement block ( I711f7 , b/171493718 )
- Moved foundation semantics properties to ui ( I6f05c )
- Deprecate place(Offset) and placeRelative(Offset). Use overloads with int offsets instead ( I4c5e7 )
- Previously Deprecated APIs were removed: Modifier.onPositioned was removed, use Modifier.onGloballyPositioned. Modifier.onDraw was removed, use Modifier.onDrawBehind. Modifier.plus was removed, use Modifier.then. Color.Unset was removed, use Color.Unspecified. PxBounds class was removed, use Rect instead. ( Ie9d02 , b/172562222 )
- The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
- 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 )
-
idwas renamed tolayoutIdforLayoutIdParentData.Measurable.idwas renamed toMeasurable.layoutId. ( Iadbcb , b/172449643 ) - New multitouch gesture detector, including helpers for detecting rotation, zoom, and panning. ( Ic459d )
- Introduced SweepGradientShader and SweepGradientBrush APIs. ( Ia22c1 )
- Time control in tests (TestAnimationClock and its usages) is now experimental ( I6ef86 , b/171378521 )
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 )
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 )
Provide default implementations of methods and properties in AnimationClockTestRule that can be delegated to its
clock( I7ea3d , b/173399709 )AndroidComposeTestRule can now accept custom activity launchers ( Ib8288 , b/153623653 , b/154135019 )
TextLayoutResult.getLineVisibleEnd is deprecated. As a replacement TextLayoutResult.getLineEnd now has a new parameter visibleEnd. ( I73282 )
Updated TextFieldValue API
- made TextFieldValue.composition readonly
- removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
Support TtsAnnotation for text to speech engine. ( I54cc6 )
New APIs for running animations in coroutines ( Ied662 )
Исправления ошибок
- 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 resetInput parameter to TextInputService#onStateUpdated ( I3e8f5 , b/172239032 , b/171860947 )
- Added lint check for Modifier parameters in Composable functions. This lint check checks the naming, return type, default value, and order of the parameter for consistency with Compose guidelines. ( If493b )
- Temporarily added option to let the TestAnimationClock be driven by the MonotonicFrameClock ( I1403b , b/173402197 )
- 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 factory functions are defined as extensions on Modifier, so they can be fluently chained together. ( I07981 )
- Remove old ui-test module and its stubs ( I3a7cb )
- Recomposer no longer accepts an EmbeddingContext; required scheduling dependencies are obtained from the effectCoroutineContext. FrameManager is deprecated; platform integrations should initialize their own global snapshot handling. ( I02369 )
- Pass style information to accessibility node. ( If5e8d )
- TextUnit.Inherit is renamed to TextUnit.Unspecified for consistency with other units. ( Ifce19 )
Compose UI Version 1.0.0-alpha07
11 ноября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha07 is released. Version 1.0.0-alpha07 contains these commits.
Изменения API
- 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 )
- The BiasAlignment and BiasAbsoluteAlignment factories for creating Alignments were added. ( Iac836 , b/169406772 )
- Allow a developer to forcefully clear focus. ( I90372 )
- A bug causing elevation not being drawn for Views inside Compose was fixed. ( If7782 )
- Created onDrawBehind API within ContentDrawScope to match naming convention with Modifier.drawBehind. ( I4fc3a , b/171955269 )
- Add support for camera distance to complement 3d transformations rotationX/rotationY on layer APIs. ( I40213 , b/171492100 )
- Added SelectionContainer without the callback ( Ibfadb )
- ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
- FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
- Removed opacity from drawShadow() modifier as it was confusing. ( I82c62 , b/171624638 )
- 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 )
- Removed Deprecated FocusState2 ( I686cb , b/168686446 )
- ZIndexModifier is now internal ( I1808b , b/171493718 )
- Updated return type of lerp method on Size parameters to return a non-null Size to avoid unnecessary boxing. ( Ib0044 )
- Added TestMonotonicFrameClock for testing code that relies on Compose's MonotonicFrameClock for awaiting composition frame events using kotlinx-coroutines-test's runBlockingTest ( I4402f )
- Removed GestureScope.localToGlobal ( I15299 , b/171462785 )
- Added
onAllNodesWithSubstringfinder ( I81dd7 , b/171462889 ) - androidx.ui.test module deprecated. Please migrate to androidx.compose.ui.test and androidx.compose.ui.test.junit4 ( I452e8 )
Исправления ошибок
- captureToBitmap moved to captureToImage. ( I86385 )
- 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 )
- Update TextFields to accept KeyboardOptions ( Ida7f3 )
- Rename KeyboardOptions as ImeOptions ( I82f36 )
- Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
- provideDefault was added as an alternative for providing ambients, and it can be used to specify ambient values that will only be set when there is no ambient value already provided. ( Id6635 , b/171024925 )
- BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
- Introduce ui-test-junit4 module ( Ib91f8 )
-
relativePaddingFromwas renamed topaddingFrom. ThepaddingFromBaselinemodifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 ) - LaunchedTask was renamed to LaunchedEffect for consistency with the SideEffect and DisposableEffect APIs. LaunchedEffect with no subject params is not permitted in order to encourage best practices. ( Ifd3d4 )
- Introduced resources composable that recomposes when the configuration updates. ( I6387c , b/167352819 )
- Recomposer now requires a CoroutineContext at construction ( Ic4610 )
- Sum
zIndexvalues when multipleModifier.zIndex()applied. Previously the first one was winning. ( Ic514c , b/170623936 ) - Changes to the internal SlotTable implementation which should not affect the public API. ( If9828 )
- Added Keyboard auto correct IME Option ( I57b8d )
- androidx.ui.test moved to androidx.compose.ui.test ( I9ffdb )
- Removed KeyboardOptions.toImeOptions from public API. ( Ic2e45 )
Внешний вклад
- Disabled publication of internal artifact androidx.compose.ui:ui-text-android ( Ib93fa )
Версия 1.0.0-альфа06
28 октября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha06 is released. Version 1.0.0-alpha06 contains these commits.
Изменения API
- Recomposer is now a CompositionReference and a valid composition parent. Explicit Recomposer is now required in fewer places. ( I4036f )
- Deprecate VectorPainter in favor of rememberVectorPainter to better indicate that the composable API internally leverages 'remember' to persist data across compositions. ( Ifda43 )
- Updated Modifier.drawWithCache API to expose ContentDrawScope as a receiver scope instead of DrawScope in order to provide implementations the ability to re-order drawing commands. This is useful for blending/ tinting use cases in which content pixels must be rendered first in order for the corresponding blend mode algorithm to be applied properly. ( Ie7ec8 )
- Move SimpleContainer into PopupTestUtils.kt ( I78c57 )
- ConsumedData is no longer a data class. See https://android-review.googlesource.com/c/platform/frameworks/support/+/1455219 for details ( I1737f )
- Fix Rtl Handle Position. ( I6e1e0 )
- Refactored DrawScope and ContentDrawScope to be interfaces instead of abstract classes
- Created CanvasDrawScope implementation of DrawScope
- Refactored implementations of DrawScope to use CanvasScope instead
- Created DrawContext to wrap dependencies for DrawScope
- Removed deprecated methods on DrawScope ( I56f5e )
- 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 fromPointerInputFilter.onPointerEvent(...), now you can just mutate the consumption data of the PointerEvents passed in. ( I6acd0 ) - MeasureScope and IntrinsicMeasureScope were made interfaces. ( I1a087 , b/170461665 )
- The merge function for AlignmentLine was hidden. ( I9da1a , b/170612900 , b/170611568 )
- Add ability to specify inspector info in composed modifier ( Idee08 , b/163494569 )
- Added SelectAll option into selection menu ( Ief02b )
- Updated DrawTransform.rotate to take a default pivot parameter of center to match the documentation.
- Updated DrawScope.rotateRad to consume an Offset for the pivot point to match other transformation methods.
- Deprecated DrawScope.rotateRad overload that consumed floats for the x and y coordinate of the pivot.
- ( Iffcbb , b/170434992 )
Исправления ошибок
- API lint check for MissingGetterMatchingBuilder is enabled for androidx ( I4bbea , b/138602561 )
- Add test. ( I6b8ae )
- Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. ( If0de3 )
- Added KeyboardCapitalization IME Option ( I8ac38 )
- Added single line keyboard option to CoreTextField ( I72e6d )
- Move SimpleContainer into PopupTestUtils.kt ( I65c3e )
- 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 )
- Improved Android interop by continuing to send MotionEvents to child Android Views that return false for onTouchEvent for all actions except
ACTION_DOWN( I94c5a , b/170320973 ) - Box was made an inline function. ( Ibce0c , b/155056091 )
Внешний вклад
- Support different locales for
AnnotatedString.capitalizeandAnnotatedString.decapitalize( I4aa7f )
Версия 1.0.0-альфа05
14 октября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha05 is released. Version 1.0.0-alpha05 contains these commits.
Изменения API
- Add a DSL for specifying inspector information ( Ic9a22 )
- Move LongPress into Text. ( Iff2bc )
- Experimental Modifier.pointerInput suspending input modifier ( Ia77d2 )
- Added Copy/Paste/Cut accessibility actions ( I6db4f )
- Public constructor for AndroidOwner was removed ( Iacaef )
- Popups and dialogs now inherit FLAG_SECURE from parent Window. Also added option to configure this explicitly ( I64966 , b/143778148 , b/143778149 )
Consumption data is now mutable. Also calls to extension functions that do consumption now no longer return a new PointerInputChange, but instead mutate the provided PointerInputChange.
This is the first step in a 2 step process to make PointerEvent data mutable such that other pointer data cannot be edited by user code. The second step will be to remove the
List<PointerInputChange>return type fromPointerInputFilter.onPointerEvent(...). ( Id067e )Disable Selection in Text, and a Demo. ( Ie7e97 )
Made onGloballyPositioned an inline function ( I15830 )
OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )
The hasPendingMeasureOrLayout property was added to Owner, telling whether the Owner has any pending layout work. ( I3d9f8 , b/169038599 )
Added API to programmatically clear focus ( Ie1dc2 , b/161487952 )
Removed
PointerInputFilter.onPointerInput(...).PointerInputFilter.onPointerEvent(...)should be used in its place. ( I6f04a )Changes to Size
- Removed Size.getFlipped
- Removed Size.rem
- Removed Size.truncDiv ( Ief44d , b/169790720 )
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 )
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 )
The scope parameter within AnnotatedString.Builder.addStringAnnotation is renamed to tag for API consistency. ( I7c8cb )
Исправления ошибок
- The scrolling performance of LazyColumn/Row is improved by doing less work in subcomposition on every scroll. The new hasInvalidations() method was added for Composition class. hasPendingChanges() method from Recomposer was renamed to hasInvalidations() ( Ib2f32 , b/168293643 , b/167972292 , b/165028371 )
- 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 )
- The order of place() calls in custom Layouts now defines the drawing order for the children ( Ibc9f6 )
- Support AnnotatedString to SpannableString conversion for accessibility. ( Ief907 )
- Added stubs for android classes that are on older platforms to avoid use of reflection when possible. ( Ia1790 )
- Fixed bug: If the software keyboard showing caused the app to translate, pointer input coordinates would become incorrect. ( Ic4cec , b/163077821 )
Версия 1.0.0-альфа04
1 октября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.
Изменения API
- Added OwnerScope to allow collection of layout and drawing observation scopes once they are no longer valid. ( Ic4cf8 )
- Added OnRemeasuredModifier and onSizeChanged() to receive a callback when content layout has been remeasured and the size has changed, respectively. ( I657cf , b/154108792 )
- Add long click semantics action ( I6281b , b/156468846 )
- Made FocusManager private. ( I7872f )
Updated implementation to create a dedicated DrawCacheModifier implementation instead of adding optional properties on DrawModifier.
Updated documentation for various methods ( Ibd166 )
Make TextRange inline to avoid object creation. ( Id034b )
PlacementScope#parentWidth and PlacementScope#parentLayoutDirection can no longer be read from the placement block of a custom layout. ( Icc1ae , b/168295623 )
add AccessibilityScrollState to semantics properties. ( Ifeda9 )
Introduced Modifier.drawWithCache to support creating a drawing object that conditionally recreates dependencies that depend on size/state information ( I376dc )
ParagraphConstraints is removed. Width is directly passed to Paragraph now. ( Ica712 )
Исправления ошибок
- 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 )
- foundation.Box was deprecated. Please use foundation.layout.Box instead. ( Ie5950 , b/167680279 )
- Stack was renamed to Box. The previously existing 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 )
- 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 )
- Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc ( I554eb , b/168308412 )
- Remove SelectionContainer from the Top to disable default selection and avoid unexpected behavior. One can specifically use a SelectionContainer to wrap the content that needs to be selectable instead. ( I8dfe0 , b/158459594 )
Версия 1.0.0-альфа03
16 сентября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.
Изменения API
- Remove scroll forward/backward semantics actions. Added steps in AccessibilityRangeInfo. ( Ia47b0 )
- Removed
onInvalidate()fromOwner--OwnedLayerhandles invalidation. ( Ica72b , b/162061312 ) Removed operator methods on Size API that consume Offset parameters. The result of these operations is unclear and the type of result is unexpected for these. Ex. should size - offset return an offset or a size result with the difference?
Also removed deprecated methods on Size class. ( Iec902 , b/166514214 )
Исправления ошибок
- Fix for items of LazyColumn being incorrectly drawn sometimes, this was also causing crashes in some conditions. ( Ibcf17 , b/163066980 , b/165921895 )
- DpConstraints and APIs using it were deprecated. ( I90cdb , b/167389835 )
- Moved
createAndroidComposeRuleandAndroidInputDispatcherfromandroidx.ui.test.androidtoandroidx.ui.test( Idef08 , b/164060572 ) - Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
- Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
Версия 1.0.0-альфа02
2 сентября 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
Изменения API
- remove callback to notify Owner when layoutnode bounds change. ( If654e , b/166106882 )
- Added support for filltype parameters on vector graphics paths to support cutouts of shapes according to evenOdd or NonZero path fill rules. ( I43dd2 )
- Uptime and Velocity are now inline classes ( I48f4a )
- Duration is now an inline class ( I565eb )
- Add a callback to notify Owner when layoutnode bounds change. ( Ic40b3 )
Fixed issue where Rect function constructor with Offset and radius would create the Rect in the order of left, right, top, bottom instead of left, top, right, bottom.
Removed deprecated companion methods on Rect in favor of function constructors.
Added tests to verify methods in Rect.kt ( I08460 , b/165822356 )
Исправления ошибок
- Added MutableRect, a rectangle that can be modified. ( I71bd2 , b/160140398 )
- Matrix4 was replaced with Matrix. All other parts of vectormath package have been removed. ( Ibd665 , b/160140398 )
The calling convention for composable functions has changed. This is a binary breaking change. All libraries must be recompiled to work with this version of the compose compiler plugin.
This change does not create a source level breaking change as the only APIs that have changed are compiler APIs that have an explicit opt in. ( I7afd2 , b/158123185 )
Fixed crash that could occur when dispatch to a PointerInputFilter could cause the PointerInputFilter to be synchronously removed. ( I58f25 )
Версия 1.0.0-альфа01
26 августа 2020 г.
androidx.compose.ui:ui-*:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.
Версия 0.1.0-dev
Версия 0.1.0-dev17
19 августа 2020 г.
androidx.compose.ui:ui-*:0.1.0-dev17 is released. Version 0.1.0-dev17 contains these commits.
Изменения API
-
emitViewwas deprecated. UseAndroidViewinstead if possible for emitting Views inside Compose. Note that composing Views and ViewGroups directly will not be supported in the future unless these are leaves in the composition tree, case when this can be achieved using AndroidView. ( I29b1e , b/163871221 ) -
FocusState2is deprecated and replaced byFocusState( Ia8b79 , b/160822876 , b/160923332 ) - The deprecated AndroidView overloads were removed. ( I946b9 , b/163802393 )
- Custom emits can now declare that one or more of its setters can be skipped and recomposed independently of the emit. ( Ibbd13 )
Changed Vector classes to no longer be data classes as the same object instance is used for composition.
Added mutableStateOf flag for VectorPainter to conditionally re-draw if contents of the vector change.
Refactored VectorComponent instance to be part of VectorPainter as it is re-used across compositions.
Updated GroupComponent and PathComponent to have their name fields be mutable ( Ieae45 , b/151378808 )
Removed
onChildPositionedandOnChildPositionedModifier. Developers should useonPositionedandOnPositionedModifieron the child layout instead. ( I4522e , b/162109766 )Offset has become an inline class ( Iaec70 )
Added a modifier param to SelectionContainer ( I4aada , b/161487952 )
Removed deprecated FocusModifier ( I0b4ba , b/160922116 , b/160821157 , b/162441435 , b/160822875 , b/160921940 )
Added
mergePolicylambda toSemanticsPropertyKey. 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 )Constraints is now an inline class ( I88736 )
Added FocusManager that moves common focus logic out of AndroidComposeView ( I528ef , b/161487952 , b/162206799 )
Updated PointerEventPass names for Alpha release. ( Ifda6f )
IntOffset is now an inline class ( Iac0bf )
IntSize is now an inline class ( I2bf42 )
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 )AlertDialog now uses FlowRow for buttons ( I00ec1 , b/161809319 , b/143682374 )
Made some test utilities non public because they are not where they belong. Will be made public in the future. ( I32ab1 )
Refactored organization of pointer input code. ( Ie3f45 )
Deprecated PxBounds in favor of Rect. Updated all usages of PxBounds with rect and added proper deprecate/replace with annotations to assist with the migration. ( I37038 , b/162627058 )
Removed Deprecated KeyEvent2. Use KeyEvent instead. ( Ied2d0 , b/162097587 )
KeyEvent has a unicode property that can be used to get the unicode character generated by the specified key and meta key state combination ( If3afc )
Made the DelayUp custom event and related classes an opt in API as it is very likely going to be changed. ( I56d6f )
Removed 2 PointerEventPasses that are no longer needed. ( I3dd9d )
Add parameter color, shadow and TextDecoration to Paragraph.paint This function is useful to avoid unnecessary Paragraph recreation. ( I81689 )
Исправления ошибок
- 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 )
Removed deprecated FrameManager calls.
Internal compose APIs have been changed to reduce the amount of overhead to track state objects such as
mutableStateof()( I80ba6 )VerticalScroller and HorizontalScroller have been removed. Use ScrollableColumn/Row instead. Modifier.drawBackground has been removed. Use Modifier.background ( I73b0d , b/163019183 )
Crash when something which saves the state was used inside the for loop is fixed. Now having the same key in savedInstanceState() is allowed, api of UiSavedStateRegistry is now adjusted to this new requirement ( I4ab76 , b/160042650 , b/156853976 , b/159026663 , b/154920561 )
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 )
Версия 0.1.0-dev16
5 августа 2020 г.
androidx.compose.ui:ui-*:0.1.0-dev16 is released. Version 0.1.0-dev16 contains these commits.
Изменения API
- OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )
- setViewContent was deprecated. setContent should be used instead. ( I7e497 , b/160335130 )
- Added the AndroidViewBinding API for inflating and composing layout resources, based on ViewBinding. ( I081c6 )
- KeyEvent2 is replaced by KeyEvent ( I2d770 , b/162097585 )
- Added support for Alt hardware key ( I9036b )
- FocusManager is Deprecated. Use Modifier.focus(), Modifier.focusObserver() and Modifier.focusRequester() instead. ( I74ae4 , b/162211322 )
- loadVectorResource supports trimPath attributes ( I808fe )
- Move dialog to ui ( I47fa6 )
- Removed 2 PointerEventPasses that are no longer needed. ( I33ca7 )
- Implemented PointerInteropModifier which provides the ability to receive MotionEvents and interact with Compose as if you are an implementation of an Android View. ( Ieb08c )
- Removed the deprecated tag modifier. Please use layoutId instead. ( Idaa05 , b/162023919 )
- 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 )
- Support path trimming in vector graphics ( Ie16c9 , b/158188351 )
- Added Modifier.layout() that allows to create a custom layout modifier conveniently ( I73b69 , b/161355194 )
- Added a new AndroidView API and deprecated the existing ones. ( I5bcfd )
- 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 ) - Add [Abstract]ComposeView View subclasses for hosting Compose content in a View hierarchy. ( I46357 )
-
RowandColumnare now inline function significantly reducing the overhead of using them. ( I75c10 ) - SubcomposeLayout is added. It is a low level primitive which allows to compose the children during the measuring if we want to use some values available only later during the measure for the subtree composition. For example WithConstraints is not implemented using SubcomposeLayout. ( I25cc8 )
- Added
SemanticsNode.positionInRootto get the position of a SemanticsNode relative to the root of the Compose hierarchy ( Icdf26 , b/161336532 ) - MotionEvents passed all the way through from Android, into Compose, and back into Android. ( I14be8 , b/158034713 )
- Removed dropdownPopup. ( I00430 )
- Fixed popup position on cut-out displays. ( Idd7dd )
- Add accessibility action to get TextLayoutResult ( I9d6e6 )
- RemeasurementModifier added. it allows 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 )
- Remove getLineEllipsisOffset/getLineEllipsisCount. Use getLineVisibleEnd/getLineEnd/isLineEllipsized instead. ( I85aa2 )
- Add some Marks/Annotations for best practice reason. ( I66b20 )
- expose more line APIs in TextLayoutResult. ( I79bd2 )
- Built-in vector converters to convert built-in units are now accessible via Foo.VectorConverter. eg Dp.VectorConverter, Color.VectorConverter, Float.VectorConverter, etc ( I3e273 )
Исправления ошибок
- 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
- Updated compose BlendMode API consumption to properly map between Android framework BlendModes and PorterDuff modes depending on API level. Introduced BlendMode#isSupported API to act as a capability query to determine if the BlendMode is supported on the device before it is used. ( I0ef42 )
- 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 )
- Removed
SemanticsNodeInteraction.performPartialGesture. UseSemanticsNodeInteraction.performGestureinstead. ( Id9b62 ) -
LazyColumnItemswas renamed toLazyColumnFor.LazyRowItemswas renamed toLazyRowFor( I84f84 ) -
foundation.shape.cornerpackage was flattened tofoundation.share( I46491 , b/161887429 ) - Renamed
AndroidComposeTestRuletocreateAndroidComposeRule. ( I70aaf ) - Added more APIs to
TextLayoutResult. ( Id7e04 ) - Material
FilledTextFieldwas renamed toTextFieldand foundationalTextFieldwas renamed toBaseTextFieldto make simplest desired API easy to discover and use ( Ia6242 , b/155482676 ) - Modifier.drawBackground has been renamed to Modifier.background ( I13677 )
Версия 0.1.0-dev15
22 июля 2020 г.
androidx.compose.ui:ui-*:0.1.0-dev15 is released. Version 0.1.0-dev15 contains these commits.
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
- 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 )
- Added a modifier to observe focus state change. ( I05866 , b/160924455 , b/160923326 )
- Added a modifier to request focus changes ( I8dd73 , b/161182057 , b/160924778 )
- Ajdust the Toolbar Menu to show copy, cut, paste properly. ( Id3955 )
- 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 ) - Added Modifier.focus which replaces FocusModifier. ( Ib852a , b/160924778 )
- Add FloatingToolbar for TextField Selection. ( Ie8b07 )
- Added an experimental api annotation for key input related API ( I53c0a )
- Added an experimental api annotation for all Focus-related API ( I53b24 , b/160903352 )
- Added FocusState2 which will replace FocusDetailedState ( I0a3ba , b/160822595 )
- Added ExperimentalFocus which is an @OptIn annotation for Focus API. ( I1544b , b/160820961 )
- An IntBounds unit class has been added, representing integer pixel bounds from layout. The API of PopupPositionProvider has been updated to use it. ( I0d8d0 , b/159596546 )
- Applier now requires a clear() method for disposing compositions ( Ibe697 )
- KeyEvent is deprecated and replaced by KeyEvent2 ( I68730 )
- A new optional flag useUnmergedTree was added to test finders. ( I2ce48 )
- Made LayoutNode experimental API ( I4f2e9 )
Added copy methods to various inline class types including:
- Компенсировать
- Размер
- Радиус
- Движение
TransformOrigin
Deprecated Size.copy companion object method favor of instance copy method ( Ife290 , b/159905651 )
Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
TextDirection is renamed as ResolvedTextDirection ( I3ff38 )
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 )
Refactor SelectionHandles for reusing. ( I420e0 )
Clickable was removed. Use Modifier.clickable ( I84bdf )
TestTag and Semantics have been deleted. Use Modifier.testTag and Modifier.semantics instead ( I15ff0 , b/158841414 )
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 )
Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )
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 )
The AndroidView composable was added a modifier parameter. ( I48a88 , b/158746303 )
Semantics() is deprecated. Use Modifier.semantics() instead. ( I72407 , b/158841414 )
Add viewModel() composable which allows to create or get already created ViewModel similarly to how it works in Activity or Fragment ( I5fdd1 )
Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )
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 )
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 )
TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )
The default, no-op, implementation of ParentDataModifier#modifyParentData has been removed - it was equivalent to not implementing the interface in the first place. ( I0deaa )
Previously deprecated ScaleFit as removed. Use ContentScale instead. ( Ifbc5b )
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 )
Added the DropdownMenu component in ui-material, a Material Design menu implementation. ( I9bb3d )
Removed deprecated LayoutTag(), please use Modifier.tag() instead. Removed deprecated Modifier.matchParent(), please use Modifier.matchParentSize() instead. ( If8044 )
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 )
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 )
DoubleTapGestureFilter now disambiguates SingleTapGestureFilter across the tree. ( If92b1 )
Updated Alignment API and added support for absolute alignment (which does not auto-mirror in Rtl context) ( I38cd3 )
DrawLayer modifiers api has been changed: outlineShape renamed to shape and has the RectangleShape default value and now non-nullable; clipToOutline renamed to clip; clipToBounds removed as it is the same as clip == true with RectangleShape ( I7ef11 , b/155075735 )
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 )
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 )
Removed deprecated LayoutModifier interface. ( I2a9d6 )
Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )
Layout and LayoutModifier children can be measured with a different layout direction. ( Ibd731 )
New Modifier.zIndex() is added to control the drawing order of the children within the same parent layout. elevation property on DrawLayerModifier is renamed to shadowElevation and doesn't control the drawing order anymore. The params order fo DrawShadow is changed: elevation is now the first one and the shape is the second one with a RectangleShape default. ( I20150 , b/152417501 )
Removed onSizeChange and onPositionChange in Owner. ( I5c718 )
Added Constraints2, a copy of Constraints that does only supports Int connstraints values rather than IntPx. IntPx will be removed and all integer constraints will be assumed to be pixels like Android.
- Added IntSize as well, which will eventually replace IntPxSize. ( I4b43a )
Made Alignment instantiable with arbitrary values. Added 1D Alignments. ( Ia0c05 )
alignToSiblings now accepts a Measured instead of Placeable. ( I5788d )
( I45f09 , b/152842521 )
- 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
Rtl support for draw modifiers. ( I0aaf9 )
Released API for inflating Android Views from XML. See ViewInCompose demo for more details. ( I42916 )
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 )
Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )
DrawLayerModifier and drawLayer() now default clipToBounds and clipToOutline to false. ( I0eb8b , b/152810850 )
Renamed LayoutResult to MeasureResult. ( Id8c68 )
Added LayoutModifier2, a new API for defining layout modifiers; deprecated LayoutModifier ( If32ac )
Replaced Modifier plus operator with factory extension functions ( I225e4 )
Added translationX/Y properties to support offseting the display list of drawing commands for a given Layer. This is useful to move content in response to animations or touch events. ( I8641c )
Added pivotX, pivotY parameters to Layer APIs to support rotation and scaling around a particular point on a layer ( Icf7c3 )
Add OnPositionedModifier and OnChildPositionedModifier to replace OnPositioned and OnChildPositioned composable functions. ( I2ec8f )
Added LayerModifier, a modifier that allows adding a RenderNode for a Layout. It allows setting clipping, opacity, rotation, scaling, and shadows. This will replace RepaintBoundary. ( I7100d , b/150774014 )
Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )
Stack component supports right-to-left directionality ( Ic9e00 )
Initial support for Rtl in Compose layout ( Ia5519 )
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 )
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 )
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 )
Removed unused MaskFilter API as it has limited usage and is not optimized for hardware acceleration in most use cases ( I54f76 )
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 )
Introduce additional optional rect parameter to ImagePainter to support drawing a subsection of underlying ImageAsset ( I0ea9e )
Added Unset Color to represent an unset value without boxing Colors. ( If901a )
Added Canvas.rotate and Canvas.scale extension methods to consume optional pivot coordinates for transformations. These default to the top left corner of the current canvas translation.
Also moved Canvas.rotateRad to be an extension method for consistency ( Ibaca6 )
Created PixelMap API to support querying pixel information from an ImageAsset. ( I69ad6 )
Renamed toFrameworkRect/toFrameworkRectF to toAndroidRect/toAndroidRectF to match naming convention for object conversions between compose and the Android framework APIs they are built on top of. Also updated docs on these APIs ( I86337 )
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 to PaintBox(Painter) Created Vector composable that behaves like the Image composable except with a VectorAsset instead of an ImageAsset ( I9af9a , b/149030271 )
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. _Body: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 )
Added TextDirection.Content ( I48f36 )
Added TextDecoration.plus operator ( I0ad1a )
Forceis removed from TextDirectionAlgorithm enum values ( Icc944 )TextDirectionAlgorithm is renamed as TextDirection ( I75ce8 )
Implements LongPressAndDrag for TextField Selection. ( I17919 )
Added AnnotatedString.getStringAnnotations that returns all annotations within the range. ( I1fa00 )
Changed the package name for Locale and LocaleList from androidx.ui.text to androidx.ui.intl ( I8132c )
TextField's cursor has a blinking animation ( Id10a7 )
API change: AnnotatedString(builder: Builder) is renamed to annotatedString(builder: Builder). ( Ia6377 )
API change: AnnotatedString.Item is renamed to AnnotatedString.Range. ( I2d44d )
Rename AnnotatedString.Builder.addAnnotationString to addStringAnnotation. ( I5059e )
Now it is possible to hide/show software keyboard by using SoftwareKeyboardController which is delivered by onTextInputStarted callback ( I8dc44 , b/151860051 )
Added plus operator for (Text/Paragraph/Span)Style which delegates to merge() function. ( Ia1add )
FontWeight.lerp does not snap anymore. It is still a data class. ( I521c2 )
FontWeight constructor is now public, it is not data class anymore. ( Id6b1f )
Add getLineStart, getLineEnd, getEllipsisOffset and getEllipsisCount to TextLayoutResult ( Ibc801 )
ui-text module is renamed as ui-text-core ( I57dec )
Removed unused Size class as there is a duplicate Size class in the ui-geometry module that is being consumed. ( I1b602 )
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 )
Add paddings, border, shape and background param to Box ( I05027 , b/148147281 )
Исправления ошибок
- 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 )
-
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 )
- Compose UI can now be composed inside ViewGroups without requiring a new composition. See ViewInteropDemo for an example. ( I9ab0b , b/160455080 )
- Added sortWith and removeRange to MutableVector ( Icccf7 )
- Implement Drag Selection Handles to change selection for TextField. ( I27032 )
- Removed Shader inline class that wrapped the NativeShader expect class Renamed NativeShader to Shader. The wrapped Shader inline class did not add anything valuable to the API surface and was an inline class, so use the NativeShader class directly. ( I25e4d )
Refactored PainterModifier to no longer provide scaling based on the given constraints and ContentScale parameter. Implementations of Painter are to scale their drawing content themselves based on the given size of the DrawScope they are drawing into.
Fixed issue where VectorPainter's cache bitmap was sized to its default size instead of the given size to draw into.
Updated ImagePainter to scale its content instead of relying on PainterModifier to do so on its behalf. ( I6ba90 )
add top-level withFrameNanos function for animation timing ( Ie34c5 )
@Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) ( Id211e )
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 )
Fixed issue where pointer input dispatch would cause a crash if PointerInputFilters were removed via subcomposition during disptach. This is now fixed. ( I1f48b , b/157998762 )
Fixed issue where pointer input dispatch would cause a crash if PointerInputFilters were removed via subcomposition during disptach. This is now fixed. ( Iab398 , b/157998762 )
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 )
The Recompose composable is no longer a useful abstraction. Most recomposition should happen as a result of MutableState assignments. For anything beyond that, it is recommended that you use the
invalidatefunction to trigger a recomposition of the current scope. ( Ifc992 )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 )
Changes the code generation strategy of Compose's compiler. Prior to the change, the compose compiler would transform calls to composable functions. With this change, we now transform the body of a composable function and leave the callsite unaltered (mostly).
This means that most of the logic communicating with the compose runtime happens at the start of the function body, instead of at the callsite.
This should be a source-compatible change for all usage of compose. Most users of compose should not have to update any code as a result of this change.
In order to support this work, the JVM signature of all composable functions has changed. A Composable function accepting a single parameter is transformed into a function accepting 3 parameters, the additional parameters are the Composer, a 'key' integer. a bitmask integer used to propagate metadata through calls.
Compose now also transforms default arguments to a composable function. It does this without introducing an additional synthetic default overload of the function itself, so this change will result in fewer functions being defined.
Known intentional behavioral changes resulting from this:
- Some calls will skip where they wouldn't have previously
- Composable expressions in default argument expressions are now correctly subscribed to and handled
This work included some optimizations: 1. The result of comparisons of parameters are propagated through the call graph to other composable functions. This will result in fewer comparisons at runtime, reduces the slot table size, as well as more skipping of composable functions that were previously not skipped 2. Paremeters which are determined to be “static” at compile time are no longer compared or stored in the runtime. This reduces the number of comparisons and reduces slot table size. 3. Control flow structure of the body of functions is used to minimize the number of groups that are generated. This reduces slot table size and results in less work for the runtime 4. Unused dispatch and receiver parameters to functions are not included in determining skippability of the function if they are not used inside of the body of the function.
Most breaking changes were for APIs that the compiler targets directly, and typical use of compose will not be affected: 1. Composer::startExpr was removed 2. Composer::endExpr was removed 3. Composer::call was deprecated 4. The non-varargs overloads of
keyhave been removed. Use thevarargversion going forward. 5. The Pivotal annotation was deprecated. Usekeyas a replacement. 6. ScopeUpdateScope::updateScope was changed to expect a Function3 instead of Function1 7. restartableFunction and restartableFunctionN were updated to include additional compile time parameters ( I60756 , b/143464846 )Removed deprecated LayoutAlign modifiers. ( I10877 )
Removed RepaintBoundary in favor of DrawLayerModifier ( I00aa4 )
Button, FloatingActionButton and Clickable now have a separate
enabledparam. Some of the params on Button were renamed or reordered. ( I54b5a )Replaced ButtonStyle with distinct functions and removed text (string) overload. See updated samples for usage information. ( If63ab , b/146478620 , b/146482131 )
Breaking changes to the ambients API. See log and
Ambient<T>documentation for details ( I4c7ee , b/143769776 )Changed the behavior of default TextDirection to be determined by LayoutDirection. ie If LayoutDirection is RTL, default TextDirection will be RTL. Previously it was TextDirection.ContentOrLtr/Rtl ( I4e803 )
Bug fix: When font weight and font style are nested on an AnnotatedString, text is not rendered correctly. ( I77a9d )
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 )
ui-android-text module is renamed as ui-text-android ( I68cbe )