Создать фонд

Создавайте приложения Jetpack Compose с готовыми к использованию стандартными блоками и расширяйте основу для создания собственных частей системы проектирования.
Последнее обновление Стабильный выпуск Кандидат на выпуск Бета-версия Альфа-релиз
11 декабря 2024 г. 1.7.6 - - 1.8.0-альфа07

Структура

Compose — это комбинация 7 идентификаторов групп Maven в androidx . Каждая группа содержит целевой подмножество функций, каждая из которых имеет свой собственный набор примечаний к выпуску.

В этой таблице описаны группы и ссылки на каждый набор примечаний к выпуску.

Группа Описание
сочинить.анимацию Создавайте анимацию в своих приложениях Jetpack Compose, чтобы улучшить взаимодействие с пользователем.
compose.compiler Преобразуйте функции @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 Compiler.
Compose.ui Фундаментальные компоненты пользовательского интерфейса, необходимые для взаимодействия с устройством, включая макет, рисование и ввод.

Объявление зависимостей

Чтобы добавить зависимость от Compose, вам необходимо добавить в свой проект репозиторий Google Maven. Для получения дополнительной информации прочтите репозиторий Google Maven .

Добавьте зависимости для нужных вам артефактов в файл build.gradle для вашего приложения или модуля:

классный

dependencies {
    implementation "androidx.compose.foundation:foundation:1.7.5"
}

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

Котлин

dependencies {
    implementation("androidx.compose.foundation:foundation:1.7.5")
}

android {
    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

Дополнительные сведения о зависимостях см. в разделе Добавление зависимостей сборки .

Обратная связь

Ваши отзывы помогают сделать Jetpack лучше. Дайте нам знать, если вы обнаружите новые проблемы или у вас есть идеи по улучшению этой библиотеки. Пожалуйста, ознакомьтесь с существующими проблемами в этой библиотеке, прежде чем создавать новую. Вы можете добавить свой голос к существующей проблеме, нажав кнопку со звездочкой.

Создать новую задачу

Дополнительную информацию см . в документации по системе отслеживания проблем .

Версия 1.8

Версия 1.8.0-альфа07

11 декабря 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha07 . Версия 1.8.0-alpha07 содержит эти коммиты .

Изменения API

  • Удален флаг ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabled , который помог отменить удаление внутреннего graphicsLayer из BasicText . Если вы использовали этот флаг, сообщите нам о причинах, сообщив об ошибке. Также вы можете просто передать Modifier.graphicsLayer() в вызовы BasicText , чтобы добиться того же поведения, что и раньше. ( ID9f90 )
  • Добавлена ​​реализация по умолчанию для нового stickyHeader DSL. ( I68986 )
  • Имеет локальную композицию LocalAutofillHighlightColor , использующую тип цвета. ( I0e05b )
  • OverscrollEffect#withoutDrawing переименован в OverscrollEffect#withoutVisualEffect . ( I1a154 )

Исправления ошибок

  • Последующее исправление проблемы в расчете цели AnchoredDraggable , из-за которой он мог остановиться на неправильной привязке для определенных движений. ( I23b87 , б/367660226 )

Внешний вклад

  • Добавьте BringIntoViewResponderModifierNode в пользовательский интерфейс, который обеспечивает новый способ реализации функции «Bring Into View», а также позволяет реализовать ее на уровне платформы ( Ia6dd8 ).
  • Мы постоянно немного меняем способ рисования курсора. Вы можете использовать LocalCursorBlinkEnabled , чтобы отключить отрисовку курсора в тестах. ( I4c697 )

Версия 1.8.0-альфа06

13 ноября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha06 . Версия 1.8.0-alpha06 содержит эти коммиты .

Изменения API

  • Добавляет модификатор stylusHoverIcon . ( Iff20a , b/331289114 )
  • Устаревшее confirmValueChange AnchoredDraggableState . Вместо наложения вето на изменения состояния запрещенные привязки не должны находиться в активном наборе привязок, а OverscrollEffect следует использовать для указания недоступности запрошенного действия. ( Ia717f )
  • Превращает диспетчер автозаполнения в интерфейс. ( I84914 , б/376080755 )
  • Добавляет API OverscrollEffect#withoutDrawing и OverscrollEffect#withoutEventHandling — эти API создают обернутый экземпляр предоставленного эффекта прокрутки, который не рисует и не обрабатывает события соответственно, что позволяет отображать прокрутку в отдельном компоненте от компонента, который отправляет события. Например, отключить отрисовку прокрутки внутри ленивого списка, а затем отрисовывать прокрутку отдельно сверху/в другом месте. ( Idbb3d , б/266550551 , б/204650733 , б/255554340 , б/229537244 )
  • Добавление поддержки автозаполнения на текстовой панели инструментов. ( Ie6a4c )
  • Устаревшие OverscrollConfiguration и LocalOverscrollConfiguration и добавлен rememberPlatformOverscrollFactory для создания экземпляра/настройки параметров реализации чрезмерной прокрутки по умолчанию. Чтобы отключить избыточную прокрутку, вместо LocalOverscrollConfiguration provides null , используйте LocalOverscrollFactory provides null . Чтобы изменить цвет свечения/отступы, вместо LocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding) , используйте LocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding) . ( Ie71f9 , б/255554340 , б/234451516 )
  • Свойство effectModifier в OverscrollEffect изменено на node: DelegatableNode , что соответствует другим API. ( Ic0b46 , б/255554340 )
  • Удален экспериментальный API GlobalAssertions . Его предполагаемое использование заключалось в запуске проверок доступности, вместо этого см. enableAccessibilityChecks() для этой цели. ( I59322 )

Версия 1.8.0-альфа05

30 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha05 . Версия 1.8.0-alpha05 содержит эти коммиты .

Новые возможности

  • Поддержка автоматического изменения размера текста. Передайте экземпляр AutoSize (например, AutoSize.StepBased ) в свой любимый компонуемый текст (например, BasicText ) и увидите, как размер вашего текста адаптируется к доступному пространству! ( Ice7e0 , б/139320827 )
  • Добавляет API OverscrollFactory и LocalOverscrollFactory позволяющие настраивать избыточную прокрутку в иерархии. Значение, предоставленное через LocalOverscrollFactory будет использоваться по умолчанию для создания OverscrollEffect . Чтобы создать и запомнить эффект из текущей предоставленной фабрики, используйте rememberOverscrollEffect() . ( I51ca4 , б / 255554340 )

Изменения API

  • Представьте CompositionLocal , который можно использовать для изменения оттенка выделения успешного заполнения автозаполнения. ( I32092 )
  • Удален ScrollableDefaults.overscrollEffect — вместо этого вы должны использовать rememberOverscrollEffect . Это создаст экземпляр текущей реализации избыточной прокрутки, предоставленной LocalOverscrollFactory . ( I1651a , б / 255554340 ), ( б / 234451516 )
  • Представляет новый интерфейс AutofillManager , который можно использовать для точной настройки пути пользователя к автозаполнению, а также флаг isSemanticAutofillEnabled для включения этой новой версии автозаполнения. ( I9d484 )
  • Удаляет CombinedClickableNode . Этот экспериментальный API временно использовался для разблокировки производительности, но больше не нужен. Вместо этого вам следует напрямую использовать Modifier.combinedClickable как и другие API-модификаторы. ( I4b658 )
  • Добавляет перегрузки для horizontalScroll , verticalScroll , LazyColumn , LazyRow , LazyHorizontalGrid , LazyVerticalGrid , LazyHorizontalStaggeredGrid , LazyVerticalStaggeredGrid , HorizontalPager и VerticalPager с поддержкой указания пользовательского OverscrollEffect . Предоставленный OverscrollEffect будет получать события и отображаться в пределах этих компонентов. Обратите внимание, что рисование одного и того же OverscrollEffect дважды не поддерживается, поэтому вы не можете нарисовать один и тот же OverscrollEffect предоставленный одному из этих компонентов, отдельно с помощью Modifier.overscroll . Вариант использования прорисовки чрезмерной прокрутки за пределами этих компонентов будет рассмотрен отдельно в будущем. ( I2dc42 , б/266550551 , б/234274772 , б/224572538 , б/353805117 )

Версия 1.8.0-альфа04

16 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha04 . Версия 1.8.0-alpha04 содержит эти коммиты .

Изменения API

  • Добавляет обратные вызовы DelegatableNode#onDensityChange и DelegatableNode#onLayoutDirectionChange позволяющие обновлять состояние узла при их изменении. ( I04f3e , б/340662451 )
  • Paragraph и ParagraphIntrinsics теперь принимают список всех аннотаций, примененных к AnnotatedString , раньше у него был только список SpanStyles . ( I12f80 )
  • Представлен PointerInputModifierNode#touchBoundsExpansion , который можно использовать для увеличения границ касания одного модификатора ввода указателя. ( Iccf02 , б/335339283 )

Исправления ошибок

  • Исправлена ​​ошибка, из-за которой позиционные пороги, передаваемые в AnchoredDraggableDefaults.flingBehavior не учитывались правильно в некоторых сценариях. ( Ifdf0d , b/367660226 )
  • Внедрить исправление для вложенных прокручиваемых элементов, которые удаляются из дерева узлов во время текущего выброса. Теперь эти узлы отменят бросок и правильно отправят событие onPostFling с оставшейся скоростью. Мы также вводим флаг NewNestedScrollFlingDispatchingEnabled для управления поведением в случае регрессии. Флаг будет удален перед бета-тестированием. ( I05c37 , б/371168883 )
  • Исправлена ​​ошибка, из-за которой OverscrollEffects передаваемый в Modifier.anchoredDraggable , получал 2D-дельты вместо 1D. ( Ie52c0 )

Версия 1.8.0-альфа03

2 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha03 . Версия 1.8.0-alpha03 содержит эти коммиты .

Изменения API

  • Обновление версии Kotlin до 1.9 ( I1a14c )
  • Представлен флаг DraggableAddDownEventFixEnabled ( I848d5 ).
  • Представлена ​​новая роль семантики под названием «Карусель» для эмуляции поведения списка в пейджерах для служб a11y. ( Id354b , б/354109776 , б/239672673 )
  • Удален неявный модификатор graphicsLayer из составного элемента BasicText . Добавлен экспериментальный флаг ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabled позволяющий вернуться к старому поведению. ( Ie478d )
  • Добавлен Modifier.recalculateWindowInsets() чтобы позволить дочерним элементам в иерархии использовать insetsPadding , даже если родители выровняли их без consumeWindowInsets() . ( I7f9e4 )

Исправления ошибок

  • Реализуйте распознавание жестов в detectDragGestures , перетаскиваемых и прокручиваемых объектах. Теперь, если перетаскиваемый ребенок отказывается от жеста, у родителя есть возможность его поднять. Это обеспечивает более непрерывную и интегрированную обработку жестов. ( Ic88fe )
  • Обновите поведение отмены броска в прокручиваемых объектах. Теперь, если прокручиваемый объект прокручивается и достигает границ, он правильно передает скорость прокрутки следующему прокручиваемому объекту в цепочке, а не продолжает управлять броском. ( I9326a )

Версия 1.8.0-альфа02

18 сентября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha02 . Версия 1.8.0-alpha02 содержит эти коммиты .

Изменения API

  • TextOverflow.StartEllipsis и TextOverflow.MiddleEllipsis теперь доступны, что позволяет размещать многоточие в начале или середине строки однострочного текста ( I38913 , b/185418980 ).

Версия 1.8.0-альфа01

4 сентября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.8.0-alpha01 . Версия 1.8.0-alpha01 содержит эти коммиты .

Версия 1.7

Версия 1.7.6

11 декабря 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.6 . Версия 1.7.6 содержит эти коммиты .

Исправления ошибок

  • Исправлен встроенный текстовый контент, который не был виден службам специальных возможностей.
  • Исправлена ​​проблема, из-за которой AndroidEmbeddedExternalSurface не сбрасывался должным образом и зависал при повторном использовании в ленивом списке.

Версия 1.7.5

30 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.5 . Версия 1.7.5 содержит эти коммиты .

Исправления ошибок

  • Убедитесь, что закрепленные элементы не разделены дважды в области заполнения содержимого. ( Ic6224 )

Версия 1.7.4

16 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.4 . Версия 1.7.4 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​ошибка, приводившая к редкому сбою в текстовых полях. ( I475c6 , б/313010266 )
  • Удален ReusableContentHost в корне элементов ленивого макета. Это было потенциальной основной причиной сбоев «меры, вызванной на деактивированном узле». ( ID6e60 )

Версия 1.7.3

2 октября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.3 . Версия 1.7.3 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​утечка памяти в BasicText , когда для minLines установлено значение, отличное от значения по умолчанию.

Версия 1.7.2

18 сентября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.2 . Версия 1.7.2 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​проблема с перетаскиванием, в которой отсутствовали события опускания, из-за чего перемещения выглядели медленнее, чем обычно.

Версия 1.7.1

10 сентября 2024 г.

  • Никаких изменений в артефактах Android. Артефакты -desktop были удалены и добавлены артефакты -jvmStubs и -linuxx64Stubs . Ни одна из этих целей не предназначена для использования, они являются заполнителями, помогающими Jetbrains Compose.

Версия 1.7.0

4 сентября 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0 . Версия 1.7.0 содержит эти коммиты .

Важные изменения с версии 1.6.0

  • Производительность Modifier.clickable , Modifier.focusable , Modifier.indication , Modifier.scrollable и Modifier.draggable была значительно улучшена. В рамках этой работы в дополнение к внутренним изменениям были внесены следующие изменения API.
    • Добавлен новый API индикации, IndicationNodeFactory . Это приводит к более производительным реализациям индикации по сравнению с предыдущим (теперь устаревшим) API rememberUpdatedInstance . Информацию о миграции см. на сайте Developer.android.com .
    • clickable / combinedClickable / selectable / toggleable теперь принимает параметр MutableInteractionSource , допускающий значение NULL. Если значение равно null и предоставленное указание является IndicationNodeFactory , указание может быть лениво создано только при необходимости, что повышает производительность. Если вы не поднимаете и не используете MutableInteractionSource , рекомендуется передавать null вместо передачи remember { MutableInteractionSource() } .
    • Indication#rememberUpdatedInstance устарела. Он имеет высокий неизбежный недостаток производительности и препятствует другим оптимизациям. Вместо этого вам следует использовать новый API IndicationNodeFactory .
  • BasicTextField использующий TextFieldState , теперь стабилен, и мы советуем всем сайтам вызова начать миграцию с BasicTextField(value, onValueChange) на BasicTextField(TextFieldState) .
  • ClickableText устарел. Чтобы добавить в текст интерактивные ссылки, используйте BasicText с новой аннотацией LinkAnnotation в вашем AnnotatedString . LinkAnnotation позволяет настраивать стили в зависимости от состояния ссылки (например, в фокусе, при наведении).
  • Представляем ContextualFlowRow и Enhanced FlowRow/Column с MaxLines и Overflow . Мы рады объявить об улучшениях экспериментальных FlowRow и FlowColumn , которые теперь включают поддержку maxLines и переполнения, а также дебют ContextualFlowRow и ContextualFlowColumn . Это обновление предназначено для обеспечения компонентов с оптимальной производительностью, где ContextualFlow* идеально подходит для большого количества элементов, используя небольшую конфигурацию maxLines и динамические кнопки +N, чтобы увидеть больше, а FlowRow и FlowColumn идеально подходят для небольшого количества элементов, меньше более 100 предметов. Важно: Чтобы сохранить существующее поведение в FlowRow или FlowColumn , где все элементы составлены независимо от того, соответствуют ли они максимальному значению поперечной оси, задайте для переполнения значение FlowRowOverflow.Visible или FlowColumnOverflow.Visible во время инициализации. Изучите ContextualFlowRowSample и FlowRowSample чтобы увидеть примеры этих новых функций в действии. ( Ib9135 , б / 293577082 )
  • Поддержка анимации появления и исчезновения элементов была добавлена ​​в LazyColumn и LazyRow . Ранее можно было добавить модификатор Modifier.animateItemPlacement() для поддержки анимации размещения (переупорядочения). Мы упразднили этот модификатор и представили новый неэкспериментальный модификатор под названием Modifier.animateItem() , который позволяет поддерживать все три типа анимации: появление (появление), исчезновение (появление) и изменение порядка. ( I2d7f7 , б/150812265 )
  • Реализована экспериментальная поддержка длинных снимков экрана в контейнерах прокрутки Compose с использованием официального API Android ( ScrollCaptureCallback ).
  • Источники NestedScroll Drag и Fling заменяются UserInput и SideEffect чтобы учесть расширенное определение этих источников, которые теперь включают анимацию (Side Effect) и колесо мыши и клавиатуру ( UserInput ).
  • Запросы предварительной выборки LazyLayout теперь могут быть помечены как срочные. Это означает, что мы ожидаем, что этот элемент понадобится в следующем кадре, и хотим игнорировать бюджет кадра, чтобы заранее выполнить дополнительную работу ( Id513f ).
  • Поддержка функции рукописного ввода стилусом на устройствах после Android U. ( I002e4 )
  • Различные API переведены в стабильную версию.
    • Пейджеры, привязки, оконные вставки

Версия 1.7.0-rc01

21 августа 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-rc01 . Версия 1.7.0-rc01 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​регрессионная ошибка, при которой происходил сбой, когда любой элемент фокусировался внутри родительского элемента, который доступен для фокусировки (или кликабельен) и отключен. ( б / 317561689 )

Версия 1.7.0-beta07

7 августа 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta07 . Версия 1.7.0-beta07 содержит эти коммиты .

Исправления ошибок

  • Функции SemanticsNodeInteraction связанные с вводом текста, performTextReplacement , performTextInput и performTextClearance теперь будут выдавать ошибки утверждения, когда они вызываются для TextFields только для чтения. ( I4ae8f )
  • Исправлен визуальный сбой в гиперссылках. ( I23311 )
  • Исправлен модификатор contentReceiver , не работавший с некоторыми IME.
  • Генерация скорости: предотвращение распространения значений NaN в пользовательском интерфейсе Compose и Foundation.

Версия 1.7.0-beta06

24 июля 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta06 . Версия 1.7.0-beta06 содержит эти коммиты .

Версия 1.7.0-бета05

10 июля 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta05 . Версия 1.7.0-beta05 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​обработка значений Nan в SnapFlingBehavior и Pager.

Версия 1.7.0-beta04

26 июня 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta04 . Версия 1.7.0-beta04 содержит эти коммиты .

Исправления ошибок

  • Избегайте сбоев при измерении очень больших текстовых строк (например, 10 тыс. символов) ( 8157ab ).
  • Исправлено измерение очень большого текста, вызывающее сбой в новом BasicTextField ( 6b7575 ).
  • Отменяет изменение поведения при измерении строк/столбцов, которое нарушает использование текста в определенных сценариях ( 69e8ba ).

Версия 1.7.0-бета03

12 июня 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta03 . Версия 1.7.0-beta03 содержит эти коммиты .

Версия 1.7.0-бета02

29 мая 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta02 . Версия 1.7.0-beta02 содержит эти коммиты .

Изменения API

  • Добавляет экспериментальный API для настройки поведения предварительной выборки LazyGrids аналогичный существующему экспериментальному API для LazyLists . Сюда входит поддержка предварительной выборки элементов во вложенных LazyGrids . Как и в случае с LazyListPrefetchStrategy , реализация по умолчанию предполагает предварительную выборку первых двух вложенных элементов каждой сетки, но это можно настроить с помощью новых API LazyGridPrefetchStrategy(nestedPrefetchItemCount) и LazyListPrefetchStrategy#onNestedPrefetch . ( I591c4 )
  • SemanticsProperties.Editable переименован в IsEditable и заменен SemanticsPropertyReceiver.editable на значение isEditable . Свойство теперь является логическим и всегда указывается в текстовых полях. ( I8acd8 )
  • Значения по умолчанию basicMarquee перенесены в объект MarqueeDefaults . ( I12ff6 )
  • Параметр basicMarquee delayMillis переименован в repeatDelayMillis . ( I12ff6 )
  • Обновите API для стилизации ссылок: TextLinkStyles перемещены в TextStyle и удалены TextDefaults из материала ( I5477b ).

Исправления ошибок

  • LayoutCoordinates.introducesFrameOfReference переименован в LayoutCoordinates.introducesMotionFrameOfReference чтобы лучше отражать его назначение. Переименована связанная функция для расчета координат на основе этого флага. ( I3a330 )
  • Из свойств MarqueeDefaults удалено значение «По умолчанию». ( I1d8a0 )
  • Удалена надпись «Marquee» из свойств MarqueeDefaults . ( Iad4f4 )
  • Удалены TextLinkStyles из класса TextStyle . Вместо этого TextLinkStyles является частью конструктора LinkAnntation и метода AnnotatedString.fromHtml ( I90b2b ).
  • Исправлена ​​ошибка, из-за которой Пейджер щелкал при броске к границе, уже находясь на ней. ( I9f373 , б/339171222 )
  • BTF2 теперь имеет правильные жесты выбора мыши. ( Ibe8c6 )

Внешний вклад

  • Повторно отправьте «Создать тип контента для расчета времени компоновки/измерения на основе предварительной выборки для повышения точности» ( Iea622 ).
  • Сделать тип контента расчета времени составления/измерения на основе предварительной выборки для повышения точности ( Ibccb1 ).
  • Сделать модификаторы WindowInsetsPadding доступными из общего исходного набора ( I070b2 ).

Версия 1.7.0-бета01

14 мая 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-beta01 . Версия 1.7.0-beta01 содержит эти коммиты .

Изменения API

  • Добавлено свойство KeyboardOptions.shouldShowKeyboardOnFocus обратно как устаревшее скрытое для двоичной совместимости. ( I15cfe )
  • Modifier.anchoredDraggable теперь по умолчанию меняет дельту перетаскивания для компонентов с горизонтальной ориентацией при использовании в макете RTL. ( I3c6d9 )
  • AnnotatedString.hasEqualsAnnotations теперь имеет hasEqualAnnotations . ( I685c0 )
  • Обновлен API для получения тематических ссылок Material в тексте. В частности, из TextDefaults удалены методы для создания тематических LinkAnnotations и анализа HTML с тематическими ссылками. Вместо этого добавлен класс TextLinkStyles , который позволяет стилизовать ссылки в качестве параметра составного текста. ( I31b93 )
  • Заменены onDragStarted и onDragStopped обратными вызовами без приостановки. ( I59de8 )

Исправления ошибок

  • Исправлена ​​ошибка, из-за которой Pager аварийно завершал работу, если contentPadding превышал входящие ограничения. Пейджер теперь приводит отрицательные значения, возвращаемые из PageSize к 0. ( Iba5d8 , b/314008560 )

Версия 1.7.0-альфа08

1 мая 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-alpha08 . Версия 1.7.0-alpha08 содержит эти коммиты .

Новые возможности

  • В BasicTextField и SelectionContainer добавлено контекстное меню, вызываемое правой кнопкой мыши, с элементами для действий вырезания, копирования, вставки и выбора всех. ( If8c93 , Ia2b49 , I6f268 )

Изменения API

  • Запросы предварительной выборки LazyLayout теперь могут быть помечены как срочные. Это означает, что мы ожидаем, что этот элемент понадобится в следующем кадре, и хотим игнорировать бюджет кадра, чтобы заранее выполнить дополнительную работу ( Id513f ).
  • Переименован isPositionedByParentWithDirectManipulation , чтобы introducesFrameOfReference . Обратите внимание, что теперь это имеет обратный эффект: по умолчанию большинство LayoutCoordinates вводят систему отсчета, и только при прямом манипулировании свойство будет ложным. Чтобы запросить позицию только тех, которые вводят систему отсчета, используйте positionInLocalFrameOfReference(...) . Или positionInLocalLookaheadFrameOfReference из LookaheadScope . ( Ifc5f7 )
  • Переименован onClicked в onClick внутри LinkInteractionListener ( Iaa35c ).
  • Измените лямбду действия для getScrollViewportLength в соответствии с отзывами совета API. ( Ibc74a )
  • Переименованы API-интерфейсы делегирования рукописного ввода стилуса. ( Ica45f , б/327271923 )
  • Переименуйте TextInclusionStrategy.isInside в isIncluded . Сделайте тип возвращаемого значения Paragraph/MultiParagraph#getRangeForRect() не допускающим значения NULL. ( I51f26 )

Исправления ошибок

  • Добавлен параметр «Выбрать все» во все текстовые контекстные меню в SelectionContainer . ( Ib750e , б/240143283 )
  • Исправлен длинный снимок экрана для прокручиваемых контейнеров с reverseScrolling=true . ( I7c59c )
  • Исправлена ​​проблема, из-за которой currentValue AnchoredDraggableState менялся при приближении к границам состояния. ( Iea30b , б/333846848 )

Внешний вклад

  • PrefetchExecutor переименован в PrefetchScheduler чтобы лучше отражать его обязанности. ( Ib9154 )
  • Добавлена ​​поддержка предварительной выборки элементов во вложенных LazyLists (например, LazyColumn который отображает вложенные LazyRows ). Ожидается, что это изменение уменьшит выпадение кадров во время прокрутки для этих LazyLists . По умолчанию реализация выполняет предварительную выборку первых двух вложенных элементов, однако этим поведением можно управлять с помощью новых API LazyLayoutPrefetchStrategy(nestedPrefetchItemCount) и LazyListPrefetchStrategy#onNestedPrefetch . ( I51952 )

Версия 1.7.0-альфа07

17 апреля 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-alpha07 . Версия 1.7.0-alpha07 содержит эти коммиты .

Новые возможности

  • Добавлен объект TextDefaults , содержащий методы для создания LinkAnnotation и анализа строки с HTML-тегом, которая применяет MaterialTheme к ссылкам. ( I98532 , б / 139312671 )
  • Поддержка анимации появления и исчезновения элементов была добавлена ​​в LazyVerticalGrid и LazyHorizontalGrid . Ранее можно было добавить модификатор Modifier.animateItemPlacement() для поддержки анимации размещения (переупорядочения). Мы упразднили этот модификатор и представили новый неэкспериментальный модификатор под названием Modifier.animateItem() , который позволяет поддерживать все три типа анимации: появление (появление), исчезновение (появление) и изменение порядка. ( Ib7d12 , б/330510929 )
  • Поддержка анимации появления и исчезновения элементов была добавлена ​​в LazyVerticalStaggeredGrid и LazyHorizontalStaggeredGrid . Ранее можно было добавить модификатор Modifier.animateItemPlacement() для поддержки анимации размещения (переупорядочения). Мы упразднили этот модификатор и представили новый неэкспериментальный модификатор под названием Modifier.animateItem() , который позволяет поддерживать все три типа анимации: появление (появление), исчезновение (появление) и изменение порядка. ( I69bc9 , б/330511290 )

Изменения API

  • Добавляет ContextMenuColors и связанный с ним LocalContextMenuTheme ProvidableCompositionLocal . Цвета контекстного меню текстовых полей и выбираемого текста можно изменить, предоставив локальную композицию. ( Ифа154 )
  • Текстовые ссылки получили опцию стилизации нажатого состояния в дополнение к обычному стилю, наведению курсора и фокусу. ( I5f864 , б / 139312671 )
  • Представьте ViewConfiguration.HandwritingGestureLineMargin для жестов рукописного ввода. Поддержка жестов рукописного ввода для BasicTextField . ( Ie6e13 , б/325660505 )
  • Удален DelegatableNode.scrollIntoView для версии 1.7, поскольку у нас не было времени завершить стабилизацию остальной части связанной поверхности API. Эта функция будет вновь представлена ​​в версии 1.8 ( I6cf61 , b/333421581 , b/332900232 ).
  • При запросе координат макета теперь вы можете использовать аргумент excludeDirectManipulationOffset , чтобы исключить смещение, установленное родительскими макетами, которые разместили своих дочерних элементов с помощью Placeable.PlacementScope.withDirectManipulationPlacement . Аналогично, макет, который часто меняет положение своих дочерних элементов, теперь может размещать их с помощью withDirectManipulationPlacement (например, Scroll, реализованного по умолчанию). Это помогает анимации, основанной на approachLayout стать более интуитивно понятными, поскольку теперь у вас есть возможность различать, какое смещение нужно анимировать, а что применять непосредственно при принятии решения о анимации их подхода. ( I60ec7 )
  • Представьте requestScrollToItem для LazyStaggeredGrid . Для каждого прохода измерения клиент теперь может отказаться от поддержки индекса на основе ключа, вызвав requestScrollToItem . Это никак не меняет существующее поведение, если не вызывается requestScrollToItem . ( I63983 )
  • Введите requestScrollToPage в Pager. Для каждого прохода измерения клиент теперь может отказаться от поддержки индекса на основе ключа, вызвав requestScrollToPage . Это никак не меняет существующее поведение, если не вызывается requestScrollToPage . ( Ic4213 )
  • Представлен requestScrollToItem для LazyGrids . Для каждого прохода измерения клиент теперь может отказаться от поддержки индекса на основе ключа, вызвав requestScrollToItem . Это никак не меняет существующее поведение, если не вызывается requestScrollToItem . ( I0a7a0 )
  • ClickableText помечен как устаревший. Чтобы добавить ссылки в текст, создайте AnnotatedString с LinkAnnotation соответствующим вашей ссылке, и передайте эту AnnotatedString в компонуемый Text ( I34d4b , b/323346994 ).
  • UrlAnnotation устарел, используйте вместо него LinkAnnotation.Url . Если вы используете тему Material, используйте объект TextDefaults для создания аннотации с примененной к ней темой Material ( I8d180 , b/323346545 ).
  • String.parseAsHtml переименован в AnnotatedString.Companion.fromHtml ( I43dcd ).
  • В метод parseAsHtml добавлены аргументы стиля ( linkStyle , focusedLinkStyle , hoveredLinkStyle ) и прослушиватель взаимодействия ссылок. При анализе строки с HTML-тегом с помощью тегов <a> метод создает LinkAnnotation.Url для каждого такого тега и передает объекты стиля и прослушиватель взаимодействия ссылок в каждую аннотацию. ( I7c977 )
  • LinkAnnotation теперь принимает аргументы стиля на основе состояния и LinkInteractionListener . Добавьте эту аннотацию в AnnotatedString чтобы получить гиперссылку. Передавая focusedState и/или hoveredState вы можете определить визуальную конфигурацию ссылок, когда они находятся в фокусе и/или наведены. ( I81ce4 , б/139312671 )
  • Флаг функции для длинных снимков экрана был удален. ( I28648 , б/329128246 )
  • LazyColumn теперь правильно отображает прикрепленные заголовки на длинных скриншотах. ( I8d239 , б/329296635 )
  • Стабилизировано большинство оставшихся экспериментальных API, которые были представлены с новым BasicTextField . ( I714e2 )
  • В BasicSecureTextField добавлен параметр textObfuscationCharacter , который определяет, какой символ использовать при запутывании содержимого. ( I0588b )
  • Источники NestedScroll Drag и Fling заменяются UserInput и SideEffect чтобы учесть расширенное определение этих источников, которые теперь включают анимацию (Side Effect) и колесо мыши и клавиатуру ( UserInput ). ( I40579 )
  • Представьте LocalBringIntoViewSpec — поведение прокрутки фокуса, зависящее от платформы, которое применяется на слое модификатора Scrollable. ( I27aa5 , б/317453911 )
  • Удален TextFieldCharSequence . TextFieldBuffer.originalValues ​​заменяется на TextFieldBuffer.originalText и TextFieldBuffer.originalSelection . ( I2c7d6 )
  • ImeOptions.hintLocales больше не имеет значения NULL. Если вы хотите передать пустой список локалей, используйте LocaleList.Empty . ( Ic5bc4 )
  • getOffsetFractionForPage переименован в getOffsetDistanceInPages . ( Ia05e2 )

Исправления ошибок

  • Когда InputTransformations соединяются с next , их KeyboardOptions теперь правильно объединяются по отдельным параметрам с помощью нового метода KeyboardOptions.merge . ( Ie5304 , б/295951492 )
  • targetValue AnchoredDraggableState теперь больше не учитывает позиционные пороги. Теперь он имеет неявный порог 50 %, что означает, что targetValue изменяется в средней точке между двумя привязками. ( I82c2c )

Внешний вклад

  • Переименованы 2 API прокрутки ( I56a75 ).

Версия 1.7.0-альфа06

3 апреля 2024 г.

Выпущен androidx.compose.foundation:foundation-*:1.7.0-alpha06 . Версия 1.7.0-alpha06 содержит эти коммиты .

Новые возможности

  • Поддержка анимации появления и исчезновения элементов была добавлена ​​в LazyColumn и LazyRow . Ранее можно было добавить модификатор Modifier.animateItemPlacement() для поддержки анимации размещения (переупорядочения). Мы упразднили этот модификатор и представили новый неэкспериментальный модификатор под названием Modifier.animateItem() , который позволяет поддерживать все три типа анимации: появление (появление), исчезновение (появление) и изменение порядка. ( I2d7f7 , б/150812265 )
  • Клиенты LazyColumn/LazyRow теперь могут отказаться от поддержки индекса на основе ключа для предстоящего прохода измерения, вызвав не приостанавливаемый LazyListState.requestToScroll . ( I98036 , б/209652366 )
  • Добавлен метод parseAsHtml для стилизованных строк: он позволяет конвертировать строку, помеченную HTML-тегами, в AnnotatedString . Обратите внимание, что не все теги поддерживаются, например, вы пока не сможете отображать маркированные списки. ( I84d3d )
  • Реализована экспериментальная поддержка длинных снимков экрана в контейнерах прокрутки Compose с использованием официального API Android ( ScrollCaptureCallback ). Эта функция является экспериментальной и в настоящее время может обрабатывать не все случаи правильно. По этой причине в настоящее время по умолчанию он отключен. Чтобы принять участие, установите для флага ComposeFeatureFlag_LongScreenshotsEnabled значение true. Этот флаг будет удален перед бета-версией 1.7. ( I2b055 , б/329296471 )
  • Внедрите новый API GraphicsLayer чтобы обеспечить большую гибкость при размещении и рендеринге экземпляров GraphicsLayer и поддерживать встроенные функции рендеринга без необходимости координации с реализациями Composable для указания экземпляров модификатора GraphicsLayer .

Изменения API

  • Все параметры KeyboardOptions теперь по умолчанию имеют неопределенное значение. Добавлен метод KeyboardOptions.merge .
  • KeyboardOptions.autoCorrect переименован в autoCorrectEnabled и сделал его допускающим значение NULL, где значение NULL означает, что значение не было указано. ( Ia8ba0 , б/295951492 )
  • outOfBoundsPageCount переименован в beyondViewportPageCount . ( I129c6 )
  • fun ClipEntry.getMetadata() заменено на val ClipEntry.clipMetadata . ( I50155 )
  • Удален TextFieldState.valueAsFlow() . Предпочитаю использовать snapshotFlow { state.text } , или snapshotFlow { TextFieldCharSequence(state.text, state.selection) } ( i7d629 )
  • Реорганизованная InputTransformation.transformInput Параметры. Удален originalValue: TextFieldCharSequence . Вместо этого TextFieldBuffer теперь несет это значение с тем же именем. Также удалили valueWithChanges: TextFieldBuffer . TextFieldBuffer теперь является прицелом приемника на функции. ( I919cc )
  • Вариант BasicTextField(state) и BasicSecureTextField теперь используют KeyboardActionHandler вместо KeyboardActions для обработки действий, предпринимаемых программной клавиатурой. ( I58dda )
  • Stylus API -интерфейс degriting delegation для поддержки почерка Stylus на «поддельных» полях ввода текста. ( I9c09c , b/327271923 )
  • Переименовано showKeyboardOnFocus KeyboardOptions.shouldShowKeyboardOnFocus . ( IB4B7A , B/295951492 )
  • Удаленный параметр hintMediaTypes из Modifier.contentReceiver . Разработчикам уже было рекомендовано проверить тип медиа -типа «Полученного TransferableContent », так как он может быть несовместимым с настроенными hintMediaTypes . ( I82f99 )
  • Переупорядился параметры BasicSecureTextField . Удаленные параметры keyboardType и imeAction в пользу полного класса KeyboardOptions , сохраняя при этом те же знания по умолчанию, подходящие для BasicSecureTextField . Также удалили параметр scrollState . ( IBBFA9 )
  • Тип TextFieldState.text изменяется от TextFieldCharSequence на Just CharSequence . Поэтому добавлено TextFieldState.selection: TextRange и TextFieldState.composition: TextRange? Чтобы прочитать текущие значения выбора и композиции непосредственно из объекта состояния.
  • Удален TextFieldState.forEachTextValue . ( IDB2A2 )
  • Удален ClipboardManager.getClipMetadata и ClipboardManager.hasClip . Пожалуйста, используйте clipEntry.getMetadata() чтобы прочитать метаданные текущего записи клипа. Также проверьте результат ClipboardManager.getClip , если он нулевой или не понимает, имеет ли буфер обмена текущим клип. ( I50498 )
  • ClipboardManager.setClip теперь принимает NULL, чтобы иметь возможность очистить буфер обмена. ( I7d2e9 )
  • ReceiveContentListener преобразуется в функциональный интерфейс. Также Modifier.receiveContent перегрузка, которая принимает Lambda, удаляется, поскольку ReceiveContentListener теперь является интерфейсом функции.
  • Modifier.receiveContent переименован в Modifier.contentReceiver . ( I1e6af )
  • Переименован TransferableContent.consume TransferableContent.consumeEach ( I1e462 )
  • rememberTextFieldState закончила стабильный API. ( I37999 )

Исправления ошибок

  • Исправлена ​​ошибка, в которой вариант BasicTextField(state) не работал с клавиатурами CJK (на основе композиции). ( I54425 )
  • Исправлена ​​ошибка, в которой Modifier.dragAndDropTarget() может ссылаться на устаревшие данные в определенных сценариях с Modifier.Node повторный использование. ( I05BB1 )
  • Вернуло недавнее изменение контракта, в котором AnchoredDraggableState#anchoredDrag вызовы будут обновляться в конце операции anchoredDrag . ( I95715 )

Версия 1.7.0-Alpha05

20 марта 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha05 выпущена. Версия 1.7.0-Alpha05 содержит эти коммиты .

Изменения API

  • Удален экспериментальный композиция LocalTextLinkStyle Local для стиля гиперссылок. ( IEBFA7 )
  • Удален экспериментальный переопределение BasicText с помощью onLinkClicked Arcome. Замена API для поддержки гиперссылок будет следовать в будущем. ( I107d5 )
  • Удаленные методы и свойства, связанные с кодепоинтами, под TextFieldState и TextFieldBuffer . Также удалили суффиксы inChars из оставшихся API, связанных с выбором и композицией. ( IEF7CE )
  • AnchoredDraggable currentValue теперь будет обновляться при прохождении через якорную точку. Используйте settledValue , чтобы получить предыдущую семантику currentValue , обновив только при оседании на якоре. Прогресс теперь выявляется как функция (требующая начальной и конечной точки) вместо свойства. ( IBE6E8 , B/318707189 , B/298271489 , B/294991954 )
  • BasicTextField(state) , TextFieldState , InputTransformation , OutputTransformation , TextFieldLineLimits , TextFieldDecorator ( I9582b )
  • Введен InterceptPlatformTextInput для помощи в написании низкоуровневых тестов, связанных с IME, и других низкоуровневых вариантов использования IME. PlatformTextInputTestOverride устарел. ( I862ed , b/322680547 )
  • Split restrictedConstraints() на два метода: fitPrioritizingWidth() и fitPrioritizingHeight() ( i6d7fd )

Внешний вклад

  • Добавлено 2 новых API isLastScrollForward / isLastScrollBackward чтобы проверить направление прокрутки для последнего действия прокрутки, верните False, если пока нет действия прокрутки. ( I63a0e )

Версия 1.7.0-Alpha04

6 марта 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha04 выпускается. Версия 1.7.0-Alpha04 содержит эти коммиты .

Изменения API

  • Поддержка стилуса функции почерка на устройствах после Android U. ( i002e4 )
  • Добавлены hintLocales в KeyboardOptions , чтобы предоставить TextFields возможность намекнуть на IMES конкретными локалами для предварительного выставления предпочтительного языка. ( ID18C2 )
  • Удалили экспериментальные перегрузки BasicTextField2 и BasicSecureTextField , которые приняли value: String и onValueChange: () -> String параметры. ( I568b4 )
  • Добавьте необязательную функцию applySemantics в InputTransformation чтобы повлиять на семантику BasicTextField2 , к которой она применяется. ( I74a2f , b/170648072 )
  • В этом CL мы добавляем семантическое действие GetScrollViewportLength , чтобы мы могли подготовить информацию о компонентах, прокручиваемых в системе A11Y. Этот CL также применяет использование указанного имущества в прокручиваемых списках Foundation. ( IC5FA2 )
  • BasicTextField2 переименован в BasicTextField . ( IE5713 )
  • FocusRequester.createRefs теперь стабилен ( i4d92c , b/261436820 )
  • Введен DelegatableNode.scrollIntoView() чтобы разрешить модификаторные узлы для прямого запроса scrollIntoView . ( I2b3b7 , b/299939840 )
  • Введен DelegatableNode.requireView() чтобы позволить модификаторам узлы для получения текущего View Android без чтения локального композиции. ( I40768 )
  • Внедрение информации о контекстном макете в области контекстуальной области строки потока и применения столбца контекстуального потока, включающая индекс линии, позицию и ограничения на максимальную ширину и высоту, чтобы оставаться в указанной положении. Элементы, превышающие максимальную ширину/высоту, могут переходить к следующей строке или быть опущены на основе настройки переполнения. ( Id13f8 , b/292114798 )

Исправления ошибок

  • Исправлена ​​ошибка, в которой в определенных условиях переключение enabled или атрибуты readOnly TextField вызовут сбой. ( IAE17B )

Версия 1.7.0-Alpha03

21 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha03 выпускается. Версия 1.7.0-Alpha03 содержит эти коммиты.

Изменения API

  • Введен DelegatableNode.requireLayoutCoordinates() как способ onPlaced текущие Modifier.Node LayoutCoordinates ( IA8657 )
  • Введен DelegatableNode.currentLayoutCoordinates как способ получить текущие onPlaced LayoutCoordinates Modifier.Node . ( IAEBAA )
  • Оптимизация производительности в DraggableAnchors используемых AnchoredDraggable . ( I89cff )
  • BasicTextField2 и связанные с ними API -интерфейсы в androidx.compose.foundation.text2 Пакет перемещены на androidx.compose.foundation.text . ( I9f635 )
  • BasicTextField2 больше не принимает параметр CodepointTransformation . Используйте BasicSecureTextField или OutputTransformation . ( Id34ff )
  • Добавлен метод для сравнения только аннотаций двух AnnotatedStrings . ( I32659 )
  • Введение ContextualFlowRow и улучшенного FlowRow / Column с MaxLines и Overflow . Мы рады объявить об усовершенствованиях экспериментальной FlowRow и FlowColumn , в настоящее время показывая maxLines и поддержку переполнения, наряду с дебютом ContextualFlowRow и ContextualFlowColumn . Это обновление предназначено для обеспечения оптимальных компонентов производительности, где ContextualFlow* идеально подходит для большого количества элементов, использующих небольшую конфигурацию maxLines и Dynamic +N, см. Больше кнопок, а FlowRow и FlowColumn идеально подходит для небольшого количества элементов, меньше. чем 100 предметов. Важно: для поддержания существующего поведения в FlowRow или FlowColumn , где все элементы составляются независимо от того, соответствуют ли они максимум поперечной оси, установите overflow для FlowRowOverflow.Visible или FlowColumnOverflow.Visible во время инициализации. Исследуйте ContextualFlowRowSample и FlowRowSample для примеров этих новых функций в действии. ( IB9135 , B/293577082 )

Исправления ошибок

  • Анимация курсора больше не запрашивает кадры между состояниями на и за ее пределами. ( IA2253 )
  • Клавианые конструкторы KeyboardOptions теперь правильно скопируют все свойства. ( If12de )

Версия 1.7.0-Alpha02

7 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha02 выпускается. Версия 1.7.0-Alpha02 содержит эти коммиты.

Изменения API

  • HorizontalPager , VerticalPager и PagerState продвигаются до стабильного. ( I67660 , B/316966909 )
  • Добавлена ​​локальная композиция LocalTextLinkStyle Local, которая позволяет изменить стиль ссылок в тексте через приложение. Если вы используете свою собственную тему в приложении, вы должны установить эту композицию в соответствии с вашей темой. При использовании темы материала цвет ссылки по умолчанию будет установлен на основной цвет материала. ( I7eb10 )
  • Введенный модификатор receiveContent , который предоставляет разработчикам способ получить богатый контент в JetPack Compose.
  • receiveContent интегрируется с BasicTextField2 , чтобы принять богатый контент, предоставляемый программной клавиатурой, или через действие в буферном обмене. ( I81b72 )
  • В этом изменении мы заменяем SnapFlingBehavior на TargetedFlingBehavior в пейджере, чтобы разблокировать другие варианты использования и обеспечить большую гибкость. ( I762ea )
  • В этом изменении мы делаем конюшню API. Мы также очищаем часть кода тестирования и добавляем больше образцов в съемку. ( Id8da9 )
  • Введите TargetedFlingBehavior , FlingBehavior , который позволяет распространять информацию о состоянии продолжающейся анимации и его смещении Target Scroll. ( I6a207 )

Исправления ошибок

  • BasicTextField2 теперь поддерживает курсор во время печати, когда он был прокручен из виду или будет выходить из виду из -за ввода. ( IEB856 , B/237190748 )

Внешний вклад

  • Добавляет экспериментальный API для настройки поведения лазилоков предварительного выфширования. ( I022A4 )

Версия 1.7.0-Alpha01

24 января 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha01 выпускается. Версия 1.7.0-Alpha01 содержит эти коммиты.

Новые возможности

  • Добавлен новый Indication API , IndicationNodeFactory . Это приводит к более эффективным реализациям Indication по сравнению с предыдущими (теперь rememberUpdatedInstance ) API API. Для получения информации о миграции см. Developer.android.com .
  • clickable / combinedClickable / selectable / toggleable теперь принимает нулевой параметр MutableInteractionSource . Indication NULL, и предоставленная Indication является IndicationNodeFactory . Если вы не поднимаете и используете MutableInteractionSource , рекомендуется пройти NULL.

Изменения API

  • Внедрить DecayAnimation в AnchoredDraggable , это изменение добавляет параметр decayAnimationSpec в AnchoredDraggable , позволяющий использовать анимацию распада при оседании одного из якоря. Изменение также включает в себя переименование существующих animationSpec в snapAnimationSpec чтобы помочь понять использование случая каждой спецификации.
  • BasicTextField2 доступен для экспериментального использования. Это должно быть примерно в функционировании с BasicTextField , и поведение должно быть готовым к производству. Тем не менее, API пока остается экспериментальным. Перед стабилизацией он будет переименован в BasicTextField и перенесен в тот же пакет.
  • Представил первый черновик API OutputTransformation для BasicTextField2 . Этот API заменяет большинство вариантов использования VisualTransformation в старом BasicTextField . Однако это еще не завершено, и некоторые вещи не будут работать правильно, но мы будем признателен за любые отзывы об удобстве использования API для ваших вариантов использования. ( AOSP/2708848 )
  • Введено LinkAnnotation , которое позволяет добавлять ссылки и клики в текст. Особенность ссылок еще не завершена, и наступает больше изменений API.
  • Введенный модификатор receiveContent , который предоставляет разработчикам способ получить богатый контент в JetPack Compose.
  • receiveContent интегрируется с BasicTextField2 , чтобы принять богатый контент, предоставляемый программной клавиатурой, или через Paste из буфера обмена.
  • KeyboardOptions.shouldShowKeyboardOnFocus позволяет отключить поведение по умолчанию BasicTextField с запросом программной клавиатуры на фокусе.
  • TextInputService и LocalTextInputService теперь устаревают. Вместо этого используйте PlatformTextInputModifierNode для непосредственной интеграции с API платформы IME. ( AOSP/2862698 )
  • Indication#rememberUpdatedInstance что вырвалось на устаревшее. Он имеет высокий неизбежный штраф за производительность и предотвращает другие оптимизации. Вместо этого вы должны использовать новый API IndicationNodeFactory .

Исправления ошибок

  • BasicTextField теперь будет предварительно предоставлять небольшой выбор сопоставлений о смещении при прохождении VisualTransformation . Это помогает поймать общие ошибки кодирования, которые приводят к невозможным исключениям в более поздних измерениях или проходах. Благодаря композиции, скорее всего, разработчики увидят эти ошибки во время разработки, помогая избежать сбоев производства. ( I0fd42 )
  • VisualTransformation не будет выбросить, если вы вернете неверный индекс для неверного индекса ( B/316401857 )

Версия 1.6

Версия 1.6.8

12 июня 2024 г.

androidx.compose.foundation:foundation-*:1.6.8 выпускается. Версия 1.6.8 содержит эти коммиты .

Версия 1.6.7

1 мая 2024 г.

androidx.compose.foundation:foundation-*:1.6.7 выпускается. Версия 1.6.7 содержит эти коммиты .

Версия 1.6.6

17 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.6.6 выпускается. Версия 1.6.6 содержит эти коммиты .

Исправления ошибок

  • Исправлена ​​ошибка, в которой в определенных условиях переключение enabled или атрибуты readOnly TextField вызовут сбой. ( IAE17B )

Версия 1.6.5

3 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.6.5 выпускается. Версия 1.6.5 содержит эти коммиты .

Исправления ошибок

  • Добавляет журналы отладки в трудные ошибки в строке/столбце: ( B/300280216 и B/297974033 )

Версия 1.6.4

20 марта 2024 г.

androidx.compose.foundation:foundation-*:1.6.4 выпускается. Версия 1.6.4 содержит эти коммиты .

Исправления ошибок

  • Жест отбора с длинным прессом и драгами, который выходит из границ макета текста в первом кадре сопротивления, больше не сбои. ( ICDF90 , B/325307463 )

Версия 1.6.3

6 марта 2024 г.

androidx.compose.foundation:foundation-*:1.6.3 выпущена. Версия 1.6.3 содержит эти коммиты .

Версия 1.6.2

21 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.6.2 выпущена. Версия 1.6.2 содержит эти коммиты.

Исправления ошибок

  • Исправить AnimateContentSize не сбросить должным образом. ( I07051 )
  • Исправить проблему, где в некоторых обстоятельствах будет intrinsicHeight текста. ( 3CD398 , B/217910352 )

Версия 1.6.1

7 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.6.1 выпускается. Версия 1.6.1 содержит эти коммиты.

Исправления ошибок

  • Исправьте шахмальную меру сетки при прокрутке через предел. ( BFFC39 )
  • Добавьте проверку для макета с большими размерами. ( E74AF5 )
  • Исправьте размещение предметов размером 0 в начале шахматной сетки. ( 785F94 )
  • Позвоните в обратный вызов в том же порядке, что и OnForGotten. ( 31ce3b )

Версия 1.6.0

24 января 2024 г.

androidx.compose.foundation:foundation-*:1.6.0 выпускается. Версия 1.6.0 содержит эти коммиты.

Важные изменения с 1.5.0

  • Новый модификатор модификатора. Modifier.anchoredDraggable , который разблокирует способность перетаскивать и оживить между предопределенным набором якорей. Этот модификатор предназначен для замены для Modifier.swipeable . Узнайте , как его использовать и мигрировать из Modifier.swipeable .
  • Была добавлена ​​функциональность перетаскивания между приложениями и компонентами. Обратитесь к DragAndDropTarget , Modifier.dragAndDropSource и другим API, чтобы начать
  • Modifier.draggable2D - это новый модификатор, который обеспечивает легкую поддержку 2D -перетаскивания. См . Образец .
  • AndroidExternalSurface и AndroidEmbeddedExternalSurface были добавлены, чтобы облегчить добавление поверхностных компонентов в Compose
  • Различные изменения и улучшения API в Pager и snapFlingBehaviour
  • Различные фокусы, текст и вставки API были продвинуты на стабильные APIS

Версия 1.6.0-RC01

10 января 2024 г.

androidx.compose.foundation:foundation-*:1.6.0-rc01 выпускается. Версия 1.6.0-RC01 содержит эти коммиты.

Изменения API

  • Расширение DragAndDropTarget() удлинители был удален. Создайте новый экземпляр с помощью object: DragAndDropTarget {} . ( I32318 )

Версия 1.6.0-бета03

13 декабря 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta03 выпускается. Версия 1.6.0-BETA03 содержит эти коммиты.

Исправления ошибок

  • Исправить сбой, который повлиял на очень большой текст, измеренный с помощью бесконечных ограничений. ( I1a7df , b/312294386 )
  • PlatformImeOptions теперь является конкретным классом, а не интерфейсом. ( IF40A4 )

Версия 1.6.0-бета02

29 ноября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta02 выпускается. Версия 1.6.0-BETA02 содержит эти коммиты.

Исправления ошибок

  • Исправление для canScroll не обновляется после прокрутки только для реле. ( I60a86 )
  • Исправлено для Modifier.animateItemPlacement() и LookaheadScope после небольших свитков. ( I3a2b7 )

Версия 1.6.0-бета01

15 ноября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta01 выпускается. Версия 1.6.0-BETA01 содержит эти коммиты.

Изменения API

  • Модификатор DragAndDropTarget теперь явно принимает приема DragAndDropTarget и имеет лямбду, чтобы выбрать сеанс перетаскивания. Сейчас есть две заводские функции для DragAndDropModifierNode . Один для получения переводов и один для передачи данных ( i69481 )
  • Обновленная maximumFlingVelocity которая будет представлена ​​как Float. Обновленная документация, чтобы быть более ясной в отношении единства maximumFlingVelocity . ( I8Adc7 )
  • onDragAndDropStart на фабрике DragAndDropModifierNode был переименован в acceptDragAndDropTransfer .

    acceptsDragAndDropTransfer был добавлен в Modifier dragAndDropTarget , чтобы принять с сеанса перетаскивания. Эта Lambda возвращает жизнеспособную DragAndDropTarget , если заинтересован в сессии перетаскивания. Другие Lambdas для обработки событий сопротивления были заменены на это.

    Функция заводской фабрики DragAndDropTarget была добавлена ​​для получения с сеансов перетаскивания ( IEBF3A )

  • Открытие startDragImmediately в AnchoredDraggable дает контроль для обнаружения жестов перетаскивания при его использовании. Полезно установить его, когда виджет анимирует целевой якорь. См . Образец . ( IE6D13 , B/285139987 )

  • API Foundation Tooltip теперь @ExperimentalFoundationApi ( i30b0b )

  • Удален DragAndDropInfo как тип DragAndDropModifierNode.drag теперь принимает параметры для transferData , размер украшения и украшения DrawScope Lambda

    DragAndDropTarget имеет методы для определенных событий перетаскивания и выпадения вместо того, чтобы быть единственным абстрактным методом

    onDragAndDropEvent в заводской функции для DragAndDropModifierNode был переименован в onDragAndDropStart чтобы лучше сообщить, что предоставленная DragAndDropTarget действителен только для данного перетаскивания и сброса.

    DragAndDropEventType был удален ( i645b1 )

  • Переименованная PlatformTextInputModifierNode.runTextInputSession establishTextInputSession ( I03CD0 )

  • Замените OriginalText TextSubstitution . ( IFA5A8 )

  • Переименованная PlatformTextInputModifierNode.textInputSession для runTextInputSession . ( IE9C6B )

  • Дети SubcomposeLayout (и такие макеты, как LazyColumn основанные на нем), которые сохраняются для повторного использования в будущем, считаются деактивированными. Новый assertIsDeactivated() тестовый API был введен для проверки таких узлов. Остальная часть испытательных API будет отфильтровывать деактивированные узлы по умолчанию. ( I2ef84 , b/187188981 )

  • Параметр Modifier.magnifier clip clippingEnabled .

  • Параметр magnifierCenter Modifier.magnifier сделан нулевым сохранением того же поведения по умолчанию. ( I6aa66 )

  • Материальные API SwipeToReveal (для карт и чипов) теперь полагаются на API на основе слотов (как рекомендовано Compose) вместо экземпляров на основе класса данных для создания этих слотов. Это нарушающее изменение, см. Демо и примеры кода для примеров, как использовать новый API. ( IA8943 )

Исправления ошибок

  • Реализация equals и hashcode для PageSize.Fixed . ( IE3EDE , B/300134276 )
  • Исправлена ​​ошибка, которая приведет к тому, что макет BasicText не сокращается, когда minWidth изменилась, а minWidth меньше, чем ограничения начальной меры, maxWidth ( IDB19C )
  • Добавьте поддержку рендеринга для градиента развертки в ArcLine . ( I4d5bb )
  • Исправьте проблему бинарной совместимости с изменением вставки в окне ( IEE695 )
  • Удалите слой ядра материала для чипа/кнопки Material3, так как Microbenchmarks показывают лучшую производительность без него. ( I55555 )

Версия 1.6.0-Alpha08

18 октября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha08 выпускается. Версия 1.6.0-Alpha08 содержит эти коммиты.

Новые возможности

  • Modifier.draggable2D - это новый модификатор, который обеспечивает легкую поддержку 2D -перетаскивания. См. Пример ( ID95F5 , B/214412658 )

Изменения API

  • Modifier.dragAndDrawSource имел лямбда onDrawDragShadow переименованную в drawDragDecoration , и DragAndDropInfo имел параметр размера, переименованный в dragDecorationSize . ( Id0e30 , b/303904810 )
  • Параметр decorationBox BasicTextField2 переименован в decorator . Его тип также изменяется на эквивалентный забавный интерфейс TextFieldDecorator . ( I23c1c )

Исправления ошибок

  • Улучшенная документация по BasicTextField в отношении требований onValueChange . ( I90fc9 , b/160257648 )

Версия 1.6.0-Alpha07

4 октября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha07 выпущен. Версия 1.6.0-Alpha07 содержит эти коммиты.

Изменения API

  • Представлен PlatformTextInputMethodTestOverride для написания тестов для пользовательских текстовых редакторов. ( ID159b )
  • Переименованная в GraphicsSurface в AndroidExternalSurface ( i11680 )
  • Добавлен DisableNonLinearFontScalingInCompose линейный флаг, чтобы отключить нелинейное масштабирование шрифтов. Установите DisableNonLinearFontScalingInCompose = true в ваших тестах, если вам нужно время для их очистки. Этот флаг будет удален в Compose 1.6.0-BETA01. ( IC9486 )
  • Добавлены ColorList и ColorSet Collections, которые избегают распределений. ( I744bd )
  • Это изменение устраняет shortSnapVelocityThreshold , которая была превращена в детали реализации реализаций SnapLayoutInfoProvider . ( I65f6d )
  • Добавляет модификатор dragAndDropSource для начальных сеансов перетаскивания и модификатора dragAndDropTarget для получения с сеансов перетаскивания ( IB7828 , B/286038936 )
  • Обновите SnapPositionInLayout документацию и метод положения. Введите контент -пачки в метод положения в SnapPositionInLayout . ( ID7938 , B/300116110 )
  • UndoState , что в TextFieldState предоставлена ​​возможность отменить/переделать изменения, внесенные пользователем. ( ICC024 )

Исправления ошибок

  • Исправлен basicMarquee , не анимируя после изменения скорости. ( Id2e77 , b/297974036 )

Версия 1.6.0-Alpha06

20 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha06 выпускается. Версия 1.6.0-Alpha06 содержит эти коммиты.

Новые возможности

  • Новые композиционные обертки для SurfaceView и TextureView: GraphicsSurface() и EmbeddedGraphicsSurface() . Это экспериментальный API и подвержен изменениям и модификациям. ( I9ddb2 )
  • Modifier.magnifier() теперь стабильный API. Это включает в себя удаление MagnifierStyle в пользу встроенных параметров в самом модификаторе. ( I83BEC , B/298381260 , B/262367109 , B/261438887 )

Изменения API

  • Введенная updateCurrentPage и updateTargetPage В ScrollScope , это последние части, необходимые для обеспечения настройки анимированного прокрутки через PagerState.scroll . ( I9cad5 , b/2677444105 , b/243786897 )
  • Удалить плотность из SnapFlingBehavior . Все реализации SnapLayoutInfoProvider уже имеют способ получить доступ к плотности, прицел приемника может быть удален, что приведет к менее сложной реализации как SnapFlingBehavior , так и SnapLayoutInfoProviders . ( I153C3 )
  • Больше модификаторов отмечены как стабильные. ( I56af1 , b/298046462 )
  • Удален SnapStepSize из SnapLayoutInfoProvider . Расчет должен быть выполнен с использованием информации о макете и предоставлена ​​с помощью подхода или схватывания. ( If320c )

Поведение изменяется

  • Compose теперь использует нелинейное масштабирование шрифтов для лучшей читаемости и доступности. Когда шрифт шрифт> 100% в настройках системы, небольшой текст будет нормально увеличиваться, но уже более широкий текст только немного увеличится. Кроме того, высота линии, определенные в SP, автоматически приспосабливаются к тому, чтобы оставаться пропорциональными 100% -ную масштабную высоту. Смотрите лучшие практики масштабирования шрифта для получения дополнительной информации. ( I11518 )

Исправления ошибок

  • Удалите использование rememberSaveable для подсказки инструментов. ( ICC131 , B/299500338 )

Версия 1.6.0-Alpha05

6 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha05 выпускается. Версия 1.6.0-Alpha05 содержит эти коммиты.

Изменения API

  • Добавьте перегрузки для BasicSecureTextField , которые принимают неизменное значение и обратный вызов, чтобы изменить это значение, как и текущий API BasicTextField . ( IA4882 )
  • Добавить Modifier.preferKeepClear() , чтобы отметить так же, как предпочтение, чтобы не допустить плавающих окон на API 33 и выше. ( IB51D5 , B/297260115 )
  • Скорости броска в виде компонентов, таких как ScrollView и RecyclerView ограничены на ViewConfiguration.ScaledMaximumFlingVelocity . Compose теперь содержит свою собственную версию maximumFlingVelocity , которая теперь относится к Draggable . ( IBF974 )
  • Удаленное устаревшее Pager и перегрузки PagerState . ( IEA07E )
  • Добавлен BasicTooltipBox для compose.foundation и обновленного PlainTooltipBox и RichTooltipBox для использования TooltipBox с новыми композициями PlainTooltip и RichTooltip . ( I79e1d )

Версия 1.6.0-Alpha04

23 августа 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha04 выпускается. Версия 1.6.0-Alpha04 содержит эти коммиты.

Изменения API

  • Добавить интерфейс ReusableComposition для управления жизненным циклом и повторного использования подкомпозиций. ( I812D1 , B/2528446775 )
  • Modifier.focusGroup был продвинут до стабильных API. ( I7ffa3 )
  • Добавьте перегрузки для BasicTextField2 , которые принимают неизменное значение и обратный вызов, чтобы изменить это значение, как и текущий API BasicTextField . ( I3f2b8 )
  • GridItemSpan::currentLineSpan теперь стабильный API. ( ICC29C )
  • Canvas, который принимает contentDescription , теперь является стабильным API. ( IB3D29 )
  • Введен viewportSize в ScrollState , способ узнать размер viewPort компонента, который использует ScrollState после измерения. ( I8b85a , b/283102682 )
  • Исправлена ​​проблема, в которой предварительная выборка в пейджере не соответствовала поведению в взглядах. ( I93352 , B/289088847 )
  • Modifier.consumeWindowInsets(PaddingValues) теперь стабилен.
    • Deprecated Modifier.consumedWindowInsets API ConsumedWindowinsets теперь удален. Вместо этого используйте Modifier.consumeWindowInsets . ( ID72BB )

Версия 1.6.0-Alpha03

9 августа 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha03 выпускается. Версия 1.6.0-Alpha03 содержит эти коммиты.

Изменения API

  • Перегрузка LazyLayout добавлена, он принимает лямбду LazyLayoutItemProvider , а не простой объект, как это было раньше. Предыдущая перегрузка устарела. ( I42a5a )
  • Добавлена ​​поддержка для настройки privateImeOptions ( IDB772 )

Исправления ошибок

  • Фиксированные текстовые поля, показывающие клавиатуру и редактируемые, когда readOnly верно. Также исправлена ​​клавиатура, не показывающая, когда readOnly изменяется с истины на ложь, когда они сфокусированы. ( I34a19 , b/246909589 )

Версия 1.6.0-Alpha02

26 июля 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha02 выпускается. Версия 1.6.0-Alpha02 содержит эти коммиты.

Изменения API

  • Представил PagerLayoutInfo с информацией, собранной после прохода меры в Pager . Также представил PageInfo , информация о одной измеренной странице в Pager . ( IAD003 , B/283098900 )
  • Дополнительные аннотации для указания разрешенных входов в композиции ( i51109 )
  • Добавлен SemanticsNodeInteraction.requestFocus как более удобный и обнаруженный способ запросить фокус в тестах. ( IE8722 )
  • Полностью переработанный PlatformTextInput* IPI. ( I6c93a , b/2746611182 , b/267235947 , b/277380808 )
  • SoftwareKeyboardController и LocalSoftwareKeyboardController больше не экспериментальны. LocalSoftwareKeyboardController также теперь является правильным CompositionLocal . ( I4c364 )
  • Modifier.transformable теперь предоставляет Pan Delta в параметре canPan чтобы помочь определить направление сковороды, позволяющего его разрешить. ( I692AA , B/266829800 )
  • Обновления модификатора consumeWindowInsets для расширения SuperClass AbstractComposeView ( IACD74 , B/269479941 )

Версия 1.6.0-Alpha01

21 июня 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha01 выпускается. Версия 1.6.0-Alpha01 содержит эти коммиты.

Новые возможности

  • Представил новый AnchoredDraggable API в Foundation. Его можно использовать для создания компонентов, которые можно перетаскивать между дискретными состояниями, такими как модальные нижние листы. Этот API заменяет Swipeable API материала. ( I4a2ed )

Изменения API

  • Поддержка InputConnection#requestCursorUpdates ( i0c69b )
  • Представил scrollAnimationSpec чтобы разрешить пользовательские анимационные характеристики. Обновлено BringIntoViewCalculator для BringIntoViewScroller . ( IDB741 )
  • Добавить тип ResourceResolutionException , чтобы обернуть броски, брошенные при попытке загрузить растровые активы с описанием пути актива, который не удалось загрузить. ( I19F44 , B/230166331 , B/278424788 )
  • Добавлены свойства семантики и действия для поддержки текстового перевода. ( I4a6bc )
  • Представил API BringIntoViewCalculator , который можно использовать для настройки того, как компоненты, такие как Scrollable ответы на bringIntoView . Изменил перегрузку прокрутки, чтобы необязательно принять экземпляр BringIntoViewCalculator . ( Iaf5af )

Исправления ошибок

  • Добавлен проверка ворса, чтобы предупредить, если вы создаете MutableInteractionSource в композиции, не запомнив его, аналогично проверкам ворса для создания изменяемого состояния / Animatable . ( I5daae )
  • Добавлена ​​поддержка для выбора мыши. Отбор на основе прикосновения будет расширяться по слову и сокращаться по характеру. ( IC0C6C , B/180639271 )
  • Добавлен интерфейс FocusTargetModifierNode , который можно использовать для создания пользовательской FocusTarget . ( I9790e )

Версия 1.5

Версия 1.5.4

18 октября 2023 г.

androidx.compose.foundation:foundation-*:1.5.4 выпущен. Версия 1.5.4 содержит эти коммиты.

Версия 1.5.3

4 октября 2023 г.

androidx.compose.foundation:foundation-*:1.5.3 выпущен. Эта версия не имеет изменений.

Версия 1.5.2

27 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.5.2 выпущен. Версия 1.5.2 содержит эти коммиты.

Исправления ошибок

  • Исправлена ​​ошибка в тексте, которая привела к сбоям в определенных обстоятельствах, когда семантика была признана недействительной.

Версия 1.5.1

6 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.5.1 выпущен. Версия 1.5.1 содержит эти коммиты.

Исправления ошибок

  • Фиксированные текстовые поля, показывающие клавиатуру и редактируемые, когда readOnly верно. Также исправлена ​​клавиатура, не показывающая, когда readOnly изменяется с истины на ложь, когда они сфокусированы. ( I34a19 , b/246909589 )

Версия 1.5.0

9 августа 2023 г.

androidx.compose.foundation:foundation-*:1.5.0 выпущен. Версия 1.5.0 содержит эти коммиты.

Важные изменения с 1.4.0

  • Многие основополагающие модификаторы, в том числе Modifier.clickable Modifier.scrollable Modifier.draggable Modifier.Node
  • Улучшения в стабильности пейджеров. Многие ошибки были адресованы.
  • Параметры pageCount сейчас живет в PagerState а не на самом пейджере

Версия 1.5.0-RC01

26 июля 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-rc01 выпускается. Версия 1.5.0-RC01 содержит эти коммиты.

Исправления ошибок

  • Доступна дополнительная проверка, чтобы рекомендовать Migrating mutableStateOf() вызовы в соответствующие специализированные типы для примитивов. Его идентификатор пронзака - AutoboxingStateCreation . Ранее эта проверка была включена по умолчанию для всех проектов. Чтобы увидеть это предупреждение в редакторе Android Studio и выходе из вашего проекта, измените его серьезность от информационного к предупреждению (или выше), объявив warning "AutoboxingStateCreation" внутри build.gradle или build.gradle.kts , как показано ( i34F7E ):

        android {
            lint {
                warning "AutoboxingStateCreation"
            }
            ...
        }
    

Версия 1.5.0-бета03

28 июня 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta03 : 1.5.0-бета03 выпускается. Версия 1.5.0-бета03 содержит эти коммиты.

Версия 1.5.0-бета02

7 июня 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta02 : 1.5.0-бета02 выпускается. Версия 1.5.0-бета02 содержит эти коммиты.

Версия 1.5.0-бета01

24 мая 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta01 : 1.5.0-бета01 выпускается. Версия 1.5.0-бета01 содержит эти коммиты.

Изменения API

  • Реализуйте PlatformDataProvider для обеспечения частоты сердечных сокращений и ежедневных шагов. Интерфейс SensorGateway удаляется из публичного API. ( I55b84 )

Исправления ошибок

  • Уменьшите ассигнования во время ленивого списка/сетки/и т. Д. измерения ( iaf9e2 )
  • Снижение распределения при применении снимков ( i65c09 )
  • Удаленные ассигнования из пружинной анимации ( IE9431 )
  • Removed allocation from TextLayout ( I0fd11 )
  • Removed multiple allocations in pointer velocity tracking ( I26bae )

Версия 1.5.0-альфа04

10 мая 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha04 and androidx.compose.foundation:foundation-layout:1.5.0-alpha04 are released. Version 1.5.0-alpha04 contains these commits.

Изменения API

  • Added optimized TextStyle.merge(...) with full parameter list. ( Iad234 , b/246961787 )
  • Introduce a SnapLayoutInfoProvider that can be used with LazyGridState . ( I92134 , b/269237141 , b/260914964 )
  • Experimental Modifier.animateItemPlacement() was added for the lazy staggered grids item scope. You can apply it on the items in order to achieve the automation position change/reordering animations. ( I4b62d , b/257034719 )
  • Promote GridCells.FixedSize to stable. FixedSize defines a LazyGrid where each cell takes exact size on cross axis, with the remaining space distributed by cross axis arrangement. ( I8542f )
  • Introduced receiver scope PagerScope for Pager and an utility function for calculation a given page offset. ( If2577 )
  • Introduce the snapPositionalThreshold when creating a snap fling behavior. Use this parameter to specify a positional threshold to short snapping in Pager. ( If8f7f )
  • Replaced SnapLayoutInfoProvider.calculateSnappingOffsetBounds with calculateSnappingOffset . In this new method we simply request the next offset to snap to. The calculation of the bounds should be performed at the implementation level as this may differ depending on how one needs snapping to happen. ( I923a4 )
  • LazyStaggeredGrid APIs have been promoted to stable. ( I633a5 )
  • Remove pageCount from Horizontal/VerticalPager . This should be provided at the state creation. Updated PagerState and rememberPagerState to accept the pageCount . ( Ieb52d , b/266965072 )
  • Remove pageCount from Horizontal/VerticalPager . This should be provided at the state creation. Updated PagerState and rememberPagerState to accept the pageCount . ( Ifa3cb , b/266965072 )
  • Introduce shortSnapVelocityThreshold in Pager's SnapFlingBehavior . ( I7379e , b/275579012 )
  • Adds a FlowRowScope and FlowColumnScope . ( I54fe2 )

Исправления ошибок

  • Calls to get semantics on Text when constraints have minWidth and minHeight no longer crash. ( Ibd072 )
  • Fixed regression where keyboard wasn't showing for text fields inside dialogs not created by the Dialog composable. ( I82551 , b/262140644 )

Версия 1.5.0-альфа03

19 апреля 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha03 and androidx.compose.foundation:foundation-layout:1.5.0-alpha03 are released. Version 1.5.0-alpha03 contains these commits.

This release enables the new text rendering stack for Compose. The new stack is performance optimized, and you should see no visible changes.

If you do see changes in rendered text, you can debug by setting NewTextRendering1_5 = false to confirm the behavior difference. Setting this will force recomposition. Please file any behavior differences as bugs.

The debug flag will be removed before the 1.5 beta01 release.( Iada23 , b/246960758 )

Изменения API

  • Make FlowColumn/FlowRow inline. ( Idab37 )

Версия 1.5.0-альфа02

5 апреля 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha02 and androidx.compose.foundation:foundation-layout:1.5.0-alpha02 are released. Version 1.5.0-alpha02 contains these commits.

Изменения API

  • Added support for fixed size cells in LazyGrid and arranging them with cross axis arrangement. ( I83ed9 , b/235121277 , b/267942510 )
  • Added support for fixed size lanes in LazyStaggeredGrid and arranging them with cross axis arrangement. ( I7d519 )
  • UrlAnnotation s in AnnotatedString s can now be opened via accessibility services like TalkBack . ( If4d82 , b/253292081 )
  • Added the InsertTextAtCursor semantics action for text fields. ( I11ed5 )
  • Text-related test actions (eg performTextInput ) will now request focus directly, using the semantics action, instead of clicking on the field. ( I6ed05 )
  • Adds support for cross axis spacing/arrangement using the verticalArrangement in FlowRow and horizontalArrangement in FlowColumn . We also remove the top-level verticalAlignment and horizontalAlignment in FlowRow/FlowColumn . Developers can use Modifier.align instead. This reduces confusion between the naming conventions of verticalAlignment and verticalArrangement . ( I87b60 , b/268365538 )

Версия 1.5.0-альфа01

22 марта 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha01 and androidx.compose.foundation:foundation-layout:1.5.0-alpha01 are released. Version 1.5.0-alpha01 contains these commits.

Изменения API

  • Text and BasicText is refactored to use the new modifier system. This leads to substantial performance improvements in many cases. No changes should be visible. ( If1d17 , b/246961435 )
  • Added the PerformImeAction semantics action to invoke the IME action on text editor nodes. ( Ic606f , b/269633506 )

Исправления ошибок

  • Updated internals of Modifier.hoverable . The hoverable modifier will only be shown in the inspector if it is enabled. ( I82103 )

Версия 1.4

Версия 1.4.3

3 мая 2023 г.

androidx.compose.foundation:foundation:1.4.3 and androidx.compose.foundation:foundation-layout:1.4.3 are released with no changes (only a version bump).

Версия 1.4.2

19 апреля 2023 г.

androidx.compose.foundation:foundation:1.4.2 and androidx.compose.foundation:foundation-layout:1.4.2 are released. Version 1.4.2 contains these commits.

Версия 1.4.1

5 апреля 2023 г.

androidx.compose.foundation:foundation:1.4.1 and androidx.compose.foundation:foundation-layout:1.4.1 are released. Version 1.4.1 contains these commits.

Версия 1.4.0

22 марта 2023 г.

androidx.compose.foundation:foundation:1.4.0 and androidx.compose.foundation:foundation-layout:1.4.0 are released. Версия 1.4.0 содержит эти коммиты.

Важные изменения с версии 1.3.0

  • Added Emoji compat integration to Text and TextField , as well as the lower level Paragraph. It is enabled by default when emojicompat is configured.
  • EmojiCompat can be configured on a specific Text using PlatformParagraphStyle .
  • Added full line span support to LazyStaggeredGrid (I28252)
  • Adding experimental onHover to ClickableText (I6938f)
  • Introduced new experimental overloads for the runComposeUiTest function and create*ComposeRule functions that accept CoroutineContext parameters. The context will be used for the test composition and any LaunchedEffect and rememberCoroutineScope() calls in the composition. ( I10614 , b/265177763 )
  • FlowRow and FlowColumn are now available as @ExperimentalFoundationApi that allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 )
  • Modifier.basicMarquee() is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )

Версия 1.4.0-rc01

8 марта 2023 г.

androidx.compose.foundation:foundation:1.4.0-rc01 and androidx.compose.foundation:foundation-layout:1.4.0-rc01 are released. Версия 1.4.0-rc01 содержит эти коммиты.

Изменения API

  • Introduced new low-level PlatformTextInputAdapter API for building custom text input implementations that talk directly to platform APIs. ( I58df4 )
  • Add support for reverse layout to LazyStaggeredGrid . ( I3ef4a )

Исправления ошибок

  • BasicTextField 's SetText semantics action will now update the text buffer using the same code path as IME updates and the testing functions (eg performTextReplacement ).
  • Text testing functions performTextClearance , performTextReplacement , and performTextSelection now use SemanticsActions . ( I0807d , b/269633168 , b/269624358 )

Версия 1.4.0-бета02

22 февраля 2023 г.

androidx.compose.foundation:foundation:1.4.0-beta02 and androidx.compose.foundation:foundation-layout:1.4.0-beta02 are released. Версия 1.4.0-beta02 содержит эти коммиты.

Изменения API

  • Added a new Modifier.Node.onReset() callback allowing you to reset some local state to properly handle the case when the Layout will be reused (for example as an item of LazyColumn ). Fixed FocusTargetModifierNode to properly reset the focused state. ( I65495 , b/265201972 )
  • Added BlendMode parameter to DrawScope.drawText , Paragraph.paint , and MultiParagraph.paint methods to support different blending algorithms when drawing text on Canvas. ( I57508 )
  • Removed the modifierElementOf() API. Please extend from ModifierNodeElement directly instead. ( Ie6d21 )

Исправления ошибок

  • Adjusting selection handles can no longer select a partial character. ( Idedd1 )
  • Fix crash when ctrl+backspace on empty TextField ( I0427f , b/244185537 )

Версия 1.4.0-бета01

8 февраля 2023 г.

androidx.compose.foundation:foundation:1.4.0-beta01 and androidx.compose.foundation:foundation-layout:1.4.0-beta01 are released. Версия 1.4.0-beta01 содержит эти коммиты.

Новые возможности

  • Since 1.3, added Emoji compat integration to Text and TextField , as well as the lower level Paragraph. It is enabled by default when emojicompat is configured.
  • EmojiCompat can be configured on a specific Text using PlatformParagraphStyle .

Изменения API

  • Added common implementation of PinnableContainer API used in all LazyLayouts to retain items that exit composition, but still need to be active. ( If45a4 )
  • PinnableContainer.PinnedHandle.unpin() was renamed to release() ( I4667a )

Внешний вклад

  • Added mainAxisItemSpacing property to LazyListLayoutInfo , LazyGridLayoutInfo and LazyStaggeredGridItemInfo ( I52fad )

Version 1.4.0-alpha05

25 января 2023 г.

androidx.compose.foundation:foundation:1.4.0-alpha05 and androidx.compose.foundation:foundation-layout:1.4.0-alpha05 are released. Version 1.4.0-alpha05 contains these commits.

Новые возможности

  • Added full line span support to LazyStaggeredGrid ( I28252 )
  • Adding experimental onHover to ClickableText ( I6938f )
  • Introduced new experimental overloads for the runComposeUiTest function and create*ComposeRule functions that accept CoroutineContext parameters. The context will be used for the test composition and any LaunchedEffect and rememberCoroutineScope() calls in the composition. ( I10614 , b/265177763 )

Изменения API

  • Merges the pre/post APIs of OverscrollEffect into combined 'decorator' applyToScroll and applyToFling functions. See the updated samples in the documentation for examples of how to implement an overscroll effect with the new API shape. ( I8a9c4 , b/255554340 )
  • More type/nullability of inline/deprecated-hidden functions ( I24f91 )
  • LineBreak and Hyphens APIs in TextStyle are graduated to stable. ( Ic1e1d )

Исправления ошибок

  • The cursor in text fields will now continue to blink even when animations are disabled. ( I95e70 , b/265177763 )
  • Modifier.basicMarquee now animates even when animations are disabled in the system settings. ( I23389 , b/262298306 , b/265177763 )

Внешний вклад

  • notifyFocusedRect methods in TextInputSession and TextInputService are not deprecated again. ( I23a04 , b/262648050 )

Version 1.4.0-alpha04

11 января 2023 г.

androidx.compose.foundation:foundation:1.4.0-alpha04 and androidx.compose.foundation:foundation-layout:1.4.0-alpha04 are released. Version 1.4.0-alpha04 contains these commits.

Новые возможности

  • FlowRow and FlowColumn are now available as @ExperimentalFoundationApi that allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 )
  • Modifier.basicMarquee() is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )

Изменения API

  • FocusRequesterModifier is deprecated in favor of FocusRequesterNode ( I7f4d7 , b/247708726 , b/255352203 , b/253043481 , b/247716483 , b/254529934 , b/251840112 , b/251859987 , b/257141589 )
  • AndroidFont constructor with variationSettings is now a stable API, and can be used to create new types of font descriptors. ( I5adcc , b/261565807 )
  • Introduced PinnableContainer api propagated by lazy lists via a composition local which allows to pin current item. This means such item will not be disposed when it is scrolled away from the view. For example, Modifier.focusable() will pin the current focused item via this mechanism. ( Ib8881 , b/259274257 , b/195049010 )
  • Rewrote the way scrollables respond to bringIntoViewRequesters and focusables to better model the complexity of those operations and handle more edge cases. ( I2e5fe , b/241591211 , b/192043120 , b/237190748 , b/230756508 , b/239451114 )
  • More return type nullability of deprecated-hidden functions ( Ibf7b0 )
  • Added experimental TextMotion to TextStyle to define Text either to be Static(default) or Animated. Use TextMotion.Animated if Text is going to be scaled, translated, or rotated via animation. ( I24dd7 )
  • Add TextFieldFocusModifier to fix focus navigation behaviour for android platform ( I00303 )
  • Replaced maxSize: IntSize argument in drawText with size: Size to be inline with other DrawScope functions. size is set to Size.Unspecified by default which should not change the previous default behavior. ( Icd27d )

Исправления ошибок

  • Adjustments in the snapping physics in SnapFlingBehaviour for a more natural feel.

Known Issue

  • When updating from androidx.compose.foundation:1.4.0-alpha03 to androidx.compose.foundation:1.4.0-alpha04 , you might experience a java.lang.NoSuchFieldError error. Here is where the issue was orginially reported. A fix has been submitted, and will be available on the next Compose update. As a work around, update your androidx.compose.material and androidx.compose.material3 libraries to the latest version(1.1.0-alpha04) or downgrade your androidx.compose.foundation to 1.4.0-alpha03.

Version 1.4.0-alpha03

7 декабря 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha03 and androidx.compose.foundation:foundation-layout:1.4.0-alpha03 are released. Version 1.4.0-alpha03 contains these commits.

Изменения API

  • In UI tests using a Compose rule, continuations resumed during withFrameNanos callbacks 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 calls withFrameNanos or withFrameMillis directly, 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) -> Unit parameter to TestMonotonicFrameClock constructor and factory function to run code after withFrameNanos callbacks but before resuming callers' coroutines. ( Idb413 , b/254115946 , b/222093277 , b/255802670 )
  • Introduce Page accessibility actions: PageUp , PageDown , PageLeft , PageRight . Note that these are only available from API 29. ( Ida4ab )
  • Introduce HorizontalPager and VerticalPager , a way of showing composables in a Pager manner. Introduced PagerState to control the Pagers as well as query information about the Pager's current state. Introduced PageSize , a way of controlling the size of a Pager's page, this can be used to create a carousel like Pagers. Introduced PagerSnapDistance , a way to control how snapping will work in Pager's fling behavior. ( I01120 )
  • Introduced an overload in SnapFlingBehavior.performFling to help to understand where the fling will settle. ( I569f6 )
  • Removed OverscrollEffect#isEnabled . Instead of needing to remember and set this flag, just don't dispatch events to the overscroll effect in cases where you do not want overscroll to show (for example if ScrollableState#canScrollForward/backward both return false). ( I1a4b0 , b/255554340 , b/255557085 )
  • Added ScrollableState#canScrollForward and ScrollableState#canScrollBackward to query whether a ScrollableState has room to scroll in either direction (whether it is at the minimum / maximum of its range). This defaults to true for backwards compatibility with existing implementations of ScrollableState . Consumers can use this to show indication to the user that there is still room to scroll, and this could also be used to avoid dispatching delta to ScrollableStates that have no room to scroll in a given direction, to reduce unnecessary work. ( Idf1a0 , b/255557085 )
  • Added an Modifier API to query ancestors scroll info. ( I2ba9d , b/203141462 )
  • Used in Clickable to correctly delay press interactions, when gestures could become scroll events.
  • Fixed Clickables not correctly delaying ripples, when used inside an Scrollable ViewGroup .
  • Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events.
  • Update snapStepSize naming to be consistent with other methods in SnapLayoutInfoProvider . ( Ife67c )
  • Added EmojiCompat to Compose ( Ibf6f9 , b/139326806 )
  • Renamed consumedWindowInsets() to consumeWindowInsets() and withConsumedWindowInsets() to onConsumedWindowInsetsChanged() and made the Modifiers public. ( Ie44e1 )

Исправления ошибок

  • The crash with Modifier.animateItemPlacement() and Lazy grids was fixed. It was happening in some conditions when the new items count is smaller then the previous one. ( I0bcac , b/253195989 )

Версия 1.4.0-альфа02

9 ноября 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha02 and androidx.compose.foundation:foundation-layout:1.4.0-alpha02 are released. Версия 1.4.0-alpha02 содержит эти коммиты.

Изменения API

  • awaitFirstDown and waitForUpOrCancellation now accept a PointerEventPass for greater flexibility. ( I7579a , b/212091796 )
  • Revert beyondBoundCount API from Lazy* APIs ( I12197 )
  • Introduced parameter in Lazy APIs to compose and place out of viewport items ( I69e89 , b/172029355 )
  • Added minLines parameter to the BasicText and BasicTextField . It allows to set the minimum height of these composables in terms of number of lines ( I24294 , b/122476634 )

Версия 1.4.0-альфа01

24 октября 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha01 and androidx.compose.foundation:foundation-layout:1.4.0-alpha01 are released. Версия 1.4.0-alpha01 содержит эти коммиты.

Изменения API

  • A new method, awaitEachGesture() , for gesture detectors was added. It operates similar to forEachGesture() , but the loop over gestures operates entirely within the AwaitPointerEventScope so events can't be lost between iterations.
  • forEachGesture() has been deprecated in favor of awaitEachGesture() because it allows events to be lost between gestures. ( Iffc3f , b/251260206 )
  • Added WindowInsets.imeAnimationSourc e and WindowInsets.imeAnimationTarget to determine the animation progress and know where the IME will be after animation completes. ( I356f1 , b/217770337 )

Version 1.3

Version 1.3.1

9 ноября 2022 г.

androidx.compose.foundation:foundation:1.3.1 and androidx.compose.foundation:foundation-layout:1.3.1 are released. Version 1.3.1 contains these commits.

Исправления ошибок

  • Fix performance issue in BeyondBoundsLayout ( aosp/2255266 )
  • ContentInViewModifier will not read layout coordinates unless attached ( aosp/2241316 )

Версия 1.3.0

24 октября 2022 г.

androidx.compose.foundation:foundation:1.3.0 and androidx.compose.foundation:foundation-layout:1.3.0 are released. Версия 1.3.0 содержит эти коммиты.

Важные изменения с версии 1.2.0

  • Experimental versions of LazyVerticalStaggeredGrid and LazyHorizontalStaggeredGrid were introduced.
  • SnapFlingBehavior , rememberSnapFlingBehavior and other corresponding APIs were added as experimental.
  • Modifier.clickable , Modifier.toggleable , and Modifier.selectable now show ripples if clicked with the keyboard or d-pad on a remote control.

Версия 1.3.0-rc01

5 октября 2022 г.

androidx.compose.foundation:foundation:1.3.0-rc01 and androidx.compose.foundation:foundation-layout:1.3.0-rc01 are released. Версия 1.3.0-rc01 содержит эти коммиты.

Изменения API

  • Introduced lowVelocityAnimationSpec used by the approach step when there's not enough fling velocity to decay. ( Iaeb27 )
  • Added new experimental API Hyphens to support automatic hyphenation in Text ( Iaa869 )

Version 1.3.0-beta03

21 сентября 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta03 and androidx.compose.foundation:foundation-layout:1.3.0-beta03 are released. Version 1.3.0-beta03 contains these commits.

Изменения API

  • Add options to customize line breaking in Text. ( I86907 )
  • BringIntoViewResponder s are now able to get the most up-to-date bounds of a request while processing it. ( If86a5 , b/241591211 )
  • Introduce support for spacings between items to experimental Staggered Grid ( I10b82 )
  • Introduce content padding to experimental Staggered Grid ( I342ea )
  • Changed size:IntSize argument with constraints: Constraints in TextMeasurer.measure method to support minimum width constraints. ( I37530 , b/242707525 )
  • Added Modifier.withConsumedWindowInsets() to get consumed WindowInsets for use outside windowInsetsPadding .
  • Added MutableWindowInsets to allow easily changing WindowInsets without recomposition. ( I7fd28 , b/237019262 , b/243119659 )

Version 1.3.0-beta02

7 сентября 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta02 and androidx.compose.foundation:foundation-layout:1.3.0-beta02 are released. Version 1.3.0-beta02 contains these commits.

Изменения API

  • Initial version of experimental StaggeredGrid ( Ia48be )
  • Renamed FocusDirection.In and FocusDirection.Out to FocusDirection.Enter and FocusDirection.Exit ( Ia4262 , b/183746982 )
  • Introduced a rememberSnapFlingBehavior overload that provides a quick way of enabling snapping in LazyLists . ( Ifb48a )
  • Replaced the snapFlingBehavior factory with a concrete SnapFlingBehavior class. Scoped SnapLayoutInfoProvider methods to Density to make Dp<->Px conversions easier for the API users. ( I54a11 )
  • Update LazyLayoutMeasureScope.measure to return list of placeables, highlighting desired immutability of the returned value. ( I48b7c )
  • Introduced SnapLayoutInfoProvider which takes a LazyListState to create an instance of SnapLayoutInfoProvider that can be used to enable a snap FlingBehavior for LazyLists . ( I2dd10 )

Исправления ошибок

  • Refactors AwaitPointerEventScope#awaitLongPressOrCancellation to match other await functions ( I646e6 )

Версия 1.3.0-бета01

24 августа 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta01 and androidx.compose.foundation:foundation-layout:1.3.0-beta01 are released. Версия 1.3.0-beta01 содержит эти коммиты.

Изменения API

  • Removed pointerPosition from OverscrollEffect - effects that care about pointer position can use Modifier.pointerInput { } in the effectModifier to get the current pointer position instead. ( I9f606 , b/241239306 )
  • Exposed AwaitPointerEventScope#awaitLongPressOrCancellation as additional building block for more complex gesture detection ( I04374 , b/181577176 )
  • Introduced lazyListSnapLayoutInfoProvider to enable snapping in Lazy Lists. ( I3ecdf )
  • Introduced SnapFlingBehavior , a fling behavior that enables list snapping. Provide an instance of SnapLayoutInfoProvider with information about your snapping layout. ( Ie754c )

Версия 1.3.0-альфа03

10 августа 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha03 and androidx.compose.foundation:foundation-layout:1.3.0-alpha03 are released. Версия 1.3.0-alpha03 содержит эти коммиты.

Изменения API

  • Resource Fonts now support setting font variation settings (API 26+). ( I900dd , b/143703328 )
  • Variable font support in DeviceFontFamilyNameFont ( Ic1279 , b/143703328 )
  • Removed experimental annotation from PlatformTextStyle and LineHeightStyle . ( I64bef )
  • Text fields will now throw more detailed exceptions when the OffsetMapping provided by a VisualTransformation returns invalid indices. ( Ie73f9 , b/229378536 )
  • Introduce experimental APIs to share item provider logic between Lazy layouts. ( Ic891c )
  • ScrollableDefaults.reverseDirection() is not experimental anymore. ( Iba646 )
  • Deprecated SemanticsModifier.id and moved the semantics id to LayoutInfo.semanticsId instead. ( Iac808 , b/203559524 )
  • checkScrollableContainerConstraints() is not experimental anymore. ( I2c290 )
  • Modifier.clipScrollableContainer() is not experimental anymore. ( Ia2b44 )
  • Deprecate TextInputService.show|hideSoftwareKeyboard . Please use SoftwareKeyboardController instead in app code and TextInputSession in IME-management code. ( I14e4c , b/183448615 )

Версия 1.3.0-альфа02

27 июля 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha02 and androidx.compose.foundation:foundation-layout:1.3.0-alpha02 are released. Версия 1.3.0-alpha02 содержит эти коммиты.

Изменения API

  • Added drawText extension function on DrawScope to provide a way to draw multi-styled text on composables and modifiers that operate on a DrawScope like Canvas and drawBehind . ( I16a62 , b/190787898 )

Исправления ошибок

  • Soft keyboard will now be hidden when a text field is disabled while focused. ( I6e3e4 , b/237308379 )
  • When adding InputEventChange events to Velocity Tracker we will consider now deltas instead of positions, this will guarantee the velocity is correctly calculated for all cases even if the target element moves ( Icea9d , b/216582726 , b/223440806 , b/227709803 )
  • When a scrollable has a focused child, it will now correctly scroll to keep the focused child in view when its size is decreased, even when the size is animated. ( I80867 , b/230756508 , b/220119990 )
  • Fixed a crash where TextField is cleared and refilled while selection is active. ( I1235b , b/208655565 , b/214253689 )

Версия 1.3.0-альфа01

29 июня 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha01 and androidx.compose.foundation:foundation-layout:1.3.0-alpha01 are released. Версия 1.3.0-alpha01 содержит эти коммиты.

Изменения API

  • Introduced the UrlAnnotation annotation type and associated methods to support TalkBack link support in AnnotatedString s. ( I1c754 , b/231495122 )

Исправления ошибок

  • BasicTextField cursorBrush may now be animated without restarting the cursor timer. ( I812e6 , b/236383522 )

Версия 1.2

Version 1.2.1

10 августа 2022 г.

androidx.compose.foundation:foundation:1.2.1 and androidx.compose.foundation:foundation-layout:1.2.1 are released. Version 1.2.1 contains these commits.

Версия 1.2.0

27 июля 2022 г.

androidx.compose.foundation:foundation:1.2.0 and androidx.compose.foundation:foundation-layout:1.2.0 are released. Версия 1.2.0 содержит эти коммиты.

Важные изменения с версии 1.1.0

  • LazyVerticalGrid and LazyHorizontalGrid are stable now.
  • You can now specify a content type for items in Lazy lists and grids. This will allow the components to reuse elements more efficiently.
  • Lazy lists and grids now have userScrollEnabled param which allows to disable scrolling via the user gestures.
  • A new experimental API called LazyLayout was added. It It is the API we use internally to power Lazy lists and grids.
  • OverscrollEffect API has been introduced as experimental. You can define custom overscroll effects as well as adding a standard platform one to custom scrollable containers.
  • Nested scrolling interoperability APIs have been introduced to allow for interoperability between views and compose scrolling actors.
  • Mouse and trackpad scrolling has been added to all scrolling containers.

Version 1.2.0-rc03

29 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc03 and androidx.compose.foundation:foundation-layout:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits.

  • No changes since 1.2.0-rc02.

Version 1.2.0-rc02

22 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc02 and androidx.compose.foundation:foundation-layout:1.2.0-rc02 are released. Version 1.2.0-rc02 contains these commits.

Версия 1.2.0-rc01

15 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc01 and androidx.compose.foundation:foundation-layout:1.2.0-rc01 are released. Версия 1.2.0-rc01 содержит эти коммиты.

Изменения API

  • An experimental OverscrollEffect has been introduced to allow for custom overscroll effects, alongside the Modifier.scrollable overloads that accept it.
  • Experimental LocalOverScrollConfiguration has been moved from foundation.gesture to foundation package and renamed to LocalOverscrollConfiguration ( If19fb , b/204650733 )
  • Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
  • Introduced an experimental api checkScrollableContainerConstraints() which allows to check that we do not nest scrollable containers. You can use it when create your own scrollable lazy layouts via LazyLayout . ( Id6fab , b/233352497 )
  • Removed deprecated LazyVerticalGrid from androidx.compose.foundation.lazy package. The new stable api is located in androidx.compose.foundation.lazy.grid ( I73c76 , b/225192009 )

Version 1.2.0-beta03

1 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta03 and androidx.compose.foundation:foundation-layout:1.2.0-beta03 are released. Version 1.2.0-beta03 contains these commits.

Изменения API

  • Added new experimental IntervalList and MutableIntervalList . It allows to represent some list of values via multiple intervals. It will be useful when you want to define your own dsl similar to the one used by LazyColumn where list items can be defined via multiple item/items calls. ( I2d05e , b/228580728 )

Исправления ошибок

  • Clarified the documentation for WindowInsets.ime to state that ime insets are reported as far back as API 23, but only animated on 30+. ( Ia7fc0 , b/230756508 )
  • Pressing the forward delete key when the cursor is at the end of a text field will no longer crash.
  • DeleteSurroundingTextCommand and DeleteSurroundingTextInCodePointsCommand now require their constructor arguments to be non-negative. ( Ica8e6 , b/199919707 )

Version 1.2.0-beta02

18 мая 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta02 and androidx.compose.foundation:foundation-layout:1.2.0-beta02 are released. Version 1.2.0-beta02 contains these commits.

  • Downloadable font resolution that does not change the layout size of Text or TextField previously would not redraw, leading to stale font display. This bugfix ensures that text layout always triggers redraw (b/229727404). ( I1d49e , b/229727404 )

Версия 1.2.0-бета01

11 мая 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta01 and androidx.compose.foundation:foundation-layout:1.2.0-beta01 are released. Версия 1.2.0-beta01 содержит эти коммиты.

Новые возможности

  • This is the first beta release of 1.2!

Изменения API

  • Added experimental BeyondBoundsInterval that can be used by custom implementations of LazyList when they layout items beyond visible bounds ( Ifabfb , b/184670295 )
  • LineHeightBehavior is renamed as LineHeightStyle
  • LineVerticalAlignment is renamed as LineHeightStyle.Alignment
  • Renames LineHeightTrim is renamed as LineHeightStyle.Trim
  • Default constructor values from LineHeightStyle is removed ( I582bf , b/181155707 )
  • Added default values for the optional members of LazyLayoutItemProvider interface. ( Iba8a0 )
  • In the LazyLayoutItemProvider api instead of a factory returning the composable lambda by index we now have a simpler composable function Item accepting the index. ( Id2196 )
  • LazyLayoutItemsProvider is renamed to LazyLayoutItemProvider ( I0638c )
  • LazyLayoutItemsProvider.itemsCount is renamed to itemCount ( Id409c )
  • Added Brush to TextStyle and SpanStyle to provide a way to draw text with gradient coloring. ( I53869 , b/187839528 )
  • trimFirstLineTop , trimLastLineBottom attributes of LineHeightBehavior changed into a single enum: LineHeightTrim . LineHeightTrim have values of 4 states defined by two booleans: FirstLineTop , LastLineBottom , Both and None ( Ifc6a5 , b/181155707 )
  • Added LineHeightBehavior to the TextStyle and ParagraphStyle. LineHeightBehavior controls 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 by TextStyle ( 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 , trimLastLineBottom configurations works correctly only when includeFontPadding is false. ( I97332 , b/181155707 )

  • Added experimental imeNestedScroll() modifier so that developers can control the IME through scrolling. ( I60759 )

Исправления ошибок

  • Fixed regression where text fields would not hide the keyboard when removed from the composition while focused. ( I7a410 , b/230536793 , b/225541817 )
  • Support ellipsis when height is limited and doesn't fit all text lines ( Ie528c , b/168720622 )
  • BringIntoViewRequester.bringIntoView will now always suspend until the request is either completed or was interrupted by a newer, non-overlapping request. Overlapping requests will be queued. ( I43e7f , b/216790855 )
  • Concurrent BringIntoViewRequester.bringIntoView calls for rectangles that are completely overlapping will now only honor the larger rectangle's request. ( I34be7 , b/216790855 , b/184760918 )
  • Turned on default includeFontPadding . It is possible to turn off the includeFontPadding using TextStyle.platformTextStyle attribute. 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 solve TextField clipping issues. ( I01423 , b/171394808 )
  • Modifier.bringIntoViewRequester no longer uses onGloballyPositioned . ( I630f5 )

Внешний вклад

  • MouseInjectionScope.scroll(delta = someDelta) is now inverted on Android if we scroll vertically (if someDelta is positive, it will scroll downward) ( Ifb697 , b/224992993 )

Version 1.2.0-alpha08

20 апреля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha08 and androidx.compose.foundation:foundation-layout:1.2.0-alpha08 are released. Version 1.2.0-alpha08 contains these commits.

Изменения API

  • Display all available weights for systems fonts on Android when using FontFamily.SansSerif . This will use fallback font names like sans-serif-medium internally on API 21-28. This is a behavior change as previously only weights 400 and 700 were supported on API 21-28. ( I380fe , b/156048036 , b/226441992 )
  • Paragraph and MultiParagraph are now accepting Constraints parameter. Passing Constraints.maxHeight is a no-op at the moment but will allow to do some calculation in the future, like ellipsizing based on the height. ( I6afee , b/168720622 )
  • SubcomposeSlotReusePolicy.getSlotsToRetain() now accepts a custom MutableSet-like class which doesn't allow adding new items in it. ( Icd314 )
  • Partial consumption (down OR position) has been deprecated in PointerInputChange . You can use consume() to consume the change completely. You can use isConsumed to determine whether or not someone else has previously consumed the change.
  • PointerInputChange::copy() now always makes a shallow copy. It means that copies of PointerInputChange will be consumed once one of the copies is consumed. If you want to create an unbound PointerInputChange , use constructor instead. ( Ie6be4 , b/225669674 )
  • New experimental LazyLayout API is introduced. This allows you to build your own components like LazyColumn of LazyVerticalGrid . Note that the API is in its early stages and can be changed in the future releases. ( Iba2bc , b/166591700 )
  • AndroidFont now takes typefaceLoader as a constructor parameter. ( I2c971 )
  • WindowInsets companion now exposes the visibility (whether they are on the screen, regardless of whether they intersect with the window) and the size they could be if they are available on the device, but not currently active. ( I65182 , b/217770337 )

Version 1.2.0-alpha07

6 апреля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha07 and androidx.compose.foundation:foundation-layout:1.2.0-alpha07 are released. Version 1.2.0-alpha07 contains these commits.

Изменения API

  • Added a PinnableParent API that allows children of lazy layouts to prevent the currently composed items from being disposed ( Ibbdd0 , b/184670295 )
  • LazyListLayoutInfo and LazyGridLayoutInfo now have beforeContentPadding and afterContentPadding fields ( I3b628 , b/200920410 )
  • Added KeyboardType.Decimal as an alternative to Keyboard.Number for specifically including decimal separator in IME. ( Iec4c8 , b/209835363 )
  • Add new font descriptor Font(DeviceFontFamilyName) to optionally lookup system-installed fonts during font fallback chains. ( I30468 , b/219754572 )
  • PointerEventType.Scroll and PointerEvent.scrollDelta are stable APIs now ( I574c5 , b/225669674 )
  • Added temporary compatibility configuration for includeFontPadding in TextStyle/ParagraphStyle. includeFontPadding can be changed via TextStyle(platformStyle = PlatformTextStyle(includeFontPadding = true/false)) . This is a temporary configuration option to enable migration and will be removed. ( If47be , b/171394808 )
  • Updated FontFamily.Resolver to integrate System-wide bold text accessibility setting ( I6c1e7 )
  • The consumeWindowInsets extension property of ComposeView allows developers to disable consumption of Android WindowInsets. This allows separate ComposeViews in the hierarchy to each apply WindowInsets without interfering with each other. ( I0ef08 , b/220943142 )

Version 1.2.0-alpha06

23 марта 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha06 and androidx.compose.foundation:foundation-layout:1.2.0-alpha06 are released. Version 1.2.0-alpha06 contains these commits.

Изменения API

  • Added RequestFocus semantics action to request focus on the focusable target. ( I17b71 )
  • FocusOrder has now been merged into FocusProperties and focusProperties() now has all the capabilities of focusOrder() . FocusOrder and focusOrder() have been deprecated. focusOrder() that accepts a focusRequester should be replaced with a focusRequester() modifier in combination with focusProperties() . This allows the modifiers to have a stronger separation of concerns. ( I601b7 )
  • WindowInsets.asPaddingValues(Density) was added to allow developers to do the conversion without needing to be in composition. ( I94c35 )
  • Updated parsing of vector drawables to support auto mirroring to flip the content of a VectorPainter if the current layout direction is RTL. ( I79cd9 , b/185760237 )

Исправления ошибок

  • Scroll modifiers ( Modifier.verticalScroll() , Modifier.horizontalScroll() , and Modifier.scrollable() ) will now scroll to keep the focused composable visible if the scroll area is resized and the focused composable was previously visible.
  • TextFields will now be kept above the keyboard when they are focused and the keyboard is shown, when inside a non-lazy scrollable and the soft input mode is ADJUST_RESIZE . ( I4a485 , b/190539358 , b/192043120 , b/216842427 )

Version 1.2.0-alpha05

9 марта 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha05 and androidx.compose.foundation:foundation-layout:1.2.0-alpha05 are released. Version 1.2.0-alpha05 contains these commits.

Изменения API

  • LazyVerticalGrid and LazyHorizontalGrid are now stable. ( I307c0 )
  • LazyGridItemInfo.Unknown was replaced with separate LazyGridItemInfo.UnknownRow and LazyGridItemInfo.UnknownColumn ( I56d51 )
  • LazyVerticalGrid / LazyHorizontalGrid and all related apis were moved into .grid subpackage. Please update your imports from androidx.compose.foundation.lazy to androidx.compose.foundation.lazy.grid . ( I2d446 , b/219942574 )
  • Text: includeFontPadding is now turned off by default. The clipping issues as a result of includeFontPadding=false is handled and no clipping should occur for tall scripts. ( I31c84 , b/171394808 )
  • Measured interface now exposes parentData property ( I3313f )
  • Introduced experimental Modifier.onFocusedBoundsChanged to allow observing the bounds of child focusables. ( I14283 , b/220030968 , b/190539358 , b/192043120 , b/216842427 )
  • LazyHorizontalGrid was added. ( I61ae7 , b/191238807 )
  • Added a new LazyVerticalGrid API to define cross axis sizes ( I17723 )
  • Added FocusGroup modifier ( I64bc0 , b/213508274 , b/184670295 )

Исправления ошибок

  • WindowInsets.toString() will now show the correct values. ( I1585d )

Внешний вклад

  • Updated to use Kotlinx coroutines 1.6.0 ( I3366d )

Version 1.2.0-alpha04

23 февраля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha04 and androidx.compose.foundation:foundation-layout:1.2.0-alpha04 are released. Version 1.2.0-alpha04 contains these commits.

Изменения API

  • BringIntoViewResponders are no longer required to manually pass requests up to parent responders, and are instead required to immediately return the rectangle they want their parent to bring into view. ( I8e66a )
  • Support async font loading in Text ( I77057 , b/214587005 )
  • LazyVerticalGrid now supports line breaking before items with span not fitting inside the current line. ( I05c40 , b/207462103 )
  • Renamed excludeFromSystemGestures to systemGesturesExclusion ( I19526 )
  • LazyVerticalGrid now supports reverseLayout. ( I6d7d7 , b/215572963 , b/211753558 )
  • Add WindowInsets.only() method to allow developers to include only dimensions from the WindowInsets. ( I14c94 , b/217768486 )
  • Added ComposableTarget , ComposableTargetMarker and ComposableOpenTarget that 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 ComposeNode or a related composable functions .

    For custom appliers the composable functions that calls ComposeNode or ReusableComposeNode need to add a CompoableTarget annotation for the function and any composable lambda parameter types. It is recommended, however, to create an annotation that is annotated with ComposableTargetMarker and then the marked annotation be used instead of ComposableTarget directly. A composable annotation marked with ComposableTargetMarker is equivalent to a ComposbleTarget with the fully qualified name of the attribute class as the applier parameter. For an example of using ComposableTargetMarker see anroidx.compose.ui.UiComposable . ( I38f11 )

Исправления ошибок

  • Now it is allowed to pass negative scroll offsets into LazyGridState.scrollToItem() and LazyGridState.animateScrollToItem() . ( I025c6 , b/211753558 )
  • Support async font loading for TextField. ( Icc4bf , b/214587005 )

Version 1.2.0-alpha03

9 февраля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha03 and androidx.compose.foundation:foundation-layout:1.2.0-alpha03 are released. Version 1.2.0-alpha03 contains these commits.

Изменения API

  • notifyFocusedRect methods in TextInputSession and TextInputService are now deprecated and won't be called. Use BringIntoViewRequester instead. ( Ia4302 , b/192043120 , b/216842427 , b/178211874 )
  • Animations were enabled for items of lazy grids with Modifier.animateItemPlacement(). ( Ib6621 , b/211753218 )
  • BringIntoViewRequester now propagates requests to the hosting Android View. ( Ia7a51 )
  • FontFamilyResolver is now available via LocalFontFamilyResolver.current
    • Added createFontFamilyResolver(context) and createFontFamilyResolver(context, coroutineScope) to create new FontFamily resolvers outside of compose usage.
    • Paragraph and MultiParagraph now take FontFamily.Resolver
    • TextLayoutResult.layoutInput.fontFamilyResolver now contains the resolver used for this layout, deprecated TextLayoutResult.layoutInput.resourceLoader as it is no longer used. ( Id5a45 , 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.ResourceLoaded API to support optional and async font loading. It is not recommended that application developers use this API directly. To add new types of fonts see AndroidFont.
    • Font.AndroidResourceLoader extension function allows construction of a Font.ResourceLoader when outside of composition.
    • Added loadingStrategy parameter 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 use FontFamilyResolver.preload
    • fontResource(FontFamily): Typeface is deprecated. This was previously used to preload fonts, which may take up to 10 seconds for downloadable fonts. Instead use FontFamilyResolver.preload ( If8e7c , b/174162090 )
  • You can now specify the content type for the items of LazyVerticalGrid - item/items functions on LazyGridScope now accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I7b355 , b/215372836 )
  • LazyListLayoutInfo and LazyGridLayoutInfo now have new properties: viewportSize , orientation , reverseLayout ( Ifc8ed , b/200920410 )
  • You can now specify the content type for the items of LazyColumn/LazyRow - item/items functions on LazyListScope now accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I26506 )
  • SubcomposeLayoutState constructor accepting maxSlotsToRetainForReuse is now deprecated. Instead there is a new constructor accepting SubcomposeSlotReusePolicy - a new interface allowing more granular control on what slots should be retained for the future reuse. ( I52c4d )
  • Adds Modifiers for WindowInsets, both for padding and sizing. This allows some content to extend into the inset area, and still have primary content stay out of the inset area. For example, windowInsetsPadding can be used to pad the content area to avoid areas that may be fully or partially covered. ( Id0395 , b/213942085 )

Исправления ошибок

  • TextFields will now be kept above the keyboard when they are focused and the keyboard is shown, when the soft input mode is ADJUST_PAN . ( I8eaeb , b/190539358 , b/192043120 )
  • Desktop uses composition local for FontFamily.Resolver
    • Desktop FontLoader is deprecated
    • New createFontFamilyResolver factory on Desktop ( I6bbbb , b/174162090 )
  • The soft keyboard input type no longer flickers when changing focus between text fields. ( I1bf50 , b/187746439 )
  • Text fields no longer require an extra back press when the cursor handle is showing. ( Ideb4b , b/205726883 )
  • Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )

Version 1.2.0-alpha02

26 января 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha02 and androidx.compose.foundation:foundation-layout:1.2.0-alpha02 are released. Version 1.2.0-alpha02 contains these commits.

Изменения API

  • Added NonRestartableComposable to methods that are overloads of existing methods without complex logic. This reduces compiler generated memoization checks (equals) for all parameters which are repeated in the inner function that is called. ( I90490 )
  • Added excludeFromSystemGesture Modifiers for easy access to Android's setSystemGestureExclusionRects ( I46f07 )

Исправления ошибок

  • Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )
  • LazyColumn , LazyRow , Modifier.verticalScroll and other containers that use Modifier.scrollable now support mouse wheel scrolling. ( I2b5e1 , b/198214718 )

Версия 1.2.0-альфа01

12 января 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha01 and androidx.compose.foundation:foundation-layout:1.2.0-alpha01 are released. Версия 1.2.0-alpha01 содержит эти коммиты.

Изменения API

  • New parameter userScrollEnabled was added to LazyColumn , LazyRow , and LazyVerticalGrid in order to allow users to temporarily or permanently disable the user initiated scroll via touch gestures or accessibility actions. Scrolling programmatically via the methods on the state will still be allowed. ( I7eae9 , b/201150093 )
  • Add onSizeChanged callback to magnifier modifier. ( I6879f )
  • The magnifier widget now shows when dragging selection handles in a SelectionContainer . ( I30b38 , b/139320979 )

Исправления ошибок

  • Fixes TextField cursor handle not hiding when scrolled out of view. ( I14552 , b/208883748 )

Dependency Updates

  • Now depends on Kotlin 1.6.10 .

Version 1.1

Version 1.1.1

23 февраля 2022 г.

androidx.compose.foundation:foundation:1.1.1 and androidx.compose.foundation:foundation-layout:1.1.1 are released. Version 1.1.1 contains these commits.

Исправления ошибок

Версия 1.1.0

9 февраля 2022 г.

androidx.compose.foundation:foundation:1.1.0 and androidx.compose.foundation:foundation-layout:1.1.0 are released. Version 1.1.0 contains these commits.

Important changes since 1.0.0

  • Stable support for the Android 12 Overscroll effect
  • Improvements to touch target sizing
  • Note that, with respect to Compose 1.0, Material components will expand their layout space to meet Material accessibility guidelines for touch target size . For instance, Button touch target will expand to a minimum size of 48x48dp, even if you set the Button's size to be smaller. This aligns Compose Material to the same behavior of Material Design Components, providing consistent behavior if you mix Views and Compose. This change also ensures that when you create your UI using Compose Material components, minimum requirements for touch target accessibility will be met.
  • Stable support for Navigation Rail
  • Graduates a number of previously experimental APIs to stable
  • Support for newer versions of Kotlin

Version 1.1.0-rc03

26 января 2022 г.

androidx.compose.foundation:foundation:1.1.0-rc03 and androidx.compose.foundation:foundation-layout:1.1.0-rc03 are released. Version 1.1.0-rc03 contains these commits.

Исправления ошибок

  • Updated to support Compose Material 1.1.0-rc03

Версия 1.1.0-rc01

15 декабря 2021 г.

androidx.compose.foundation:foundation:1.1.0-rc01 and androidx.compose.foundation:foundation-layout:1.1.0-rc01 are released. Version 1.1.0-rc01 contains these commits.

Исправления ошибок

  • Now it is allowed to pass negative scroll offsets into LazyListState.scrollToItem() and LazyListState.animateScrollToItem() . ( Iceb90 , b/184252837 )
  • Fixed a bug that caused missing accessibility scroll actions ( I7cbfb )

Version 1.1.0-beta04

1 декабря 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta04 and androidx.compose.foundation:foundation-layout:1.1.0-beta04 are released. Version 1.1.0-beta04 contains these commits.

Новые возможности

  • Updated to be compatible with Kotlin 1.6.0

Изменения API

  • Cleaned up nullability in androidx.core.view ( I7078a , b/204917439 )
  • Experimental APIs were added that allow to consume PointerInputchange as a whole or check whether it was consumed or not. ( I2e59d )
  • Show a magnifier widget when dragging the cursor or selection handles inside text fields. ( I5391e , b/203781358 )

Исправления ошибок

  • Fix text handles not moving when IME visibility changes. ( I25f2e )

Version 1.1.0-beta03

17 ноября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta03 and androidx.compose.foundation:foundation-layout:1.1.0-beta03 are released. Version 1.1.0-beta03 contains these commits.

Изменения API

  • Support for horizontal spans was added to LazyVerticalGrid. ( I7e2fa , b/176758183 )
  • Experimental ability to animate Lazy lists item positions was added. There is a new modifier available within LazyItemScope called Modifier.animateItemPlacement() . Пример использования:

      var list by remember { mutableStateOf(listOf("A", "B", "C")) }
      LazyColumn {
          item {
              Button(onClick = { list = list.shuffled() }) {
                  Text("Shuffle")
              }
          }
          items(list, key = { it }) {
              Text("Item $it", Modifier.animateItemPlacement())
          }
      }
    
    • When you provide a key via LazyListScope.item or LazyListScope.items this modifier will enable item reordering animations. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated. ( I59e7b , b/150812265 )

Version 1.1.0-beta02

3 ноября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta02 and androidx.compose.foundation:foundation-layout:1.1.0-beta02 are released. Version 1.1.0-beta02 contains these commits.

Исправления ошибок

  • Ripples and other indications will now only be delayed if they are inside a Modifier.scrollable() container, instead of always being delayed for a down event. ( Ibefe0 , b/203141462 )
  • Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )

Внешний вклад

  • Added Modifier.pointerHoverIcon ( I95f01 )

Версия 1.1.0-бета01

27 октября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta01 and androidx.compose.foundation:foundation-layout:1.1.0-beta01 are released. Version 1.1.0-beta01 contains these commits.

Исправления ошибок

  • Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )

Version 1.1.0-alpha06

13 октября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha06 and androidx.compose.foundation:foundation-layout:1.1.0-alpha06 are released. Version 1.1.0-alpha06 contains these commits.

Изменения API

  • A child-less overload for Layout was added, with improved efficiency ( Ib0d9a )
  • SemanticsNodeInteraction.performSemanticsAction now returns the SemanticsNodeInteraction on which the function was called. ( I9e5db )
  • Added performScrollToNode(matcher: SemanticsMatcher) that scrolls a scrollable container to the content that is matched by the given matcher. ( Ic1cb8 )

Version 1.1.0-alpha05

29 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha05 and androidx.compose.foundation:foundation-layout:1.1.0-alpha05 are released. Version 1.1.0-alpha05 contains these commits.

Изменения API

Исправления ошибок

  • Fixed accessibility support for scrollables (both lazy and non-lazy) with respect to scrolling ( I6cdb0 )

Version 1.1.0-alpha04

15 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha04 and androidx.compose.foundation:foundation-layout:1.1.0-alpha04 are released. Version 1.1.0-alpha04 contains these commits.

Изменения API

  • Deprecated performGesture and GestureScope , which have been replaced by performTouchInput and TouchInjectionScope . ( Ia5f3f , b/190493367 )
  • Added touchBoundsInRoot to SemanticsNode that includes the minimum touch target size so that developers can ensure that touch targets meet accessibility minimums. ( I2e14b , b/197751214 )

Исправления ошибок

  • Support for stretch overscroll has been added on Android 12 devices. ( Iccf3c , b/171682480 )

Версия 1.1.0-альфа03

1 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha03 and androidx.compose.foundation:foundation-layout:1.1.0-alpha03 are released. Version 1.1.0-alpha03 contains these commits.

Новые возможности

  • Updated Compose 1.1.0-alpha03 to depend on Kotlin 1.5.30 . ( I74545 )

Изменения API

  • Glow effect for scroll has been added. New experimental OverScrollConfiguration API has been added to allow for configuration of the overscroll visual effect. Provide null to turn off the overscroll effect. ( I0c304 , b/171682480 )
  • AwaitPointerEventScope now has withTimeout() and withTimeoutOrNull() ( I507f0 , b/179239764 , b/182397793 )
  • Added test method to get the clipped bounds. ( I6b28e )
  • Added minimum touch target size to ViewConfiguration for use in semantics and pointer input to ensure accessibility. ( Ie861c )

Версия 1.1.0-альфа02

18 августа 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha02 and androidx.compose.foundation:foundation-layout:1.1.0-alpha02 are released. Version 1.1.0-alpha02 contains these commits.

Изменения API

Версия 1.1.0-альфа01

4 августа 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha01 and androidx.compose.foundation:foundation-layout:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits.

Изменения API

  • 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 )
  • TextField now clears selection when back button is pressed, which matches Android EditText behavior. ( I3ca16 , b/174173645 )
  • Add Cursor Handle. ( I07a82 , b/173016579 )

Исправления ошибок

  • Scrolling via semantics actions for lazy lists and regular scrolling components is now animated ( Id9066 , b/190742024 )

Внешний вклад

  • LazyVerticalGrid now accepts both horizontal and vertical arrangement parameters. ( If9c92 )

Версия 1.0

Version 1.0.5

3 ноября 2021 г.

androidx.compose.foundation:foundation:1.0.5 and androidx.compose.foundation:foundation-layout:1.0.5 are released. Version 1.0.5 contains these commits.

Исправления ошибок

  • Fixed a crash tracking derivedStateOf instances. ( aosp/1792247 )

Version 1.0.4

13 октября 2021 г.

androidx.compose.foundation:foundation:1.0.4 and androidx.compose.foundation:foundation-layout:1.0.4 are released. Version 1.0.4 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.31

Version 1.0.3

29 сентября 2021 г.

androidx.compose.foundation:foundation:1.0.3 and androidx.compose.foundation:foundation-layout:1.0.3 are released. Version 1.0.3 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.30

Version 1.0.2

1 сентября 2021 г.

androidx.compose.foundation:foundation:1.0.2 and androidx.compose.foundation:foundation-layout:1.0.2 are released. Version 1.0.2 contains these commits.

Updated to support the Compose 1.0.2 release. Compose 1.0.2 is still compatible with Kotlin 1.5.21 .

Version 1.0.1

4 августа 2021 г.

androidx.compose.foundation:foundation:1.0.1 and androidx.compose.foundation:foundation-layout:1.0.1 are released. Version 1.0.1 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.21 .

Версия 1.0.0

July 28, 2021

androidx.compose.foundation:foundation:1.0.0 and androidx.compose.foundation:foundation-layout:1.0.0 are released. Version 1.0.0 contains these commits.

Major features of 1.0.0

This is the first stable release of Compose. Please see the official Compose Release blog for more details!

Известные проблемы

  • If you are using Android Studio Bumblebee Canary 4 or AGP 7.1.0-alpha04 / 7.1.0-alpha05 , you may hit the following crash:

      java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"
    

    To fix, temporarily increase your minSdkVersion to 24+ in your build.gradle file. This issue will be fixed in the next version of Android Studio Bumblebee and AGP 7.1 . ( b/194289155 )

Version 1.0.0-rc02

July 14, 2021

androidx.compose.foundation:foundation:1.0.0-rc02 and androidx.compose.foundation:foundation-layout:1.0.0-rc02 are released. Version 1.0.0-rc02 contains these commits.

  • Updated border rendering for generic shapes to address issues with paths defined with fixed dimensions. ( aosp/1748871 , b/191817116 )

Version 1.0.0-rc01

1 июля 2021 г.

androidx.compose.foundation:foundation:1.0.0-rc01 and androidx.compose.foundation:foundation-layout:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.

Изменения API

  • Canvas now supports a contentDescription parameter for accessibility. ( Ib547c )

Исправления ошибок

  • Disabled Button, Card, Checkboxes and overall Modifier.clickable(enabled=false) will block clicks from going up to the parent. ( Ic2c3b , b/183908811 )

Version 1.0.0-beta09

16 июня 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta09 and androidx.compose.foundation:foundation-layout:1.0.0-beta09 are released. Version 1.0.0-beta09 contains these commits.

Изменения API

  • Removed ManualFrameClock . If you need to control animations, use composeTestRule.mainClock instead. ( I3c3e8 , b/189951065 )
  • change enum Role and LiveRegionMode to inline classes with private constructor ( Id1890 )
  • KeyboardCapitalization is converted into inline class. ( Id5a1c )
  • TextOverflow is changed to an inline class. ( I433af )

Исправления ошибок

  • Now when you specify the unique keys for LazyColumn/Row items the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one . ( Id263f , b/184257857 )
  • Key constants are @ExperimentalComposeUiApi for now. Consuming code can declare private constants prior to stabilization. ( Ia5d48 )
  • Added IdlingStrategy to AndroidComposeTestRule that can be used by testing frameworks to install an alternative mechanism to await or achieve quiescence. Use AndroidComposeTestRule.setIdlingStrategyFactory() before your test starts to install your own strategy. ( I608fa )

Added Profile Rules

This release adds profile rules to the following compose modules ( I14ed6 ):

  • androidx.compose.animation
  • androidx.compose.animation-core
  • androidx.compose.foundation
  • androidx.compose.foundation-layout
  • androidx.compose.material
  • androidx.compose.material-ripple
  • androidx.compose.runtime
  • androidx.compose.ui
  • androidx.compose.ui.geometry
  • androidx.compose.ui.graphics
  • androidx.compose.ui.text
  • androidx.compose.ui.text
  • androidx.compose.ui.unit
  • androidx.compose.ui.util

What are profile rules?

  • Profile rules for a library are specified in a text file baseline-prof.txt located in the src/main or 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 using adb 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 characters H , S , and P to 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 class androidx.compose.runtime.SlotTable would have a descriptor of Landroidx/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 method fun isPlaced(): Boolean on LayoutNode has the signature isPlaced()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 H indicates that this method is a "hot" method, and should be compiled ahead of time.

  • A method that has the flag S indicates 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 P indicates that it is a method which is called after startup.

  • A class that is present in this file indicates that it is used during startup and should be pre-allocated in the heap to avoid the cost of class loading.

Как это работает?

  • Libraries can define these rules which will be packaged in AAR artifacts. When an app is then built which includes these artifacts, these rules are merged together and the merged rules are used to build a compact binary ART profile that is specific to the app. ART can then leverage this profile when the app is installed on devices in order to ahead-of-time compile a specific subset of the application to improve the performance of the application, especially the first run. Note that this will have no effect on debuggable applications.

Version 1.0.0-beta08

2 июня 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta08 and androidx.compose.foundation:foundation-layout:1.0.0-beta08 are released. Version 1.0.0-beta08 contains these commits.

Изменения API

  • NestedScrollSource enum is replaced by an inline class. ( Ie321b , b/187055290 )
  • Refactored enum usages to inline classes to avoid issues with exhaustive when statements when new enum values are added. ( I2b5eb )
  • Adds a tap timeout to clickable / toggleable to prevent showing a ripple during a scroll / drag ( Ia2704 , b/168524931 )
  • ContentDescription and Text semantics properties are no longer single values but lists. This enables to merge them as they are instead of concatenations. Also provided better testing APIs to utilize these changes ( Ica6bf , b/184825850 )
  • Modifier.focusModifier() is deprecated and replaced by Modifier.focusTarget() ( I6c860 )
  • KeyboardType enum is replaced by an inline class. ( I73045 , b/187055290 )
  • Replaced FocusState enum with a FocusState interface ( Iccc1a , b/187055290 )
  • ImeAction enum is replaced by an inline class. ( I18be5 , b/187055290 )
  • AnnotatedString.withAnnotation functions are now ExperimentalTextApi instead of ExperimentalComposeApi. ( I0cd0a )
    • TextUnit constructor with TextUnitType is now ExperimentalTextApi instead of ExperimentalComposeApi.
  • PaddingValues is now @Stable rather than @Immutable ( I88c50 )

Исправления ошибок

  • Fix crashes of long press the blank area in non-empty text. ( I33ab5 , b/187437299 )
  • Show Toolbar after SelectAll ( I495d9 , b/185919613 )
  • Fix for scrollable containers clipping its children on the cross axis. It was easily reproducible if you have a LazyRow with Card items. now the shadow will not be clipped. ( Icb635 , b/186318448 )
  • Fixed an issue where ripples / other indication would sometimes get stuck on a long click when using Modifier.combinedClickable ( I2298c , b/186223077 )
  • Now detectDragGesures , detectVerticalGestures , and detectHorizontalGestures will consume the position change automatically, no need to call change.consumePositionChange in the onDrag callbacks ( I42fc4 , b/185096350 , b/187320697 )
  • Modifier.onGloballyPositioned() was changed to report the coordinates of this modifier in the modifier chain, not the layout coordinates after applying all the modifiers. This means that now the ordering of modifiers is affecting what coordinates would be reported. ( Ieb67d , b/177926591 )

Version 1.0.0-beta07

18 мая 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta07 and androidx.compose.foundation:foundation-layout:1.0.0-beta07 are released. Version 1.0.0-beta07 contains these commits.

Изменения API

Исправления ошибок

  • LazyColumn/Row will now keep up to 2 previously visible items active (not disposed) even when they are scrolled out already. This allows the component to reuse the active subcompositions when we will need to compose a new item which improves the scrolling performance. ( Ie5555 )
  • Remove paintBackground. ( I38660 )
  • Draw Selection Background using DrawScope. ( I73c61 , b/186674472 )
  • A beta06 regression affecting Row/Column using spacedBy arrangements to layout weighted children was fixed. ( Ifaf8c , b/187326588 )

Version 1.0.0-beta06

5 мая 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta06 and androidx.compose.foundation:foundation-layout:1.0.0-beta06 are released. Version 1.0.0-beta06 contains these commits.

Изменения API

  • Solve Conflict with Navigation Gesture ( I1145e )
  • Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services ( Id54ef , b/180479017 )
  • Added SemanticsActions.ScrollToIndex to scroll a list with indexed items to the item with a certain index, and SemanticsProperties.IndexForKey to get the index of an item in a list with keyed items. Both actions are implemented by LazyList.
    • Added SemanticsNodeInteraction.performScrollToIndex that scrolls a list to the given index, and SemanticsNodeInteraction.performScrollToKey that scrolls a list to the item with the given key. ( I4fe63 , b/178483889 , b/161584524 )
  • AnnotatedString save support to TextFieldValue.Saver. Added addTtsAnnotation and withAnnotation utility functions to AnnotatedString.Builder ( I8cbdc , b/178446304 )
  • Default 0.dp parameter values were added to PaddingValues(horizontal, vertical) ( I05571 , b/181336792 )

Исправления ошибок

  • Row & Column children with weight(fill = false) are no longer making the parent fill the entire available main axis space. ( Ied94d , b/186012444 , b/184355105 )

Version 1.0.0-beta05

21 апреля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta05 and androidx.compose.foundation:foundation-layout:1.0.0-beta05 are released. Version 1.0.0-beta05 contains these commits.

Изменения API

  • FlingBehavior interface is now marked as @Stable. All implementations should comply with the @Stable contract. ( I93354 , b/184830577 )

Исправления ошибок

  • Fixed ACTION_SCROLL_FORWARD , ACTION_SCROLL_BACKWARD , accessibilityActionScrollLeft , accessibilityActionScrollUp , accessibilityActionScrollRight and accessibilityActionScrollDown accessibility scroll actions. Instead of scrolling to the end of the scrollable, it will now scroll by one screen in the given direction. ( Ieccb0 )
  • The AndroidManifest files from ui-test-manifest and ui-tooling-data are now compatible with Android 12 ( I6f9de , b/184718994 )

Version 1.0.0-beta04

7 апреля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta04 and androidx.compose.foundation:foundation-layout:1.0.0-beta04 are released. Version 1.0.0-beta04 contains these commits.

Изменения API

  • Rename hideSoftwareKeyboard and showSoftwareKeyboard on SoftwareKeyboardController to hide() and show() respectively.
    • Provide the full CompositionLocal interface for LocalSoftwareKeyboardController, allowing it to be set (especially useful in tests) ( I579a6 )
  • TextOverflow.Visible is introduced. ( Ic8f89 )
  • Public instances of RowScope , ColumnScope , BoxScope , BoxWithConstraintsScope were removed. ( I4e83e , b/181869067 )

Исправления ошибок

  • Fixed the issue when items of LazyColumn / LazyRow located on the edges were incorrectly positioned after fast fling ( Ie4d13 , b/183877420 )
  • Prior to this change, local composable functions were skippable based on their parameters. After this change, no local composable functions will skip. This change is done because it is common and expected for local functions to capture parameters from the parent and them skipping is a common source of bugs.

    To summarize, consider the example:

    @Composable fun Counter(count: Int, onCountChange: (Int) -> Unit) {
      @Composable fun ShowCount() { Text("Count: $count") }
      ShowCount()
      Button(onClick={ onCountChange(count + 1) }) {
        Text("Increment")
      }
    }
    

    Prior to this change, the ShowCount composable function would always skip, even after the count parameter was updated. Это уже не так. ( I5648a )

Version 1.0.0-beta03

24 марта 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta03 and androidx.compose.foundation:foundation-layout:1.0.0-beta03 are released. Version 1.0.0-beta03 contains these commits.

Изменения API

  • DefaultMonotonicFrameClock is deprecated. Calling withFrameNanos or Recomposer.runRecomposeAndApplyChanges with no MonotonicFrameClock will now throw IllegalStateException . ( I4eb0d )

Исправления ошибок

  • FlingBehavior.performFling() is now called even when velocity is 0 ( I0b6e5 , b/181237123 )

Version 1.0.0-beta02

10 марта 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta02 and androidx.compose.foundation:foundation-layout:1.0.0-beta02 are released. Version 1.0.0-beta02 contains these commits.

Изменения API

  • Multiple small optimizations in LazyColumn measuring logic were added ( Ic6889 )
  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I5951e , b/168778053 )
  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I84472 , b/168778053 )

Исправления ошибок

Version 1.0.0-beta01

24 февраля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta01 and androidx.compose.foundation:foundation-layout:1.0.0-beta01 are released. Version 1.0.0-beta01 contains these commits.

This is the first release of Compose 1.0.0 Beta.

Изменения API

  • onStart callback has been added to detectDragGestures ( I67269 , b/179995594 )
  • Modifiers for sizing to intrinsics are no longer experimental. ( I15744 )
  • Removed dp assertions ( I798d2 )
  • Removed SoftwareKeyboardController callback from all text fields to be replaced by a new API shortly. ( Iae869 , b/168778053 )
  • MeasureBlocks was renamed to MeasurePolicy which became a fun interface. Layout APIs were updated / simplified to use MeasurePolicy. ( Icab48 , b/167662468 , b/156751158 )
  • InteractionState has been replaced with [Mutable]InteractionSource
    • Interfaces are responsible for emitting / collecting Interaction events.
    • Instead of passing interactionState = remember { InteractionState() } to components such as Button and Modifier.clickable() , use interactionSource = remember { MutableInteractionSource() } .
    • Instead of: Interaction.Pressed in interactionState you should instead use the extension functions on InteractionSource, such as InteractionSource.collectIsPressedAsState().
    • For complex use cases you can use InteractionSource.interactions to observe the stream of Interactions. See the InteractionSource documentation and samples for more information.
    • ( I85965 , b/152525426 , b/171913923 , b/171710801 , b/174852378 )
  • Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
  • Created new TextInputSession for input sessions from low level text components such as CoreTextField. ( I8817f , b/177662148 )
  • Placeable now exposes measuredSize, representing the size which the child layout actually measured to. This size might not respect the measurement constraints. ( Ib2729 , b/172560206 , b/172338608 )
  • Add selectionGroup modifier that allows to mark collection of Tabs or RadioButtons for accessibility purposes ( Ie5c29 )
  • Add LazyListState.animateScrollToItem

    This method smooth scrolls to a specific item in the list. ( I4bfd7 )

  • ScrollableState.smoothScrollBy() was renamed to animateScrollBy() LazyListState.snapToItemIndex() was renamed to scrollToItem() ScrollState.smoothScrollTo() was renamed to animateScrollTo() ( I35ded )

  • Modifier.zoomable has been replaced my Modifier.transformable. smoothPanBy, smoothRotationBy have been added as a functionality. ( Ifc32b , b/175294473 )

  • The defaultFactory for compositionLocalOf and staticCompositionLocalOf is 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 defaultFactory lambda should throw an exception. However throwing an exception means that consumers of the local will have an implicit dependency on it being provided that is not enforced by the type system. ( Ifbd2a )

  • Changed Indication#createIndication() to Indication#rememberUpdatedIndication(InteractionState) and removes InteractionState parameter from I ndicationInstance#drawIndication() . IndicationInstance should only be responsible for drawing visual effects, and not launching animations / writing state in response to InteractionState changes. These animations and state writes should happen within rememberUpdatedIndication() instead. The indication parameter in Modifier.indication was also changed to be a required parameter. ( Ic1764 , b/152525426 )

  • Text actions now check focus automatically ( I13777 , b/179648629 )

  • Removed runBlockingWithManualClock ( I15cdc , b/179664814 )

  • Scroll position in Modifier.verticalScroll()/horizontalScroll() is represented with Ints now ( I81298 )

  • smoothScrollBy and scrollBy methods' packages changed to androidx.compose.foundation.gestures.* ( I3f7c1 , b/175294473 )

  • FlingConfig has been renamed to FlingBehavior now allows for customization of suspend animation rather than predefined Decays. ( I02b86 , b/175294473 )

  • Size modifiers were renamed. Modifier.width/height/size were renamed to requiredWidth/requiredHeight/requiredSize. Modifier.preferredWidth/preferredHeight/preferredSize were renamed to width/height/size. ( I5b414 )

  • defaultMinSizeConstraints was renamed to defaultMinSize. ( I4eaae )

  • Modifier.tapGestureFilter has been removed. Use Modifier.pointerInput { detectTapGestures(...) } instead. ( I266ed , b/175294473 )

  • partial consumption was removed from pointer input system. The recommended way of coordinating partial consumtion is Modifier.nestedScroll. ( Ie9c9b )

  • Orientation has been moved to foundation package. VelocirtTracker moved from ui.gesture to ui.input.pointer. ( Iff4a8 , b/175294473 )

  • AnimationClockObservable and subclasses have been removed. AnimatedFloat has been removed. ( Icde52 , b/177457083 )

  • drawerState.open() and drawerState.close() are now suspending functions. Use rememberCoroutineScope() to get the scope of the composition to call them ( I16f60 , b/175294473 )

  • Providers has been renamed to CompositionLocalProvider

    • The Composition constructor no longer accepts a key parameter, and has been deprecated.
    • currentCompositeKeyHash has been turned into a composable top level property instead of a composable top level function.
    • CompositionData and CompositionGroup have been moved to the androidx.compose.runtime.tooling namespace
    • ComposableLambda has been made an interface instead of a concrete class, and no longer has type parameters.
    • ComposableLambdaN has been made an interface instead of a concrete class, and no longer has type parameters.
    • The snapshotFlow function has been moved to the androidx.compose.runtime namespace
    • the merge method of SnapshotMutationPolicy is no longer experimental
    • The @TestOnly top level clearRoots function has been removed. В этом больше нет необходимости.
    • keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
    • Composer.collectKeySourceInformation has been removed. В этом больше нет необходимости.
    • isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
    • Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
    • ( I99b7d , b/177245490 )
  • Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )

  • Modifier.draggable now accepts DraggableState instead of a simple lambda. you can create state via rememberDraggableState { delta -> } to get the same behaviour as before ( Ica70f , b/175294473 )

  • requiredWidth(IntrinsicSize) and requiredHeight(IntrinsicSize) modifiers were added for required sizing to intrinsic sizes. ( I0a6b4 )

  • Deprecated emptyContent() is removed. Use {} instead. ( Idb33f , b/179432510 )

  • Deleted some previously deprecated APIs ( Ice5da , b/178633932 )

Исправления ошибок

  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I658b6 , b/168778053 )

Version 1.0.0-alpha12

10 февраля 2021 г.

androidx.compose.foundation:foundation:1.0.0-alpha12 and androidx.compose.foundation:foundation-layout:1.0.0-alpha12 are released. Version 1.0.0-alpha12 contains these commits.

Изменения API

  • Modifier.pointerInput now requires remember keys to indicate when the pointer input detection coroutine should restart for new dependencies. ( I849cd )
  • Testing update: hasText() will check for both input and label/hint/placeholder texts in the text field ( Iab803 )
  • PaddingValues.Absolute was added and can be used in APIs accepting PaddingValues. ( Ia5f30 )
  • onImeActionPerformed is deprecated. use KeyboardActions instead ( If0bbd , b/179071523 )
  • In order to better match naming conventions with ImageBitmap and ImageVector, ImagePainter has been renamed to BitmapPainter to parallel VectorPainter. ( Iba381 , b/174565889 )
  • Better substring test APIs with substring now as an argument ( Icbe78 )
  • Introduced an InfiniteAnimationPolicy coroutine context element that will be applied in infinite animations. By default no policy is installed, except when running tests with ComposeTestRule . ( I50ec4 , b/151940543 )
  • Animatable.snapTo and Animatable.stop are now suspend functions ( If4288 )
  • ComponentActivity.setContent has moved to androidx.activity.compose.setContent in the androidx.activity:activity-compose module. ( Icf416 )
  • Destructuring and copy() methods have been removed from several classes where they were rarely used. ( I26702 , b/178659281 )
  • Custom keys support for LazyColumn/LazyRow was added. This allows us to smarter handle items reordering. So the state you stored in remember {} blocks will move together with the item when you reorder elements or removed the item from the middle.

    LazyColumn {
        items(users, key = { user -> user.id }) { ... }
    }
    
  • Changed Indication#createInstance to be @Composable, and changed LocalIndication to contain an Indication, not () -> Indication. ( I5eeea , b/157150564 )

  • 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 )

  • Modifier.clickable now doesn't have double and long click support. Use Modifier.combinedClickable to achieve this functionality. ( Iafad1 )

  • toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )

  • IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )

  • Modifier.dragGestureFilter has been deprecated. Use Modifier.pointerInput { detectDragGestures (...)} instead. Alternatively, use Modifier.draggable for one axis drags ( I0ba93 , b/175294473 )

  • Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )

  • Selection was moved to foundation. ( I7892b )

  • Similarly to how we previously removed state { 0 } composable and now promote usage like remember { mutableStateOf(0) } we are going to remove savedInstanceState { 0 } composable. You should use rememberSaveable { mutableStateOf(0) } instead and it will save and restore automatically if the type used inside the MutableState can be stored in the Bundle. If previously you were passing a custom saver object now you need to use a new overload of rememberSaveable which has the stateSaver parameter. The usage will look like this: val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) } ( Ib4c26 , b/177338004 )

  • Added password semantics for accessibility ( I231ce )

  • Added ProgressBarRangeInfo.Indeterminate to mark indeterminate progress bars for accessibility ( I6fe05 )

  • Playtime in animation is now unfiied to nanoseconds ( If776a )

  • @ComposableContract has been deprecated in favor of three more specific annotations.

    @ComposableContract(restartable = false) has become @NonRestartableComposable @ComposableContract(readonly = true) has become @ReadOnlyComposable @ComposableContract(preventCapture = true) has become @DisallowComposableCalls @ComposableContract(tracked = true) has been removed. ( I60a9d )

  • emptyContent() and (@Composable () -> Unit).orEmpty() utilities have been deprecated as they no longer have any positive performance impact or value ( I0484d )

  • Recomposers can now be closed. Closed recomposers will continue recomposition until composition child coroutines complete. Recomposer.shutDown renamed to cancel to contrast with close. ( Ib6d76 )

  • APIs related to LazyVerticalGrid are marked as experimental ( Ia53e3 , b/178519862 )

  • rememberSavedInstanceState() was renamed to rememberSaveable() and moved to androidx.compose.runtime.saveable package. ( I1366e , b/177338004 )

  • RestorableStateHolder was renamed to SaveableStateHolder and moved to androidx.compose.runtime.saveable package. Inner method RestorableStateProvider was renamed to SaveableStateProvider. Generic type was removed so you can just pass Any as a key. Experimental annotation is not needed anymore. ( I0902e , b/174598702 )

  • Saver, listSaver(), mapSaver(), autoSaver was moved from androidx.compose.runtime.savedinstancestate to androidx.compose.runtime.saveable ( I77fe6 )

  • Artefact androidx:compose:runtime:runtime-saved-instance-state was renamed to androidx:compose:runtime:runtime-saveable ( I6dcac )

  • Many longstanding deprecated APIs in the ui package are deleted. ( I2f2dc )

  • The compose:runtime-dispatch artifact is now deprecated. MonotonicFrameClock can now be found in compose:runtime and AndroidUiDispatcher can be found in compose:ui. ( Ib5c36 )

  • Parameters on RounderCornerShape, CutCornerShape and CornerBasedShape were renamed from left/right to start/end in order to support the shape's auto mirroring in the rtl direction. AbsoluteRounderCornerShape and AbsoluteCutCornerShape were introduced for the cases when auto-mirroring is not desired. ( I61040 , b/152756983 )

  • canDrag has been removed from the Modifier.scrollable. ( Id66e7 , b/175294473 )

  • The API the Compose compiler plugin targets has been refactored to use an interface instead of a concrete class. The interface also no longer uses a type parameter.

    This is an internal change that should not effect source code compatibility but is a binary breaking change. ( I3b922 , b/169406779 )

  • Modifier.scaleGestureFilter has been removed. Use Modifier.zoomable instead. Alternatively, use Modifier.pointerInput { detectMultitouchGestures { ... }} ( Id5da1 , b/175294473 )

  • AnimatedValue/Float is now deprecated. Please use Animatable instead. ( I71345 , b/177457083 )

    • Removed CoreText and CoreTextField from public API
    • Removed deprecated SelectionContainer overload ( I99c19 )
  • Remove deprecated non-suspend scrolling functions Continuing with the changes from last release, the non-suspend scrolling functions are now removed entirely. Please convert to the suspend functions with the same names. A coroutine scope can be obtained via rememberCoroutineScope(). ( I3d39c , b/178169563 )

  • androidx.compose.foundation.layout.ConstraintLayout was deprecated in favor of androidx.constraintlayout.compose.ConstraintLayout. You will need to add a dependency on androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha01 . ( I87adc )

  • tapGestureFilter, doubleTapGestureFilter, longPressGestureFilter and pressIndicaitonGestureFilter have been deprecated. Use Modifier.clickable or Modifier.pointerInput with detectTapGestures function instead. ( I6baf9 , b/175294473 )

  • Removed Recomposer.current() . [Abstract]ComposeView now default to lazily created, window-scoped Recomposers driven by the ViewTreeLifecycleOwner for the window. Recomposition and withFrameNanos-based animation ticks are paused while the host Lifecycle is stopped. ( I38e11 )

  • Recomposer.runningRecomposers now offers a global StateFlow of read-only RecomposerInfo for observing ongoing composition state in the process. Prefer this API to Recomposer.current(), which is now deprecated. ( If8ebe )

Version 1.0.0-alpha11

January 28, 2021

androidx.compose.foundation:foundation:1.0.0-alpha11 and androidx.compose.foundation:foundation-layout:1.0.0-alpha11 are released. Version 1.0.0-alpha11 contains these commits.

Изменения API

  • Deprecate non-suspend scrollBy, remove non-suspend scrollTo

    We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating and/or removing the non-suspend versions of these functions as part of this transition. ( Ie9ced )

  • Deprecate non-suspend smoothScrollBy We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating the non-suspend versions of these functions as part of this transition. ( I12880 )

  • Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )

  • BasicTextField received a new parameter called 'decorationBox'. It allows to add the decorations like icons, placeholder, label and similar to the text field and increase the hit target area of it. ( I16996 )

  • canDrag parameter has been removed from the Modifier.draggable ( Ic4bec , b/175294473 )

  • AnimatedFloat.fling that accepts FlingConfig has been removed. Please use suspend Animatable.animateDecay instead. ( I4659b , b/177457083 )

  • Removed data class from the following classes:

    • InlineTextContent
    • LocaleList
    • ( I605c7 )
  • clickable, toggleable and selectable can be created outside of composition now ( I0a130 , b/172938345 , b/175294473 )

  • ScrollableColumn/Row were deprecated. Using ScrollableColumn is less efficient comparing to LazyColumn when you have a large scrolling content because with LazyColumn we can only compose/measure/draw visible elements. To prevent users from going inefficient way we decided to deprecate ScrollableColumn and ScrollableRow and promote usages of LazyColumn and LazyRow instead. Users can still decide they don't need the lazy behaviour and use the modifiers directly like this: Column(Modifier.verticalScroll(rememberScrollState())) ( Ib976b , b/170468083 )

  • New items(count: Int) factory method for scope of LazyColumn/LazyRow/LazyVerticalGrid. items(items: List) and itemsIndexed(items: List) are now extension functions so you have to manually import them when used. New extension overloads for Arrays: items(items: Array) and itemsIndexed(Array) ( I803fc , b/175562574 )

  • The deprecated AbsoluteArrangement was removed. ( Iffa96 , b/177641870 )

  • The propagateMinConstraints parameter was added to Box, for specifying whether the incoming min constraints should be passed to the content of the Box or not. Default is false. ( I0125b , b/152613457 )

Исправления ошибок

  • onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
  • WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
  • Changes to factory functions for Font/FontFamily/Typeface

    • Added factory functions that start with capital letter
    • Deprecated previous factory functions with lowercase first letters
    • New factory functions return the FontFamily instead of subclasses
    • Hid constructors of the subclasses, so that they can only be constructed via factory functions.
    • Renamed Font.asFontFamily to Font.toFontFamily
    • ( I42aa7 )
  • Introduced ComposeContentTestRule , which extends ComposeTestRule and defines setContent , which has been removed from ComposeTestRule . Added a factory method createEmptyComposeRule() that returns a ComposeTestRule and does not launch an Activity for you. Use this when you want to launch your Activity during your test, eg using ActivityScenario.launch ( I9d782 , b/174472899 )

  • animateAsState is now animateFooAsState, where Foo is the type of the variable being animated. eg Float, Dp, Offset, etc ( Ie7e25 )

  • Density is now receiver scope for Arrangement interfaces. ( I18aad )

  • TextFieldValue accepts AnnotatedString. However this is an API only change and multi-style text editing is not implemented yet.

    • Removed initial from EditingBuffer constructor parameters. ( I326d5 )
  • invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )

  • AnnotatedString is changed to extend from kotlin.CharSequence. Therefore length and subSequence are now instance functions, and extension functions are removed. ( Iaf429 )

  • Duration and Uptime will be replace with Long milliseconds, and this step removes the dependency of pointer input on those classes. ( Ia33b2 , b/175142755 , b/177420019 )

  • RememberObserver replaces CompositionLifecycleObserver and CompositionLifecycleObserver is now deprecated.

    RememberObserver is a replacement for CompositionLifecycleObserver with 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 composition onRemembered is called for each reference where onEnter is only called once. onEnter was called multiple time if the object was used in subcompositions, such as WithConstraints and Scaffold making the single onEnter call guarantee unreliable and it was removed for RememberObserver .

    RememberObserver adds onAbandoned which is called if the RememberObserver instance is returned from the callback passed to remember but was not remembered in the composition state and, therefore, will never have onRemembered called. 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 of RememberObserver following the single reference recommendation above is tracking an external resource both onForgotten and onAbandoned each indicate that the resource is no longer needed. If the object is tracking work started or resources allocated in onRemembered , onAbandoned can be ignored as it will not be called if onRemembered is called. ( I02c36 )

  • Renamed TransformedText.transformedText to TransformedText.text

    • TransformedText is no longer a data class ( Ie672a )
  • The following classes are not data classes anymore:

    • AnnotatedString
    • ParagraphStyle
    • SpanStyle
    • TextStyle
    • FontWeight
    • TextDecoration
    • TextGeometricTransform
    • TextIndex
    • TextLayoutResult
    • TextLayoutInput ( Iaff99 )
  • Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )

  • Deprecated global coordinates methods and made new window-based coordinates methods. ( Iee284 )

  • Please use ImeAction.None instead of ImeAction.NoAction

    • Please use ImeAction.Default instead of ImeAction.Unspecified ( Ie1bcc )
  • FocusRequester.createRefs is now marked as experimental as it might change. ( I2d898 , b/177000821 )

  • SemanticsPropertyReceiver.hidden was renamed to invisibleToUser and marked @ExperimentalComposeUiApi. AccessibilityRangeInfo was renamed to ProgressBarRangeInfo. stateDescriptionRange was renamed to progressBarRangeInfo. AccessibilityScrollState was renamed to ScrollAxisRange. horizontalAccessibilityScrollState was renamed to horizontalScrollAxisRange. verticalAccessibilityScrollState was renamed to verticalScrollAxisRange. ( Id3148 )

  • Changed VisualTransformation to be a functional interface ( I3bba4 )

  • Leverage TestCoroutineDispatcher in testing ( I532b6 )

  • Removed PointerInputData and modified PointerInputChange to give it all of PointerInputData's fields. Made PointerInputEvent and PointerInputEventData internal because they aren't used in any public API. ( Ifff97 , b/175142755 )

  • Renamed TextInputService.onStateUpdated as updateState ( Id4853 )

  • Remove displaySize as it should be avoided. Typically it is better to use size of onRoot() or window size at least. ( I62db4 )

Version 1.0.0-alpha10

13 января 2021 г.

androidx.compose.foundation:foundation:1.0.0-alpha10 and androidx.compose.foundation:foundation-layout:1.0.0-alpha10 are released. Version 1.0.0-alpha10 contains these commits.

Изменения API

  • ImeOptions and KeyboardOptions are no more a data class ( I3c898 , b/168684531 )
  • VisualTransformation API Changes
    • Renamed OffsetMap to OffsetMapping
    • Renamed OffsetMapping.identityOffsetMap to OffsetMapping.Identity
    • PasswordTransformation is no longer data-class
    • Moved OffsetMapping to its own file
    • ( I0bdf3 )
  • EditOperations API Changes
    • Renamed EditOperation as EditCommand
    • Added Command suffix for EditOperation concrete implementations
    • EditCommand's are no longer data classes
    • Renamed EditOperation.process function to applyTo
    • Renamed InputEventListener to InputEventCallback
    • ( I0a366 )
  • Modified Velocity to have component parts and mathematical operations. ( Ib0447 )
  • Renamed @ExperimentalTesting to @ExperimentalTestApi to be consistent with similar experimental api annotations ( Ia4502 , b/171464963 )
  • Added experimental stickyHeader method for LazyColumn/LazyRow ( I0a81d )
  • Ranamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
  • Deprecated TestUiDispatcher. Use Dispatchers.Main instead ( Ic171f , b/175385255 )
  • Add Toggle to foundation Strings.kt ( I4a5b7 , b/172366489 )
  • Moved nativeClass to ui module and made it internal. Updated usages of nativeClass in equals implementations to use 'is MyClass' instead. ( I4f734 )
  • FlowRow and FlowColumn were deprecated. Please use a custom layout instead. ( I09027 )
  • Modifier.focus() and Modifier.focusRequester() are deprecated. Use Modifier.focusModifier() and Modifier.focusReference() instead. ( I75a48 , b/175160751 , b/175160532 , b/175077829 )
  • Introduced SelectionRegistrar.notifySelectableChange to notify Selectable updates to SelectionManager. ( I6ff30 , b/173215242 )
  • Changed fun Dp.isFinite() to a val Dp.isFinite ( I50e00 )
  • Constraints#satisfiedBy was renamed to isSatisfiedBy. ( I9cf5c )
  • Added isSpecified, isUnspecified, and useOrElse for inline classes with an Unspecified constant. ( I93f7b , b/174310811 )

Исправления ошибок

  • New coroutine-based API Animatable that ensures mutual exclusiveness among its animations. New DecayAnimationSpec to support multi-dimensional decay animation ( I820f2 , b/168014930 )
  • Added support for disabled and read-only text fields ( I35279 , b/171040474 , b/166478534 )
  • animate() is now replaced with animateAsState() , which returns a State<T> instead of T . This allows better performance, as the invalidation scope can be narrowed down to where the State value is read. ( Ib179e )
  • Add Semantics role API and add Role as a parameter to clickable, selectable and toggleable SemanticsModifier. Changed Modifier.progressSemantics so that Slider can also use it. ( I216cd )
  • The native keyEvent can now be accessed through keyEvent.nativeKeyEvent ( I87c57 , b/173086397 )

Version 1.0.0-alpha09

16 декабря 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha09 and androidx.compose.foundation:foundation-layout:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.

Изменения API

  • Add Scrollable interface

    This allows ScrollState and LazyListState to be treated as a common type, allowing custom scrolling to be implemented across both types.

    This also moves smoothScrollBy to an extension function on Scrollable, taking advantage of this functionality. ( I2153b )

  • LazyVerticalGrid is added. ( I17267 , b/162213211 )

  • Deprecate LazyColumnFor, LazyRowFor, LazyColumnForIndexed and LazyRowForIndexed. Use LazyColumn and LazyRow instead ( I5b48c )

  • For suspending pointer input APIs, renamed HandlePointerInputScope to AwaitPointerEventScope and handlePointerInput() to awaitPointerEventScope(). ( Idf0a1 , b/175142755 )

  • LazyListState.layoutInfo was added which exposes the list of sizes and offsets of the currently visible items ( If8678 , b/170472532 )

  • Removed ExperimentalPointerInput annotation ( Ia7a24 )

  • InteractionState support for TextFields has been added. ( I61d91 )

  • Add reverseLayout param for LazyColumn/Row. when true items will be composed from the bottom to the top and LazyListState.firstVisibleItemIndex == 0 will mean the first item is located at the bottom. ( I552ae , b/166589935 )

  • verticalArrangement param was added for LazyColumn. horizontalArrangement param was added for LazyRow. Arrangement allows us to add a spacing between items and specify the arrangement of the items when we do not have enough of them to fill the whole minimum size. ( Icf79a , b/170394300 )

  • detectMultitouchGestures now uses one callback with combined centroid, pan, zoom and rotate parameters. ( Ie6e1c )

  • Moved ContentDrawScope to ui-graphics module to be with DrawScope. ( Iee043 , b/173832789 )

Исправления ошибок

  • Lambdas in offset modifiers now return IntOffset rather than Float. ( Ic9ee5 , b/174137212 , b/174146755 )
  • Removed SlotTable, SlotReader and SlotWriter from the public API. These were marked as InternalComposeAPI previously. Now they are internal to the compose module.

    CompositionData and CompositionGroup were added as a replacement for the ui-tooling API to use to extract composition information. These are public but are not intended for use outside the ui-tooling API as they provide the raw information the ui-tooling API interprets ( I31a9c )

  • Refactored ShaderBrush to lazily create a shader instance when sizing information of the drawing environment is available. This is useful to define gradients that occupy the full drawing bounds of a composable at composition time, without having to implement custom DrawModifier implementations.

    Deprecated gradient function constructor APIs in favor of factory methods on a Gradient object. ( I511fc , b/173066799 )

  • Modifier.focusObserver is deprecated. Use Modifier.onFocusChanged or Modifier.onFocusEvent instead ( I30f17 , b/168511863 , b/168511484 )

  • Autofill API is now experimental API and requires opt-in ( I0a1ec )

  • Adding destructuring declarations to create FocusRequester instances ( I35d84 , b/174817008 )

  • accessibilityLabel has been renamed to contentDescription. accessibilityValue has been renamed to stateDescription. ( I250f2 )

  • Introduced several new functions in SelectionRegistrar and also renamed onPositionChange to notifyPositionChange. ( Ifbaf7 )

  • AndroidOwner made internal ( Ibcad0 , b/170296980 )

  • New infiniteRepeatable function for creating an InfiniteRepeatableSpec ( I668e5 )

  • The Applier interface has changed to simplify building trees bottom-up instead of top-down.

    The insert() method has been renamed to insertTopDown() .

    A new method, insertBottomUp() , was added.

    An applier either inserts nodes into the tree it is editing using insertTopDown() or insertBottomUp() depending on which performs better.

    Some trees, such as LayoutNode and View , 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 an Applier overrides insertBottomUp() to build a tree bottom-up and insertTopDown() to build the tree top-down. ( Icbdc2 )

  • Added painterResource API to handle opaquely loading Painter objects from either rasterized asset formats (like PNGs) or VectorDrawables. Consumers no longer have to determine the type of asset in advance and can call this method to get a Painter object to use in Image composables or painter modifiers. ( I2c703 , b/173818471 )

  • Added buildAnnotatedString factory function in order to build an AnnotatedString. Deprecated annotatedString builder function. ( Idfe0b )

Version 1.0.0-alpha08

2 декабря 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha08 and androidx.compose.foundation:foundation-layout:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.

Изменения API

  • Removed maxLines parameter from the CoreTextField . If you'd like to constraint the height of the text field by the number of lines, use BasicTextField instead. ( Iec002 )
  • Changed the await*TouchSlop() methods to not detect the pointer down and renamed them to *OrCancellation . Also removed the need for orientationLock parameter. ( Ie96e1 )
  • Added lint check for composable lambda parameter naming and position, to check for consistency with Compose guidelines. Also migrated some APIs using children as the name for their trailing lambda to content , according to the lint check and guidance. ( Iec48e )
  • foundation:foundation-text apis moved to foundation:foundation . The package structure remained the same ( Id3eb2 )
  • New multitouch gesture detector, including helpers for detecting rotation, zoom, and panning. ( Ic459d )
  • New drag gesture detector suspending pointer input API, including orientation locking. ( Icef25 )
  • Renamed VectorAsset to ImageVector Moved and renamed VectorAsset to Builder to be an inner class of ImageVector as per API council guidelines. Added typealias of VectorAssetBuilder to link to ImageVector.Builder for compat. ( Icfdc8 )
  • Renamed ImageAsset and related methods to ImageBitmap. ( Ia2d99 )
  • Moved foundation semantics properties to ui ( I6f05c )
  • Add coroutine-based scrolling APIs:

    Adds LazyListState.snapToItem and LazyListState.smoothScrollBy, as well as lower-level APIs for scroll control. These APIs provide a suspend interface to control scrolling that waits until the scroll is finished before returning. ( Ie5642 )

  • Added a singeLine parameter into BasicTextField, TextField and OutlinedTextField. Set this parameter to true to make the text field a single horizontally scrollable line. ( I57004 , b/168187755 )

  • Gesture detector for tap, double-tap, long press, and press indication were added using the new suspending pointer input. A few utilities were added as well, making it easier for developers to write their own gesture detectors. ( I00807 )

  • Modifier.focusable has need added in foundation. Use this to add focusable behavior to a component, with correct semantics and accessibility. ( I41eb9 , b/152525426 , b/162865824 )

  • Previously deprecated APIs have been removed: Border was removed, use BorderStroke instead. Modifier.drawBorder was removed, use Modifier.border instead. Modifier.gravity was removed, use Modifier.align instead. Stack was removed, use Box instead ( I32c2b , b/172470874 )

  • AbsoluteArrangement was renamed to Arrangement.Absolute. ( If26f2 )

Исправления ошибок

  • Moved DrawModifier APIs from the androidx.compose.ui package to the androidx.compose.ui.draw package. Created DrawModifierDeprecated.kt file to include typealiases/helper methods to assist with the migration from the deprecated to the current APIs. ( Id6044 , b/173834241 )
  • Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API council feedback. ( I0bd29 , b/173834241 )
  • <T> was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 )
  • Made PointerInputData's uptime and position fields non-nullable. ( Id468a )
  • MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection. ( I1e6f4 , b/139320372 , b/139320907 )
  • The alignment parameter of Box was renamed to contentAlignment. ( I2c957 )
  • offsetPx modifiers were renamed to offset. They are now taking lambda parameters instead of State. ( Ic3021 , b/173594846 )
  • Added WindowManager.isWindowFocused to check if the host window is in focus, and a WindowFocusObserver that provides an onWindowFocusChanged callback. ( I53b2a , b/170932874 )
  • Added resetInput parameter to TextInputService#onStateUpdated ( I3e8f5 , b/172239032 , b/171860947 )
  • Updated TextFieldValue API
    • made TextFieldValue.composition readonly
    • removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
  • Deprecated Ambients named with Ambient as their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 )
  • Added Android Typeface wrapper. You can load an Android Typeface via typeface function ie typeface(Typeface.DEFAULT) . Also renamed typefaceFromFontFamily() to typeface() ( I52ab7 )
  • Added lint check to check that Modifier factories use androidx.compose.ui.composed {} internally, instead of being marked as @Composable . ( I3c4bc )
  • Added lint check to check that Modifier factory functions are defined as extensions on Modifier, so they can be fluently chained together. ( I07981 )
  • Semantics argument mergeAllDescendants was renamed to mergeDescendants. ( Ib6250 )
  • Time control in tests (TestAnimationClock and its usages) is now experimental ( I6ef86 , b/171378521 )
  • Remove old ui-test module and its stubs ( I3a7cb )
  • TextUnit.Inherit is renamed to TextUnit.Unspecified in consistent with other units. ( Ifce19 )
  • The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
  • foundation:foundation-text module has been merged into foundation:foundation ( Idac0f )
  • Deprecate place(Offset) and placeRelative(Offset). Use overloads with int offsets instead ( I4c5e7 )
  • id was renamed to layoutId for LayoutIdParentData . Measurable.id was renamed to Measurable.layoutId . ( Iadbcb , b/172449643 )

Version 1.0.0-alpha07

11 ноября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha07 , androidx.compose.foundation:foundation-layout:1.0.0-alpha07 , and androidx.compose.foundation:foundation-text:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.

Изменения API

  • Similarly to Modifier.fillMaxSize[Width|Height] we now support fractions in Modifier.fillParentMaxSize[Width|Height] inside the scope of LazyColumn/Row ( I797e2 , b/166586426 )
  • Removed KeyboardOptions.toImeOptions from public API. ( Ic2e45 )
  • The foundation AmbientTextStyle, ProvideTextStyle, and AmbientContentColor have been deprecated. Instead use the new versions available in the Material library. For non-Material applications, you should instead create your own design system specific theming ambients that can be consumed in your own components. ( I74acc , b/172067770 )
  • foundation.Text has been deprecated and replaced with material.Text. For a basic, unopinionated text API that does not consume values from a theme, see androidx.compose.foundation.BasicText. ( If64cb )
  • Added maxLines to TextFields ( Ib2a5b )
  • Update TextFields to accept KeyboardOptions ( Ida7f3 )
  • Added KeyboardOptions for use in TextFields ( I9ca32 )
  • Adds BasicText as a design-unopinionated API for text, parallel to BasicTextField. ( I28268 )
  • ExperimentalLazyDsl annotation was removed. LazyColumn/LazyRow can now be used without adding @OptIn ( Idab7a , b/166584730 )
  • BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
  • BasicTextField has been added as a replacement for both CoreTextField and BaseTextField ( Id4cea )
  • Remove deprecated LazyColumnItems/LazyRowItems ( I1d8a8 )
  • The deprecated composables for sizing to intrinsic measurements were removed. ( I18537 , b/171811496 )
  • relativePaddingFrom was renamed to paddingFrom. The paddingFromBaseline modifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 )
  • The matchHeightConstraintsFirst parameter was added to the aspectRatio modifier, which can be used to specify the modifier to size to height constraints before trying the width correspondents. ( Ie7c43 , b/155290593 )
  • The deprecated DpConstraints was removed. ( I87884 , b/171702471 )

Исправления ошибок

  • Introduced ScaleFactor inline class to represent scale factors for the horizontal and vertical axes independent of one another in order to support non-uniform scaling use cases.
    • Added computeScaleFactor method to ContentScale
    • Added ContentScale.FillBounds to perform non-uniform scaling to stretch the src bounds to fully occupy the destination.
    • Added operator methods to compute ScaleFactor parameters with Size parameters.
    • ( Ic96a6 , b/172291582 )
  • captureToBitmap moved to captureToImage. ( I86385 )
  • Marks CoreText as @InternalTextApi. Use BasicText instead. ( I6aaeb )
  • Rename KeyboardOptions as ImeOptions ( I82f36 )
  • Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
  • CoreTextField has been marked as @InternalTextApi. Use BasicTextField instead ( Ie2469 )
  • ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
  • Introduce ui-test-junit4 module ( Ib91f8 )
  • Updated Icon API to take in Color.Unspecified as a possible tint color which will draw the provided asset or painter without a ColorFilter. Previously attempts to ignore tinting with Color.Unspecified would tint with a transparent color ending up with nothing rendered at all. ( I049e2 , b/171624632 )
  • MeasureResult was moved out of MeasureScope. ( Ibf96d , b/171184002 )
  • Several layout related symbols were moved from androidx.compose.ui to androidx.compose.layout.ui. ( I0fa98 , b/170475424 )
  • androidx.ui.test moved to androidx.compose.ui.test ( I9ffdb )
  • FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
  • Added SelectionContainer without the callback ( Ibfadb )
  • Add Tests for SelectionHandles' Positions in SelectionContainer. ( Ie93db )
  • Added Keyboard auto correct IME Option ( I57b8d )

Version 1.0.0-alpha06

28 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha06 , androidx.compose.foundation:foundation-layout:1.0.0-alpha06 , and androidx.compose.foundation:foundation-text:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.

Изменения API

  • androidx.compose.foundation.Icon has been moved to androidx.compose.material.Icon. You can also use the Image component / Modifier.paint() with a Painter if you do not want to use the Material library. ( I9f622 )
  • Added interactionState to Modifier.scrollable, ScrollableColumn and LazyColumnFor ( I81566 , b/169509805 )
  • alignByBaseline was added to RowScope and alignWithSiblings was renamed to alignBy ( I06503 , b/170628732 )
  • Box was made an inline function. ( Ibce0c , b/155056091 )
  • Added maxLines to CoreTextField ( Ibee58 , b/143687793 )
  • Added softwrap to CoreTextField. ( I21a4b )

Исправления ошибок

  • Deprecate VectorPainter in favor of rememberVectorPainter to better indicate that the composable API internally leverages 'remember' to persist data across compositions. ( Ifda43 )
  • Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. ( If0de3 )
  • Added single line keyboard option to CoreTextField ( I72e6d )
  • Renamed Radius API to CornerRadius to better express how it is used throughout Compose. Updated documentation to indicate that negative corner radii are clamped to zero. ( I130c7 , b/168762961 )
  • Add ability to specify inspector info in composed modifier ( Idee08 , b/163494569 )
  • Added KeyboardCapitalization IME Option ( I8ac38 )
  • Fix Rtl Handle Position. ( I6e1e0 )
  • Breaking change: removed the return value from PointerInputFilter.onPointerEvent(...) given that the only value that should be able to be changed in pointer events is consumption data. Instead of returning data from PointerInputFilter.onPointerEvent(...), now you can just mutate the consumption data of the PointerEvents passed in. ( I6acd0 )
  • Added SelectAll option into selection menu ( Ief02b )

Version 1.0.0-alpha05

14 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha05 , androidx.compose.foundation:foundation-layout:1.0.0-alpha05 , and androidx.compose.foundation:foundation-text:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.

Изменения API

  • CoreTextField now supports cursor functionality ( Id23aa )
  • Deprecates contentColor() and currentTextStyle() APIs, and replaces them with AmbientContentColor and AmbientTextStyle ambients respectively. You can access the current value by using .current on the ambient property, as with any other ambient. This was change was made for consistency and to avoid having multiple ways to accomplish the same thing. Additionally renames some ambient properties to better describe their purpose as follows:

    • ContentColorAmbient -> AmbientContentColor
    • TextStyleAmbient -> AmbientTextStyle
    • IndicationAmbient -> AmbientIndication
    • EmphasisAmbient -> AmbientEmphasisLevels
    • RippleThemeAmbient -> AmbientRippleTheme ( I37b6d )

Исправления ошибок

  • As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes ( I97611 , b/169797763 )
  • Added Copy/Paste/Cut accessibility actions ( I6db4f )
  • TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. ( I175c9 , b/158830170 )
  • Updated Size.Unspecified parameters to be Float.NaN instead of Float.POSITIVE_INFINITY. Updated Painter implementations to check against Size.Unspecified as well as non-finite Sizes. ( I95a7e )
  • Added Paging Compose module and paging integration ( Ib85da )
  • Modify LazyListScope to receive nullable values ( I1765b )
  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )
  • Added samples for LazyColumn/Row ( Idc16d )
  • Fix for the items and itemsIndexed methods to allow emptyList ( I06647 )
  • Add a DSL for specifying inspector information ( Ic9a22 )
  • Move LongPress into Text. ( Iff2bc )
  • Disable Selection in Text, and a Demo. ( Ie7e97 )
  • Support AnnotatedString to SpannableString conversion for accessibility. ( Ief907 )
  • Removed PointerInputFilter.onPointerInput(...) . PointerInputFilter.onPointerEvent(...) should be used in its place. ( I6f04a )

Version 1.0.0-alpha04

1 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha04 , androidx.compose.foundation:foundation-layout:1.0.0-alpha04 , and androidx.compose.foundation:foundation-text:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

Изменения API

  • Stack was renamed to Box. The previously existing foundation.Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. ( I94893 , b/167680279 )
  • Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) ( Ibae92 , b/167680279 )
  • Add a new LazyListState class. This allows for observation and control of the scroll position of LazyRow and LazyColumn components. Instances can be created using rememberLazyListState() and passed into the state parameter of the component. Currently, the first visible item and offsets can be observed in this initial version. ( Ic7cb7 , b/159307669 )
  • Lazy list position and scroll offset are now saved and restored across Activity recreation ( Ie045f , b/166589058 )
  • Add long click semantics action ( I6281b , b/156468846 )
  • MutatorMutex utility added for keeping a single mutator of shared state over time and cancelling conflicting mutators by priority ( I3f975 )
  • Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc ( I554eb , b/168308412 )
  • Removed inlineContent parameter from Text with String input. It won't be used because inlineContent must work with AnnotatedString. ( Ief403 )
  • The deprecated custom Arrangement APIs were removed. ( Ic576d , b/168297922 , b/168297923 )
  • The unbounded parameter was added to wrapContentSize modifiers, which enables measuring the layout element with infinite max constraints. ( I77951 , b/158559319 )
  • We prevented static imports of contents of layout scopes (eg alignWithSiblings in RowScope). The explicit scope alternative should be used instead: with(RowScope) { Modifier.alignWithSiblings(FirstBaseline) } . ( I216be , b/166760797 )

Исправления ошибок

  • Updated many Graphics APIs
    • Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
    • Removed Rect.expandToInclude and Rect.join methods
    • Updated Radius documentation to say oval in addition to elliptical
    • Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
    • Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
    • Deprecated Rect.shift in favor of Rect.translate
    • Removed RoundRect.grow and Rect.shrink APIs
    • Renamed RoundRect.outerRect to Rect.boundingRect
    • Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
    • Renamed RoundRect.longestSide to RoundRect.maxDimension
    • Renamed RoundRect.shortestSide to RoundRect.minDimension
    • Changed RoundRect.center to be a property instead of a function
    • Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
    • Removed Size APIs that assumed it was a Rectangle with origin at 0,0
    • Added a destructing API to Radius
    • Migrated various RoundRect extension functions to be properties instead
    • ( I8f5c7 , b/168762961 )
  • Performance optimizations for LazyColumnFor/LazyRowFor scrolling by not doing unnecessary recompositions during every scroll ( I64f65 , b/168293643 , b/167972292 , b/165028371 )
  • Fixed crash in LazyColumnFor/LazyRowFor after scrolling and then changing items and implemented auto scrolling up when the previously visible item was removed so we don't display empty gaps in the end anymore ( I220ab , b/161480164 , b/167855468 )
  • Nesting scrollable in the same direction containers like ScrollableContainer and LazyColumnFor is not allowed anymore. It was never supported and was breaking the fling and all the laziness of composing the items of LazyColumnFor ( I6e101 )
  • Updated many Graphics APIs
    • Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
    • Updated clipPath documentation to refer to Path instead of rounded rectangle
    • Fixed spacing in documentation for right parameter in clipPath
    • Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
    • Renamed dx/dy parameters in inset method to horizontal and vertical
    • Added inset overload that provides the same inset value to all 4 bounds
    • Removed documentation on inset method indicating that inset would be applied to all 4 sides
    • Updated documentation for Rect class
    • Updated comments on Rect parameters to match kdoc style
    • Removed Rect.join and Rect.expandToInclude
    • Created overload for Rect.translate(offset) and deprecated Rect.shift
    • ( If086a , b/167737376 )
  • add AccessibilityScrollState to semantics properties. ( Ifeda9 )
  • Make TextRange inline to avoid object creation. ( Id034b )
  • ParagraphConstraints is removed. Width is directly passed to Paragraph now. ( Ica712 )

Version 1.0.0-alpha03

16 сентября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha03 , androidx.compose.foundation:foundation-layout:1.0.0-alpha03 , and androidx.compose.foundation:foundation-text:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.

Изменения API

  • InnerPadding was renamed to PaddingValues. ( I195f1 , b/167389171 )
  • Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
  • An alignment parameter was added to Stack, which allows specifying the default alignment for all the Stack children. ( Ie80ca , b/164085265 )

Исправления ошибок

  • DpConstraints and APIs using it were deprecated. ( I90cdb , b/167389835 )
  • The parameters minWidth and maxWidth of widthIn were renamed to min and max . Similarly for preferredWidthIn , heightIn , preferredHeightIn . ( I0e5e1 , b/167389544 )
  • Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
  • Fixed size and position calculations in GestureScope, which caused amongst others generation of invalid swipe gestures ( Iaf358 , b/166589947 )
  • Moved createAndroidComposeRule and AndroidInputDispatcher from androidx.ui.test.android to androidx.ui.test ( Idef08 , b/164060572 )

Version 1.0.0-alpha02

2 сентября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha02 , androidx.compose.foundation:foundation-layout:1.0.0-alpha02 , and androidx.compose.foundation:foundation-text:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

Исправления ошибок

  • TestUiDispatcher is marked experimental ( Iae99d , b/161247083 )
  • Added ManualFrameClock.hasAwaiters to see if anything is awaiting a frame from that clock; runWithManualClock as a replacement for runBlocking when running tests that need a ManualFrameClock; TestUiDispatcher.Main that gives easy access to the main UI dispatcher in your tests.

    Например:

    @Test
    fun myTest() = runWithManualClock { clock ->
        // set some compose content
        withContext(TestUiDispatcher.Main) {
            clock.advanceClock(1000L)
        }
        if (clock.hasAwaiters) {
            println("The clock has awaiters")
        } else {
            println("The clock has no more awaiters")
        }
    }
    

    ( I0a85b , b/161247083 )

Version 1.0.0-alpha01

August 26, 2020

androidx.compose.foundation:foundation:1.0.0-alpha01 , androidx.compose.foundation:foundation-layout:1.0.0-alpha01 , and androidx.compose.foundation:foundation-text:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

Version 0.1.0-dev

Version 0.1.0-dev17

19 августа 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev17 , androidx.compose.foundation:foundation-layout:0.1.0-dev17 , and androidx.compose.foundation:foundation-text:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.

Изменения API

  • The spacedBy Arrangement was added for Row and Column, to enable positioning layout children with a fixed spacing. The aligned Arrangment was also added, to enable positioning layout children one next to the other and aligned in the Row/Column according to an Alignment. The previous Arrangement.Vertical#arrange and Arrangement.Horizontal#arrange methods were deprecated, and writing custom Arrangements will not be supported in the future. ( I6733d , b/161985975 )
  • Offset has become an inline class ( Iaec70 )
  • Removed onFocusChanged callbacks from TextField. Use Modifier.focusObserver instead. ( I51089 , b/161297615 )
  • Modifier.drawBorder has been deprecated. Use Modifier.border instead. Border data class has been replaced by BorderStroke ( I4257d , b/158160576 )
  • VerticalScroller and HorizontalScroller have been removed. Use ScrollableColumn/Row instead. Modifier.drawBackground has been removed. Use Modifier.background ( I73b0d , b/163019183 )
  • Remove marked as deprecated fillMax* modifiers from LazyItemScope as they are making it harder to add such modifiers correctly for items which are not direct children of LazyColumnFor ( Ifa78d )
  • added LazyColumn/LazyRow implementation as DSL ( I93cc6 )
  • Constraints is now an inline class ( I88736 )
  • Added the ability to size a layout to a fraction of the available space, using the fillMaxWidth, fillMaxHeight and fillMaxSize modifiers. ( I945bb , b/161562591 )

Исправления ошибок

  • Added a modifier param to SelectionContainer ( I4aada , b/161487952 )
  • Added mergePolicy lambda to SemanticsPropertyKey. This can be used to define a custom policy for mergeAllDescendants semantics merging. The default policy is to use the parent value if already present, otherwise the child value. ( Iaf6c4 , b/161979921 )
  • PlacementScope.placeAbsolute() was renamed to PlacementScope.place() , and the previous PlacementScope.place() was renamed to PlacementScope.placeRelative() . As a result, the PlacementScope.place() method will not automatically mirror the position in right-to-left contexts anymore. If this is desired, use PlacementScope.placeRelative() instead. ( I873ac , b/162916675 )
  • Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. ( I5e889 )
  • Added backgroundColor parameter to LinearProgressIndicator and removed internal padding from CircularProgressIndicator. Added new ProgressIndicatorConstants.DefaultProgressAnimationSpec which can be used as the default AnimationSpec when animating progress between values ( If38b5 , b/161809914 , b/161804677 )
  • The state { ... } composable is now deprecated in favor of explicit calls to remember { mutableStateOf(...) } for clarity. This reduces the overall API surface and number of concepts for state management, and matches the by mutableStateOf() pattern for class property delegation. ( Ia5727 )
  • Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors ( I5d325 )
  • Removed onChildPositioned and OnChildPositionedModifier. Developers should use onPositioned and OnPositionedModifier on the child layout instead. ( I4522e , b/162109766 )
  • IntSize is now an inline class ( I2bf42 )
  • LongPress the Blank Area to Edit. ( Ib1e5b )
  • Hide FloatingToolbar After Tapping on the Text. ( If4525 )
  • Hide FloatingToolbar When Updating the Selection. ( I8444c )
  • Deselect When Blur. ( I781a2 )

Version 0.1.0-dev16

5 августа 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev16 , androidx.compose.foundation:foundation-layout:0.1.0-dev16 , and androidx.compose.foundation:foundation-text:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.

Изменения API

  • LazyItemScope was added for itemContent param of Lazy lists. It provides modifiers to fill the parent max size which solves the use case when the item should fill the viewport and the regular Modifier.fillMaxSize() doesn't work as the item is measured with infinity constraints. ( Ibd3b2 , b/162248854 )
  • Move dialog to ui ( I47fa6 )
  • Added LazyColumnForIndexed/LazyRowForIndexed - versions of LazyColumnFor/LazyRowFor which provides both index and item in the itemCallback. It is useful when in addition to a current item you need to know a current index. ( I65ff3 )
  • Modifier.deternimateProgress has been renamed to Modifier.progressSemantics ( I9c0b4 )
  • LazyColumnItems was renamed to LazyColumnFor. LazyRowItems was renamed to LazyRowFor ( I84f84 )
  • Add some Marks/Annotations for best practice reason. ( I66b20 )
  • foundation.shape.corner package were flatten to foundation.share ( I46491 , b/161887429 )
  • Added сrossaxis gravity param for LazyRowItems/LazyColumnItems. LazyRowItems/LazyColumnItems now support wrap content behaviour. ( Ib39fc )
  • ZoomableState has been renamed to ZoomableController. Custom curve support has been added for smoothScale. enabled and onZoomStarted functionality has been added ( If8b8f )
  • Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use ( Ia6242 , b/155482676 )
  • Previously deprecated AdapterList has been removed. Use LazyColumnItems instead ( I12b9b )
  • Modifier.drawBackground has been renamed to Modifier.background ( I13677 )
  • The old ConstraintLayout DSL was removed. ConstraintSet2 has been renamed to ConstraintSet. ( If58d1 , b/162450908 )
  • Added Modifier.absoluteOffset() and Modifier.absoluteOffsetPx(). Unlike offset modifiers, absolute offset modifiers will not auto-mirror in right-to-left context ( I3aa21 )
  • Row and Column are now inline function significantly reducing the overhead of using them. ( I75c10 )

Исправления ошибок

  • Address broad API fixes ( I077bc )
    1. Remove unused OffsetBase interface
    2. Align Offset and IntOffset classes to have a consistent API surface
    3. Rename IntOffset.Origin to IntOffset.Zero to be consistent with Offset API
    4. Moved nativeCanvas method off of Canvas interface to support consumers to create their own Canvas instances
    5. Created stub EmptyCanvas class to refactor DrawScope to be a non-null parameter instead of lateinit and ensure non-nullability of the field
    6. Renamed ClipOp enums to be Pascal Case
    7. Renamed FilterQuality enums to be Pascal Case
    8. Renamed StrokeJoin enums to be Pascal Case
    9. Renamed PointMode enums to be Pascal Case
    10. Renamed PaintingStyle enums to be Pascal Case
    11. Renamed PathFillType enums to be Pascal Case
    12. Renamed StrokeCap enums to be Pascal Case
    13. Updated DrawCache implementation to no longer use lateinit params
    14. Updated DrawScope to no longer use lazy delegation for fillPaint and strokePaint internal parameters
    15. Updated Image composable to avoid Box usage for less overhead
    16. Updated Outline class to have @Immutable annotations
    17. Updated PathNode to have @Immutable annotations for each path instruction
    18. Updated Vector subcomposition to remove redundant conditional checks for equality as compose already handles them
    19. Deprecated Rect companion constructor methods in favor of function constructors
    20. Updated Brush classes and function constructors with @Immutable and @Stable APIs
    21. Updated VertexMode enum to be PascalCase
    22. Updated DrawScope selectPaint method to conditionally overwrite stroke parameters on the paint if they have changed
    23. Updated Size to add destructuring API, rename UnspecifiedSize to Unspecified and removed unused methods
  • Added MonotonicFrameAnimationClock that enables you to use a MonotonicFrameClock as an AnimationClockObservable to bridge the gap between the new coroutines based clocks and APIs that still use the old callback based clocks.

    The MonotonicFrameClock equivalent of ManualAnimationClock is now ManualFrameClock. ( I111c7 , b/161247083 )

  • Removed SemanticsNodeInteraction.performPartialGesture . Use SemanticsNodeInteraction.performGesture instead. ( Id9b62 )

  • Renamed SemanticsNodeInteraction.getBoundsInRoot() to SemanticsNodeInteraction.getUnclippedBoundsInRoot() ( Icafdf , b/161336532 )

  • The APIs for right-to-left support has been updated. LayoutDirectionAmbient has been added, which can be used to read and change the layout direction. Modifier.rtl and Modifier.ltr have been removed. ( I080b3 )

  • Modifier.plus has been deprecated, use Modifier.then instead. 'Then' has a stronger signal of ordering, while also prohibits to type Modifier.padding().background() + anotherModifier , which breaks the chain and harder to read ( Iedd58 , b/161529964 )

  • Added isFocused() and isNotFocused() SemanticsMatcher. ( I0b760 )

  • RemeasurementModifier was added. It allows users to synchronously remeasure the layout. In general, you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll. ( I5f331 , b/160791058 )

  • isSystemInDarkTheme now always considers the system-wide dark theme setting, and ignores power saving status before Q, following latest guidance. ( I0c10c )

  • OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )

  • Renamed AndroidComposeTestRule to createAndroidComposeRule. ( I70aaf )

  • Add accessibility action to get TextLayoutResult ( I9d6e6 )

Version 0.1.0-dev15

22 июля 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev15 , androidx.compose.foundation:foundation-layout:0.1.0-dev15 , and androidx.compose.foundation:foundation-text:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.

To use the 0.1.0-dev15 version of Compose, you will need to:

Dependencies Update

  • To use the 0.1.0-dev15 version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies .

Изменения API

  • Similarly to the new param in ScrollableColumn/ScrollableRow LazyColumnItems/LazyRowItems now also have contentPadding param which allows to add a padding for the content after it has been clipped, which is not possible via just a modifier param. It also allows to add a spacing only before first item/after last item. ( Ibc24e )
  • onFocusChange callback in text fields renamed to onFocusChanged ( Ida4a1 )
  • VerticalScroller and HoriziontalScroller have been deprecated. Use ScrollableColumn and ScrollableRow for build-in experience with Column/Row behaviour and parameters, or Modifier.verticalScroll and Modifier.horizontalScroll on your own element. Similarly, ScrollerPosition has been deprecated in favor of ScrollState' ( I400ce , b/157225838 , b/149460415 , b/154105299 )
  • Modifier.draggable and Modifier.scrollable APIs were reworked. DragDirection was removed in favor of Orientation. State required for scrollable has beed simplified. ScrollableState has been renamed to ScrollableController ( Iab63c , b/149460415 )
  • Single-value semantics properties now use a calling style. For example, 'semantics { hidden = true }' is now written as: semantics { hidden() } . ( Ic1afd , b/145951226 , b/145955412 )
  • Corner sizes used by RoundedCornerShape and CutCornerShape can now be larger than 50% ( Id2340 , b/160400213 )
  • Changed the default ContentScale parameter for the Image composable from Inside to Fit. This was done in order to get behavior to scale up the underlying Painter if the layout size is larger than the intrinsic size of the painter while maintaining the aspect ratio. This behavior better matches expectations for providing fixed sizes to the Image while not affecting the default behavior if only the intrinsic size is used to compute the size of the composable. ( I40ae3 , b/159838006 )
  • Use AnimationSpec instead of AnimationBuilder in the top level APIs to clarify the concept of static animation specification -Improve the transition DSL by removing the lambda requirement for creating AnimationSpecs such as tween, spring. They instead take constructor params directly. -Improve the overall ease of use of AnimationSpec opening up constructors instead of relying on builders -Change the duration and delay for KeyFrames and Tween to Int. This eliminates unnecessary type casts and method overloading (for supporting both Long and Int). ( Ica0b4 )
  • Clickable was removed. Use Modifier.clickable ( I84bdf )
  • Added LazyRowItems - Horizontally scrolling analogue of LazyColumnItems ( Ibbcf7 )
  • Introduced low level stateless animation APIs. These APIs ( I63bf7 )
  • androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead ( I4066d , b/155211005 )
  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )
  • androidx.ui.foundation.shape.RectangleShape removed; use androidx.ui.graphics.RectangleShape ( I94939 , b/154507984 )
  • In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. ( Ic0191 )
  • In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. ( I3ad98 )
  • Added Modifier.zoomable for pinch-to-zoom functionality ( Id5d63 )
  • Toggleable component has been deprecated. Use Modifier.toggleable instead ( I35220 , b/157642842 )
  • MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. ( I02b47 , b/157642842 )
  • TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )
  • Adds fontWeight parameter to Text, which was accidentally not added previously ( I56937 )
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I19d02 )
  • VerticalScroller now provides Column out of the box. HorizontalScroller now provides Row out of the box. ( Ieca5d , b/157020670 )
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Iede0b )
  • Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements ( I8425f , b/155287131 )
  • VerticalScroller and HorizontalScroller now support reversed scrolling is isReversed is set on ScrollerPosition ( I953bd )
  • Support adding composables into text layout. ( I1373c )
  • Consolidated CanvasScope implementations so there is now just DrawScope and ContentDrawScope Renamed CanvasScope to DrawScope. Updated DrawScope to implement Density interface and provide LayoutDirection Deleted DrawScope subclass in ContentDrawScope Painter and PainterModifier have been updated to no longer maintain an RTL property themselves as DrawScope provides this already without manually providing it ( I1798e )
  • Removed deprecated DrawBackground API in favor of drawBackground extension APIs on Modifier. Refactored color, brush and paint drawBackground implementations to reduce code paths as well as remove requirement for Modifier to be created as part of composition. ( I0343a )
  • Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )
  • HorizontalScroller and VerticalScroller not restores their scroll position using saved instance state. ( Ia0fae , b/155075048 )
  • FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. ( Ic4826 )
  • Table layout was removed temporarily until we will make it available again with a refreshed API. ( Id88a7 )
  • Created CanvasScope API that wraps a Canvas object to expose a stateless, declarative drawing API surface. Transformations are contained within their own receiver scope and sizing information is also scoped to corresponding inset bounds. It does not require a consumer to maintain its own Paint state object for configuring drawing operations.

    Added CanvasScopeSample as well as updated the demo app to include a declarative graphics demo ( Ifd86d )

  • ColoredRect has been removed. User Box with drawBackground modifier instead ( I983c7 , b/152753731 )

  • Add cursor color customisation to the TextField ( I6e33f )

  • Now it is possible to hide/show software keyboard by using SoftwareKeyboardController which is delivered by onTextInputStarted callback ( I8dc44 , b/151860051 )

  • TextFieldValue used with TextField can now be survive activity recreation when used like this: var text by savedInstanceState(saver = TextFieldValue.Saver) { TextFieldValue() } ( I5c3ce , b/155075724 )

  • Adds commonly used parameters to Text(). If you are currently creating a local text style to pass a small number of these parameters, such as Text(style = TextStyle(textAlign = TextAlign.Center)) , you can now just provide the parameters directly: Text(textAlign = TextAlign.Center) ( I82768 )

  • Replaced CoreTextField/TextField focusIdentifier parameter with FocusNode in order to integrate with focus subsystem. ( I7ea48 )

  • TextField update - in horizontal dimension it will occupy all available space granted to it ( Ib08df , b/154638552 )

  • Added InteractionState and Interaction, making it easier to build components that react to UI state changes such as press, and drag ( Icfe25 , b/152525426 )

  • RectangleShape moved from androidx.ui.foundation.shape.* to androidx.ui.graphics.* ( Ia74d5 , b/154507984 )

  • Replaced all nullable Color uses in API with non-nullable and use Color.Unset instead of null ( Iabaa7 )

  • TextField API update - merged onFocus and onBlur callbacks into a single onFocusChange(Boolean) callback with parameter ( I66cd3 )

  • Renamed ScaleFit to ContentScale Moved ContentScale from ui-graphics to ui-core module to live in the same module as the Alignment API. Renamed FillMaxDimension to Crop Renamed FillMinDimension to Fit Renamed Fit to Inside to better match ImageView.ScaleType equivalents Added documentation indicating that the combination of Crop and Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_CROP and Fit used with Alignment.Center achieves the same result as ImageView.ScaleType.FIT_CENTER Inside used with Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_INSIDE ( I45f09 , b/152842521 )

  • Removes ProvideContentColor, instead just use ContentColorAmbient directly with Providers ( Iee942 )

  • Adds color parameter to text, allowing overriding the color of the text style without needing to manually merge with the style provided in a theme. ( I41a66 )

  • Improve DrawModifier API:

    • Made the receiver scope for draw() ContentDrawScope
    • Removed all parameters on draw()
    • DrawScope has same interface as former CanvasScope
    • ContentDrawScope has drawContent() method ( Ibaced , b/152919067 )
  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. ( I499fa , b/152753731 )

  • Shape theming system is updated according to the Material design specification. Now you can provide small, medium and large shapes to be used by most of the components ( Ifb4d1 )

  • Replaced Modifier plus operator with factory extension functions ( I225e4 )

  • Draggable has been moved to modifier ( Id9b16 , b/151959544 )

  • Moved Text to androidx.ui.foundation package, from androidx.ui.core. ( I87ce5 )

  • add enabled param to Checkbox, Switch and Toggleable ( I41c16 )

  • Ripple is now a Modifier. While Clickable is not yet converted the recommended usage is Clickable(onClick = { ... }, modifier = ripple()) ( Ie5200 , b/151331852 , b/150060763 )

  • Added VectorPainter API to replace existing subcomposition API for vector graphics. Result of subcomposition is a VectorPainter object instead of a DrawModifier. Deprecated previous DrawVector composables in favor of VectorPainter.

    Renamed Image(Painter) API to PaintBox(Painter) Created Vector composable that behaves like the Image composable except with a VectorAsset instead of an ImageAsset ( I9af9a , b/149030271 )

  • Created Image composable to handle sizing/layout in addition to drawing a given ImageAsset to the screen. This composable also supports drawing any arbitrary Painter instance respecting its intrinsic size as well as supporting a given fixed size or minimum size ( Ibcc8f )

  • Button, FloatingActionButton and Clickable now have a separate enabled param. Some of the params on Button were renamed or reordered. ( I54b5a )

  • Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content.

    Created extension method on android.graphics.Bitmap, Bitmap.asImageAsset() , to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework. ( Id5bbd )

  • DrawImage composable was removed. Use ImagePainter to draw image on existing layout, or SimpleImage to introduce Image that takes space ( I595e1 , b/149827027 )

  • Stack component supports right-to-left directionality ( Ic9e00 )

  • Added Icon, IconButton and IconToggleButton, removing AppBarIcon. You can directly replace existing usages of AppBarIcon with IconButton, and they will now have the correct touch target. See the samples for usage information, and see Icons for the provided Material Icons you can use directly with these components. ( I96849 )

  • DrawShape composable was removed. Use DrawBackground modifier instead. ( I7ceb2 )

  • Added AdapterList, a scrolling list component that only composes and lays out the visible items. Currently known issues include that it is vertical-only and does not fully handle all cases of changes to its children. ( Ib351b )

  • Scrollable component has been added, which allows creation of custom Scrollers/Lists ( I5fd37 )

  • Renamed background to DrawBackground and make it to be memorized by default ( Ia0bd3 )

  • Add paddings, border, shape and background param to Box ( I05027 , b/148147281 )

  • Added Canvas component. This composable takes up some size (provided by user) and allows you to draw using CanvasScope ( I0d622 )

  • rename Border modifier to DrawBorder ( I8ffcc )

  • Added Box component for combining layout and drawing common functionality. ( I6e2a7 )

  • Scrollers now exhibit native Android fling motion behavior. ( I922af , b/147493715 )

  • Replaced DrawBorder in favor of Border Modifier ( Id335a )

  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )

  • The percent parameter when creating ConstraintLayout guidelines has been renamed to fraction. ( Ida2db )

  • Added support for margins of ConstraintLayout barriers. ( I47ffe )

  • Fixed RTL support in ConstraintLayout. Added RTL unaware APIs. ( I3b1c7 )

  • A new DSL for ConstraintLayout has been added. Please see the samples for more details. ( Icaa9a )

  • Added the @ExperimentalLayout annotation. ConstraintLayout, FlowRow and FlowColumn are now tagged with it to mark that their APIs are going to change. ( I412a8 )

  • Modifier.padding(InnerPadding) has been added ( I94985 , b/157133803 )

  • Removed deprecated RowAlign, ColumnAlign in Row and Column. ( If60d4 , b/155858731 )

  • Removed deprecated LayoutTag(), please use Modifier.tag() instead. Removed deprecated Modifier.matchParent(), please use Modifier.matchParentSize() instead. ( If8044 )

  • Added the offsetPx layout modifier, which can be used to define (dynamic) offsets in px. ( I5af57 )

  • AlignmentLineOffset composable is deprecated, please use relativePaddingFrom() modifier instead. CenterAlignmentLine composable is removed. ( I60107 )

  • Added defaultMinSizeConstraints layout modifier, which sets size constraints to the wrapped layout only when the incoming corresponding constraints are unspecified (0 for min constraints and infinity for max constraints). ( I311ea , b/150460257 )

  • Container has been removed. Use Box instead ( Ibbc2b , b/151407926 )

  • Removed deprecated LayoutWidth/Height/Size modifiers. ( Ib0bc1 )

  • Added default parameter values for the offset modifier. ( I37f06 )

  • Added symmetric padding modifier. ( I39840 )

  • Removed deprecated LayoutAspectRatio modifier. ( I65a74 )

  • Removed deprecated LayoutAlign modifiers. ( I10877 )

  • Fixed a bug in the width and height modifiers that was causing the wrapped layout to be measured with no opposite axis constraints. ( I210b8 , b/154797971 )

  • Added verticalGravity and horizontalGravity parameters to Row and Column, respectively. ( I7dc5a )

  • Updated wrapContentWidth and wrapContentHeight to expect vertical or horizontal Alignment rather than any Alignment. The gravity modifier was updated to accept vertical or horizontal Alignment. Row, Column and Stack were updated to support custom continuous Alignments. ( Ib0728 )

  • Made Alignment instantiable with arbitrary values. Added 1D Alignments. ( Ia0c05 )

  • Renamed EdgeInsets to InnerPadding. Renamed innerPadding parameter of Material Buttons to paddding. ( I66165 )

  • alignToSiblings now accepts a Measured instead of Placeable. ( I5788d )

  • Added modifiers for sizing to intrinsic measurements and deprecated the components serving this purpose. ( I8295d )

  • Added support for customizing dimensions of children of ConstraintLayout ( Idb1a5 )

  • Removed deprecated Wrap and Center composables. ( I29e23 )

  • Added LayoutModifier2, a new API for defining layout modifiers; deprecated LayoutModifier ( If32ac )

  • RowScope and ColumnScope members are now accessible outside Row and Column. ( I3a641 )

  • Container has been deprecated. Use Box instead. ( I675ce , b/151407926 )

  • Added the LayoutOffset modifier for offsetting layout position ( I0b8a3 )

  • Initial support for Rtl in Compose layout ( Ia5519 )

  • Updated LayoutAlign to not fill the available space anymore ( I2b14f )

  • Removed AspectRatio composable in favor of modifier. Deleted obsolete FlexColumn, FlexRow composables and Spacing modifier ( Iec8a7 )

  • Removed the LayoutInflexible modifier for Row and Column ( I0d820 )

  • Implement Drag Selection Handles to change selection for TextField. ( I27032 )

  • Implements LongPressAndDrag for TextField Selection. ( I17919 )

Исправления ошибок

  • FocusModifier is deprecated in favor of Modifier.focus, Modifier.focusRequester, Modifier.focusObserver. FocusState and FocusDetailedState are deprecated in favor of FocusState2 ( I46919 , b/160822875 , b/160922136 )
  • runOnIdleCompose renamed to runOnIdle ( I83607 )
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. ( I7f164 )
  • Removes previously deprecated Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. ( I663b2 , b/155375067 )
  • Removed obsolete size testing APIs. ( Iba0a0 )
  • Made LayoutNode experimental API ( I4f2e9 )
  • Version 1 of scroll orientation locking is implemented across Compose. ( I1ce7a , b/150289741 )
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
  • Removed layout direction parameter from the measure block of the Layout() function. Layout direction is however available inside the callback through the measure scope object ( Ic7d9d )
  • Add AbsoluteArrangement - allows for arrangement of the children inside the Row without automatic mirroring in RTL ( I3a1df )
  • @Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) ( Id211e )
  • Prior to this change, the compose compiler plugin would non-trivially intercept calls to constructors inside of a @Composable function if there was an ( I5205a , b/158123804 )
  • Add viewModel() composable which allows to create or get already created ViewModel similarly to how it works in Activity or Fragment ( I5fdd1 )
  • Refactored Radius class to be an inline class. Removed companion creation methods in favor of function constructor with default parameter to have the radius along the y-axis match that of the mandatory x-axis radius parameter.

    Updated DrawScope.drawRoundRect to consume a single Radius parameter instead of 2 separate float values for the radius along the x and y axis ( I46d1b )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters. Deleted Px class in its entirety ( I3ff33 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I086f4 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Id3434 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I97a5a )

  • TextField's cursor has a blinking animation ( Id10a7 )

  • Partial gestures no longer require passing around of a GestureToken ( Id7ae5 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I57bff )

  • Modifier.semantics has been undeprecated to allow usages for high level components. ( I4cfdc )

  • Rename AnnotatedString.Builder.addAnnotationString to addStringAnnotation. ( I5059e )

  • Updated Alignment API and added support for absolute alignment (which does not auto-mirror in Rtl context) ( I38cd3 )

  • Layout and LayoutModifier children can be measured with a different layout direction. ( Ibd731 )

  • Introduce additional optional rect parameter to ImagePainter to support drawing a subsection of underlying ImageAsset ( I0ea9e )

  • Fixed a crash in AdapterList when removing items ( Ic64b0 , b/153195921 )

  • We changed how we measure the first layout you put inside activity.setContent { } block. Previously it was forced to fill the whole activity screen, and now it behaves as if you put your layout inside a Stack: it can be smaller than a screen and will be positioned in the top left screen. If you want the old behaviour you can apply Modifier.fillMaxSize() for your layout. ( Ie88a7 , b/153453714 )

  • ui-text-compose module is renamed as ui-text. ui-text now contains CoreText and CoreTextField composables ( Ib7d47 )

  • ui-text module is renamed as ui-text-core ( I57dec )

  • Moved ui-framework/CoreText, CoreTextField composables under ui-text-compose. You might want to include ui-text-compose in your project. ( I32042 )

  • runOnIdleCompose and runOnUiThread are now global functions instead of methods on ComposeTestRule. ( Icbe8f )

  • [Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using by state { ... } or by mutableStateOf(...) . ( I5312c )

  • DrawLayerModifier and drawLayer() now default clipToBounds and clipToOutline to false. ( I0eb8b , b/152810850 )

  • Renamed LayoutResult to MeasureResult. ( Id8c68 )

  • Deprecated Center composable. It should be replaced either with the LayoutSize.Fill + LayoutAlign.Center modifier, or with one of the Box or Stack composables with suitable modifiers applied ( Idf5e0 )

  • Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. ( If4738 )

  • DrawVector has been changed from a regular composable function to returning a Modifier drawVector() that will draw the vector as a background to a layout. ( I7b8e0 )

  • Replace composable function Clip with modifier drawClip(). DrawClipToBounds is a convenient modifier to use when you only need to clip to the layer bounds with a rectangle shape. ( If28eb )

  • Replaced DrawShadow composable function with drawShadow() modifier. Shadows are now drawn as part of LayerModifier. ( I0317a )

  • androidx.compose.ViewComposer has been moved to androidx.ui.node.UiComposer androidx.compose.Emittable has been removed. It was redundant with ComponentNode. androidx.compose.ViewAdapters has been removed. They are no longer a supported use case. Compose.composeInto has been deprecated. Use setContent or setViewContent instead. Compose.disposeComposition has been deprecated. Use the dispose method on the Composition returned by setContent instead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move ( Idef00 )

  • Deprecated Wrap composable. It can be replaced either with the LayoutAlign modifier or with the Stack composable ( Ib237f )

  • Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )

  • Rename Painter.toModifier to Painter.asModifier as the newly created Modifier has a reference to the original Painter that can be shared across multiple Modifier instances ( I7195b )

  • Support right-to-left direction in LayoutPadding modifier ( I9e8da )

  • Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) ( I11cb1 )

  • Removed ValueHolder class. Restructured AnimatedValue, AnimatedFloat classes to make the animation value field abstract so that subclasses can watch the value update.

    • Added model classes for AnimatedValue, AnimatedFloat, etc.
    • Added a new set of light-weight @Composable API for animating between values.
    • ( I79530 )
  • Breaking changes to the ambients API. See log and Ambient<T> documentation for details ( I4c7ee , b/143769776 )

  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. ( I896c5 , b/158134875 )

  • Fixed a ConstraintLayout bug causing a crash on recompositions. ( Ibee5a , b/158164341 )

  • WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp ( I91b9a , b/149979702 )

  • Renamed LayoutModifier2 to LayoutModifier. ( Id29f3 )

  • Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )

  • LayoutDirectionAmbient is deprecated. To read the layout direction defined by the locale, use localeLayoutDirection on ConfigurationAmbient ( I851b1 )

  • Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )

  • ParentData composable is deprecated. You should either create a modifier which implements ParentDataModifier interface, or use LayoutTag modifier if you simply need to tag layout children to recognize them inside the measure block. ( I51368 , b/150953183 )

  • Add OnPositionedModifier and OnChildPositionedModifier to replace OnPositioned and OnChildPositioned composable functions. ( I2ec8f )

  • Disallow negative padding in LayoutPadding. LayoutOffset should be used instead for negative position offsets. ( Ifb5b1 )

  • WithConstraints got LayoutDirection parameter ( I6d6f7 )

  • Updated the ComposeFlags.COMPOSER_PARAM flag to be true , which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. ( I7971c )

  • Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. ( I0245a )

  • LayoutCoordinates no longer has a position property. The position property does not make sense when considering LayoutModifiers, rotation, or scaling. Instead, developers should use parentCoordinates and childToLocal() to calculate the transform from one LayoutCoordinate to another.

    LayoutCoordinates uses IntPxSize for the size property instead of PxSize. Layouts use integer pixel sizes for layouts, so all layout sizes should use integers and not floating point values. ( I9367b )

  • Improvements to the API surface of Constraints ( I0fd15 )

  • Added TextDirection.Content ( I48f36 )

  • Ajdust the Toolbar Menu to show copy, cut, paste properly. ( Id3955 )

  • Add FloatingToolbar for TextField Selection. ( Ie8b07 )

  • TextDirectionAlgorithm is renamed as TextDirection ( I75ce8 )

  • TextDirection is renamed as ResolvedTextDirection ( I3ff38 )

  • Add HapticFeedback to TextField Selection. ( I58050 )

  • Add Copy, Cut, and Paste methods to TextField Selection. ( Idb70b )

  • TestTag and Semantics have been deleted. Use Modifier.testTag and Modifier.semantics instead ( I15ff0 , b/158841414 )

  • Changed the package name for Locale and LocaleList from androidx.ui.text to androidx.ui.intl ( I8132c )

  • API change: AnnotatedString(builder: Builder) is renamed to annotatedString(builder: Builder) . ( Ia6377 )

  • API change: AnnotatedString.Item is renamed to AnnotatedString.Range . ( I2d44d )

  • Add Toolbar for text related operations. ( I49d53 )

  • New LifecycleOwnerAmbient is now available. Now an Activity you are using with Compose UI should extend androidx.activity.ComponentActivity (or AppCompatActivity). setContent on android.app.Activity is now deprecated ( Idb25a , b/153141084 )

  • ui-android-text package name (androidx.text) replaced with androidx.ui.text.platform in order to align with androidx policy. ( I42711 )

,

Compose Foundation

Write Jetpack Compose applications with ready to use building blocks and extend foundation to build your own design system pieces.
Последнее обновление Стабильный выпуск Кандидат на выпуск Бета-версия Альфа-релиз
11 декабря 2024 г. 1.7.6 - - 1.8.0-alpha07

Структура

Compose is combination of 7 Maven Group Ids within androidx . Each Group contains a targeted subset of functionality, each with its own set of release notes.

This table explains the groups and links to each set of release notes.

Группа Описание
compose.animation Build animations in their Jetpack Compose applications to enrich the user experience.
compose.compiler Transform @Composable functions and enable optimizations with a Kotlin compiler plugin.
compose.foundation Write Jetpack Compose applications with ready to use building blocks and extend foundation to build your own design system pieces.
compose.material Build Jetpack Compose UIs with ready to use Material Design Components. This is the higher level entry point of Compose, designed to provide components that match those described at www.material.io.
compose.material3 Build Jetpack Compose UIs with Material Design 3 Components, the next evolution of Material Design. Material 3 includes updated theming and components and Material You personalization features like dynamic color, and is designed to be cohesive with the new Android 12 visual style and system UI.
compose.runtime Fundamental building blocks of Compose's programming model and state management, and core runtime for the Compose Compiler Plugin to target.
compose.ui Fundamental components of compose UI needed to interact with the device, including layout, drawing, and input.

Объявление зависимостей

To add a dependency on Compose, you must add the Google Maven repository to your project. Для получения дополнительной информации прочтите репозиторий Google Maven .

Добавьте зависимости для нужных вам артефактов в файл build.gradle для вашего приложения или модуля:

классный

dependencies {
    implementation "androidx.compose.foundation:foundation:1.7.5"
}

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

Котлин

dependencies {
    implementation("androidx.compose.foundation:foundation:1.7.5")
}

android {
    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

For more information about dependencies, see Add build dependencies .

Обратная связь

Ваши отзывы помогают сделать Jetpack лучше. Дайте нам знать, если вы обнаружите новые проблемы или у вас есть идеи по улучшению этой библиотеки. Пожалуйста, ознакомьтесь с существующими проблемами в этой библиотеке, прежде чем создавать новую. Вы можете добавить свой голос к существующей проблеме, нажав кнопку со звездочкой.

Создать новую задачу

Дополнительную информацию см . в документации по системе отслеживания проблем .

Version 1.8

Version 1.8.0-alpha07

11 декабря 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha07 is released. Version 1.8.0-alpha07 contains these commits .

Изменения API

  • Deleted ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabled flag that helped revert the removal of internal graphicsLayer from BasicText . If you were using this flag please let us know of the reasons by filing a bug. Also you can just pass in Modifier.graphicsLayer() to your BasicText calls to achieve the same behavior as before. ( Id9f90 )
  • Added default implementation for new stickyHeader DSL. ( I68986 )
  • Has LocalAutofillHighlightColor composition local use a Color type. ( I0e05b )
  • Renamed OverscrollEffect#withoutDrawing to OverscrollEffect#withoutVisualEffect . ( I1a154 )

Исправления ошибок

  • Follow-up fix for an issue in AnchoredDraggable 's target calculation where it could settle at the wrong anchor for specific swipes. ( I23b87 , b/367660226 )

Внешний вклад

  • Add BringIntoViewResponderModifierNode to UI, which provides a new way to implement Bring Into View functionality as well as allows implementing in on a platform level ( Ia6dd8 )
  • We are ever slightly changing the way the cursor is drawn. You can use LocalCursorBlinkEnabled to disable the cursor drawing in tests. ( I4c697 )

Version 1.8.0-alpha06

13 ноября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha06 is released. Version 1.8.0-alpha06 contains these commits .

Изменения API

  • Adds stylusHoverIcon modifier. ( Iff20a , b/331289114 )
  • Deprecated AnchoredDraggableState 's confirmValueChange . Instead of vetoing state changes, disallowed anchors should not be in the active anchor set, and an OverscrollEffect should be used to indicate the unavailability of the requested action. ( Ia717f )
  • Changes Autofill manager to be an interface. ( I84914 , b/376080755 )
  • Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere. ( Idbb3d , b/266550551 , b/204650733 , b/255554340 , b/229537244 )
  • Adding autofill support in text toolbar. ( Ie6a4c )
  • Deprecates OverscrollConfiguration and LocalOverscrollConfiguration , and adds rememberPlatformOverscrollFactory to create an instance of / customize parameters of the default overscroll implementation. To disable overscroll, instead of LocalOverscrollConfiguration provides null , use LocalOverscrollFactory provides null . To change the glow color / padding, instead of LocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding) , use LocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding) . ( Ie71f9 , b/255554340 , b/234451516 )
  • Changed the effectModifier property on OverscrollEffect to be node: DelegatableNode , consistent with other APIs. ( Ic0b46 , b/255554340 )
  • Removed the experimental GlobalAssertions API. It's intended use was to run accessibility checks, see enableAccessibilityChecks() for that purpose instead. ( I59322 )

Version 1.8.0-alpha05

30 октября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha05 is released. Version 1.8.0-alpha05 contains these commits .

Новые возможности

  • Support for auto-sizing text. Pass an AutoSize instance (eg AutoSize.StepBased ) to your favorite text composable (like BasicText ) and see your text size adapt to the available space! ( Ice7e0 , b/139320827 )
  • Adds OverscrollFactory and LocalOverscrollFactory APIs to allow configuring overscroll within a hierarchy. The value provided through LocalOverscrollFactory will be used by default to create an OverscrollEffect . To create and remember an effect from the current provided factory, use rememberOverscrollEffect() . ( I51ca4 , b/255554340 )

Изменения API

  • Introduce CompositionLocal that can be used to modify the hue of Autofill's successful filling highlight. ( I32092 )
  • Removed ScrollableDefaults.overscrollEffect - instead you should use rememberOverscrollEffect . This will create an instance of the current overscroll implementation provided with LocalOverscrollFactory . ( I1651a , b/255554340 ),( b/234451516 )
  • Introduces new AutofillManager interface that can be used to fine-tune users' Autofill journey and a isSemanticAutofillEnabled flag to turn on this new version of Autofill. ( I9d484 )
  • Removes CombinedClickableNode . This experimental API was temporarily exposed to unblock performance work, but is no longer needed. Instead you should directly use Modifier.combinedClickable as with other modifier APIs. ( I4b658 )
  • Adds overloads to horizontalScroll , verticalScroll , LazyColumn , LazyRow , LazyHorizontalGrid , LazyVerticalGrid , LazyHorizontalStaggeredGrid , LazyVerticalStaggeredGrid , HorizontalPager , and VerticalPager with support for specifying a custom OverscrollEffect . The provided OverscrollEffect will receive events, and be rendered within the bounds of these components. Note that drawing the same OverscrollEffect twice is unsupported - so you cannot draw the same OverscrollEffect provided to one of these components separately with Modifier.overscroll . The use case of drawing the overscroll outside of the bounds of these components will be addressed separately in the future. ( I2dc42 , b/266550551 , b/234274772 , b/224572538 , b/353805117 )

Version 1.8.0-alpha04

16 октября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha04 is released. Version 1.8.0-alpha04 contains these commits .

Изменения API

  • Adds DelegatableNode#onDensityChange and DelegatableNode#onLayoutDirectionChange callbacks to allow updating node state when these change. ( I04f3e , b/340662451 )
  • Paragraph and ParagraphIntrinsics now takes a list of all annotations applied to the AnnotatedString , previously it only had a list of SpanStyles . ( I12f80 )
  • Introduced PointerInputModifierNode#touchBoundsExpansion , which can be used to enlarge the touch bounds of a single pointer input modifier. ( Iccf02 , b/335339283 )

Исправления ошибок

  • Fixed a bug where positional thresholds passed to AnchoredDraggableDefaults.flingBehavior were not considered correctly in some scenarios. ( Ifdf0d , b/367660226 )
  • Introduce a fix for nested scrollables that are removed from the node tree during an ongoing fling. Now these nodes will cancel the fling and correctly send the onPostFling event with the remaining velocity. We're also introducing the flag NewNestedScrollFlingDispatchingEnabled to control the behavior in case of regressions. The flag will be removed before beta. ( I05c37 , b/371168883 )
  • Fixed a bug where OverscrollEffects passed to Modifier.anchoredDraggable would receive 2D deltas instead of 1D. ( Ie52c0 )

Version 1.8.0-alpha03

2 октября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha03 is released. Version 1.8.0-alpha03 contains these commits .

Изменения API

  • Обновление версии Kotlin до 1.9 ( I1a14c )
  • Introduced flag DraggableAddDownEventFixEnabled ( I848d5 )
  • Introduced a new Semantics Role called Carousel to emulate the list behavior in Pagers for a11y services. ( Id354b , b/354109776 , b/239672673 )
  • Removed the implicit graphicsLayer modifier from BasicText composable. Added experimental ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabled flag to be able to revert to the old behavior. ( Ie478d )
  • Added Modifier.recalculateWindowInsets() to allow children in the hierarchy to use insetsPadding even when parents aligned them without consumeWindowInsets() . ( I7f9e4 )

Исправления ошибок

  • Implement gesture pick-up in detectDragGestures , draggables and scrollables. Now if a child draggable gives up on a gesture, the parent has the opportunity to pick it up. This allows for a more continuous and integrated gesture handling. ( Ic88fe )
  • Update fling cancellation behavior in scrollables. Now if a scrollable flings and hits the bounds it will correctly pass on the fling velocity to the next scrollable in the chain instead of continue to drive the fling. ( I9326a )

Version 1.8.0-alpha02

18 сентября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha02 is released. Version 1.8.0-alpha02 contains these commits .

Изменения API

  • TextOverflow.StartEllipsis and TextOverflow.MiddleEllipsis are now available which allows to place ellipsis at the start or middle of the line of the single line text ( I38913 , b/185418980 )

Version 1.8.0-alpha01

4 сентября 2024 г.

androidx.compose.foundation:foundation-*:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits .

Version 1.7

Version 1.7.6

11 декабря 2024 г.

androidx.compose.foundation:foundation-*:1.7.6 is released. Version 1.7.6 contains these commits .

Исправления ошибок

  • Fixed text inline content not being visible to accessibility services.
  • Fixed an issue where AndroidEmbeddedExternalSurface would not reset properly and be stuck when reusing in a lazy list.

Version 1.7.5

30 октября 2024 г.

androidx.compose.foundation:foundation-*:1.7.5 is released. Version 1.7.5 contains these commits .

Исправления ошибок

  • Ensure that pinned items are not subcomposed twice in the content padding area. ( Ic6224 )

Version 1.7.4

16 октября 2024 г.

androidx.compose.foundation:foundation-*:1.7.4 is released. Version 1.7.4 contains these commits .

Исправления ошибок

  • Fixed a bug causing a rare crash in text fields. ( I475c6 , b/313010266 )
  • Removed ReusableContentHost at the root of Lazy layout items. This was a potential root cause for “measure called on a deactivated node” crashes. ( Id6e60 )

Version 1.7.3

2 октября 2024 г.

androidx.compose.foundation:foundation-*:1.7.3 is released. Version 1.7.3 contains these commits .

Исправления ошибок

  • Fixed a memory leak with BasicText when minLines is set to a non-default value.

Version 1.7.2

18 сентября 2024 г.

androidx.compose.foundation:foundation-*:1.7.2 is released. Version 1.7.2 contains these commits .

Исправления ошибок

  • Fix issue with draggable that was missing down events which caused flings to look slower than normal.

Version 1.7.1

September 10, 2024

  • No changes to Android artifacts. -desktop artifacts were removed and -jvmStubs and -linuxx64Stubs artifacts were added. None of these targets are meant to be used, they are placeholders to help Jetbrains Compose efforts.

Version 1.7.0

4 сентября 2024 г.

androidx.compose.foundation:foundation-*:1.7.0 is released. Version 1.7.0 contains these commits .

Important changes since 1.6.0

  • Performance of Modifier.clickable , Modifier.focusable , Modifier.indication , Modifier.scrollable and Modifier.draggable has been significantly improved. As a part of this effort, the following API changes were made in addition to internal changes
    • Added a new Indication API, IndicationNodeFactory . This leads to more performant Indication implementations compared to the previous (now deprecated) rememberUpdatedInstance API. For migration information, see developer.android.com .
    • clickable / combinedClickable / selectable / toggleable now accepts a nullable MutableInteractionSource parameter. If null, and the provided Indication is an IndicationNodeFactory , the Indication can be lazily created only when needed, which improves performance. If you are not hoisting and using the MutableInteractionSource , it is recommended to pass null instead of passing remember { MutableInteractionSource() } .
    • Indication#rememberUpdatedInstance has been deprecated. It has a high unavoidable performance penalty, and prevents other optimizations. Instead, you should use the new IndicationNodeFactory API.
  • BasicTextField using a TextFieldState is now stable and we advise all call-sites to begin migration from BasicTextField(value, onValueChange) to BasicTextField(TextFieldState) .
  • The ClickableText has been deprecated. To add clickable links to your text, use BasicText with the new LinkAnnotation annotation in your AnnotatedString . LinkAnnotation allows for custom styling based on link state (eg focused, hovered).
  • Introducing ContextualFlowRow and Enhanced FlowRow/Column with MaxLines and Overflow . We are excited to announce enhancements to the experimental FlowRow and FlowColumn , now featuring maxLines and overflow support, alongside the debut of ContextualFlowRow and ContextualFlowColumn . This update is designed to provide performance optimal components, where ContextualFlow* is perfect for a large number of items making use of a small maxLines config and dynamic +N see more buttons, and FlowRow and FlowColumn is perfect for a small number of items, less than 100 items. Important: To maintain existing behavior in FlowRow or FlowColumn where all items are composed regardless of if they fit the cross axis max, set overflow to FlowRowOverflow.Visible or FlowColumnOverflow.Visible during initialization. Explore ContextualFlowRowSample and FlowRowSample for examples of these new features in action. ( Ib9135 , b/293577082 )
  • Item appearance and disappearance animation support was added into LazyColumn and LazyRow . Previously it was possible to add Modifier.animateItemPlacement() modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called Modifier.animateItem() which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I2d7f7 , b/150812265 )
  • Implemented experimental support for long screenshots in Compose scroll containers using the official Android API ( ScrollCaptureCallback ).
  • NestedScroll sources Drag and Fling are being replaced by UserInput and SideEffect to accommodate for the extended definition of these sources that now include animations (Side Effect) and Mouse Wheel and Keyboard ( UserInput ).
  • LazyLayout prefetch requests can be marked as urgent now, meaning that we expect this item to be needed in the next frame and want to ignore frame budget to make sure to do more work in advance ( Id513f )
  • Support stylus handwriting feature on devices after Android U. ( I002e4 )
  • Various APIs have been promoted to stable
    • Pagers, snapping, window insets

Version 1.7.0-rc01

21 августа 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits .

Исправления ошибок

  • Fixed a regression where the crash occurred when any element is focused inside a parent that is focusable (or clickable) and disabled. ( b/317561689 )

Version 1.7.0-beta07

7 августа 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta07 is released. Version 1.7.0-beta07 contains these commits .

Исправления ошибок

  • Text input related SemanticsNodeInteraction functions performTextReplacement , performTextInput , and performTextClearance is now going to throw assertion errors when they are called on read only TextFields . ( I4ae8f )
  • Fixed a visual glitch in hyperlinks. ( I23311 )
  • Fixed contentReceiver modifier not working with some IMEs.
  • Velocity generation: Prevent propagation of NaN values in Compose UI and Foundation.

Version 1.7.0-beta06

24 июля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta06 is released. Version 1.7.0-beta06 contains these commits .

Version 1.7.0-beta05

10 июля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta05 is released. Version 1.7.0-beta05 contains these commits .

Исправления ошибок

  • Fix for treatment of Nan values in SnapFlingBehavior and Pager.

Version 1.7.0-beta04

26 июня 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta04 is released. Version 1.7.0-beta04 contains these commits .

Исправления ошибок

  • Avoid crashes when measuring very large text lines (eg 10k characters) ( 8157ab )
  • Fixes measurement of very large text causing crash in the new BasicTextField ( 6b7575 )
  • Reverts a behavior change in Row/Column measurement that breaks Text usage in certain scenarios ( 69e8ba )

Version 1.7.0-beta03

12 июня 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta03 is released. Version 1.7.0-beta03 contains these commits .

Version 1.7.0-beta02

29 мая 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta02 is released. Version 1.7.0-beta02 contains these commits .

Изменения API

  • Adds an experimental API for configuring prefetch behavior of LazyGrids similar to the existing experimental API for LazyLists . This includes support for prefetching items in nested LazyGrids . Similiar to LazyListPrefetchStrategy , the implementation default is to prefetch the first 2 nested items of each grid, but this can be configured by the new LazyGridPrefetchStrategy(nestedPrefetchItemCount) and LazyListPrefetchStrategy#onNestedPrefetch APIs. ( I591c4 )
  • Renamed SemanticsProperties.Editable to IsEditable and changes SemanticsPropertyReceiver.editable to a val isEditable . The property is now a boolean and always specified by text fields. ( I8acd8 )
  • Moved basicMarquee default values into MarqueeDefaults object. ( I12ff6 )
  • Renamed basicMarquee delayMillis parameter to repeatDelayMillis . ( I12ff6 )
  • Update API for styling the links: moved the TextLinkStyles to the TextStyle and removed the TextDefaults from material ( I5477b )

Исправления ошибок

  • Renamed LayoutCoordinates.introducesFrameOfReference to LayoutCoordinates.introducesMotionFrameOfReference to better reflect its purpose. Renamed related function to calculate coordinates based on that flag. ( I3a330 )
  • Removed 'Default' from the MarqueeDefaults properties. ( I1d8a0 )
  • Removed 'Marquee' from MarqueeDefaults properties. ( Iad4f4 )
  • Removed TextLinkStyles from the TextStyle class. Instead, TextLinkStyles is part of the LinkAnntation constructor and the AnnotatedString.fromHtml method ( I90b2b )
  • Fixed a bug where Pager would snap when flinging towards a bound while already settled at the bound. ( I9f373 , b/339171222 )
  • BTF2 now has correct mouse selection gestures. ( Ibe8c6 )

Внешний вклад

  • Resubmit 'Make compose/measure time calculation content-type based in prefetch to improve accuracy' ( Iea622 )
  • Make compose/measure time calculation content-type based in prefetch to improve accuracy ( Ibccb1 )
  • Make WindowInsetsPadding modifiers available from common source set ( I070b2 )

Version 1.7.0-beta01

14 мая 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-beta01 is released. Version 1.7.0-beta01 contains these commits .

Изменения API

  • Added KeyboardOptions.shouldShowKeyboardOnFocus property back as deprecated hidden for binary compatibility. ( I15cfe )
  • Modifier.anchoredDraggable now reverses drag deltas by default for components with a Horizontal orientation when used in an RTL layout. ( I3c6d9 )
  • AnnotatedString.hasEqualsAnnotations is now hasEqualAnnotations . ( I685c0 )
  • Updated the API for getting Material themed links in text. Specifically, removed the methods from the TextDefaults for constructing themed LinkAnnotations and parse HTML with themed links. Instead, added a TextLinkStyles class that allows to style the links as a parameter to the Text composable. ( I31b93 )
  • Replaced onDragStarted and onDragStopped with non-suspend callbacks. ( I59de8 )

Исправления ошибок

  • Fixed a bug where Pager would crash when the contentPadding was bigger than the incoming constraints. Pager now coerces negative values returned from PageSize to 0. ( Iba5d8 , b/314008560 )

Version 1.7.0-alpha08

1 мая 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha08 is released. Version 1.7.0-alpha08 contains these commits .

Новые возможности

  • Added right-click context menu to BasicTextField and SelectionContainer with items for cut, copy, paste, and select-all actions. ( If8c93 , Ia2b49 , I6f268 )

Изменения API

  • LazyLayout prefetch requests can be marked as urgent now, meaning that we expect this item to be needed in the next frame and want to ignore frame budget to make sure to do more work in advance ( Id513f )
  • Renamed isPositionedByParentWithDirectManipulation to introducesFrameOfReference . Note that it now has the reverse effect, meaning that by default, most LayoutCoordinates introduce a frame of reference, and, only when placed under direct manipulation the property will be false. To query position with only those that introduce a frame of reference, use positionInLocalFrameOfReference(...) . Or positionInLocalLookaheadFrameOfReference from a LookaheadScope . ( Ifc5f7 )
  • Renamed onClicked to onClick inside LinkInteractionListener ( Iaa35c )
  • Change action lambda for getScrollViewportLength as per API council feedback. ( Ibc74a )
  • Renamed stylus handwriting delegation APIs. ( Ica45f , b/327271923 )
  • Rename TextInclusionStrategy.isInside to isIncluded . Make Paragraph/MultiParagraph#getRangeForRect() return type non nullable. ( I51f26 )

Исправления ошибок

  • Added "Select all" to all text contextual menus in SelectionContainer . ( Ib750e , b/240143283 )
  • Fixed long screenshot capture for scrolling containers with reverseScrolling=true . ( I7c59c )
  • Fixed an issue where AnchoredDraggableState 's currentValue would change when approaching the state's bounds. ( Iea30b , b/333846848 )

Внешний вклад

  • Renamed PrefetchExecutor -> PrefetchScheduler to better reflect its responsibilities. ( Ib9154 )
  • Added support for prefetching items in nested LazyLists (eg a LazyColumn that renders nested LazyRows ). This change is expected to reduce frame drops during scrolling for these LazyLists . The implementation default is to prefetch the first 2 nested items, however this behavior can be controlled by the new LazyLayoutPrefetchStrategy(nestedPrefetchItemCount) and LazyListPrefetchStrategy#onNestedPrefetch APIs. ( I51952 )

Version 1.7.0-alpha07

17 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha07 is released. Version 1.7.0-alpha07 contains these commits .

Новые возможности

  • Added a TextDefaults object that contains methods to construct a LinkAnnotation and parse HTML-tagged string which apply MaterialTheme to the links. ( I98532 , b/139312671 )
  • Item appearance and disappearance animation support was added into LazyVerticalGrid and LazyHorizontalGrid . Previously it was possible to add Modifier.animateItemPlacement() modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called Modifier.animateItem() which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( Ib7d12 , b/330510929 )
  • Item appearance and disappearance animation support was added into LazyVerticalStaggeredGrid and LazyHorizontalStaggeredGrid . Previously it was possible to add Modifier.animateItemPlacement() modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called Modifier.animateItem() which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I69bc9 , b/330511290 )

Изменения API

  • Adds ContextMenuColors and the associated LocalContextMenuTheme ProvidableCompositionLocal . The colors of the context menu on text fields and selectable text can be modified by providing the composition local. ( Ifa154 )
  • Text links got pressed state styling option in addition to normal styling, hovered and focused. ( I5f864 , b/139312671 )
  • Introduce ViewConfiguration.HandwritingGestureLineMargin for handwriting gestures. Support handwriting gesture for BasicTextField . ( Ie6e13 , b/325660505 )
  • Removed DelegatableNode.scrollIntoView for the 1.7 release since we didn't have time to finish stabilizing the rest of the related API surface. This function will be re-introduced in 1.8 ( I6cf61 , b/333421581 , b/332900232 )
  • When querying Layout coordinates, you may now use the excludeDirectManipulationOffset argument to exclude the offset set by parent Layouts that placed their children using Placeable.PlacementScope.withDirectManipulationPlacement . Likewise, a Layout that changes the position of its children frequently may now place them using withDirectManipulationPlacement (such as Scroll, implemented by default). This helps approachLayout based animations to be more intuitive, having now the opportunity to differentiate what offset to animate, and what to apply directly when deciding to animate their approach. ( I60ec7 )
  • Introduce requestScrollToItem for LazyStaggeredGrid . For each measure-pass, the client may now opt-out of maintaining index based on the key by calling requestScrollToItem . This does not change existing behavior in any way unless requestScrollToItem is called. ( I63983 )
  • Introduce requestScrollToPage in Pager. For each measure-pass, the client may now opt-out of maintaining index based on the key by calling requestScrollToPage . This does not change existing behavior in any way unless requestScrollToPage is called. ( Ic4213 )
  • Introduced requestScrollToItem for LazyGrids . For each measure-pass, the client may now opt-out of maintaining index based on the key by calling requestScrollToItem . This does not change existing behavior in any way unless requestScrollToItem is called. ( I0a7a0 )
  • ClickableText is marked as deprecated. To add links to the text, create an AnnotatedString with a LinkAnnotation corresponding to your link and pass this AnnotatedString to the Text composable ( I34d4b , b/323346994 )
  • UrlAnnotation is deprecated, use LinkAnnotation.Url instead. If you're using Material theming, then use TextDefaults object to create the annotation with Material theming applied to it ( I8d180 , b/323346545 )
  • String.parseAsHtml renamed to AnnotatedString.Companion.fromHtml ( I43dcd )
  • Added styling arguments ( linkStyle , focusedLinkStyle , hoveredLinkStyle ) and a link interaction listener to the parseAsHtml method. When parsing the HTML-tagged string with <a> tags, the method will construct a LinkAnnotation.Url for each such tag and pass the styling objects and link interaction listener to each annotation. ( I7c977 )
  • LinkAnnotation now takes the state-based styling arguments and a LinkInteractionListener . Add this annotation to the AnnotatedString to get a hyperlink. By passing focusedState and/or hoveredState you can define the visual configuration for links when they are focused and/or hovered. ( I81ce4 , b/139312671 )
  • The feature flag for long screenshots has been removed. ( I28648 , b/329128246 )
  • LazyColumn will now render sticky headers correctly in long screenshots. ( I8d239 , b/329296635 )
  • Stabilized majority of the remaining experimental APIs that were introduced with the new BasicTextField . ( I714e2 )
  • Added textObfuscationCharacter parameter to BasicSecureTextField that controls which character to use while obfuscating the contents. ( I0588b )
  • NestedScroll sources Drag and Fling are being replaced by UserInput and SideEffect to accommodate for the extended definition of these sources that now include animations (Side Effect) and Mouse Wheel and Keyboard ( UserInput ). ( I40579 )
  • Introduce LocalBringIntoViewSpec , a platform dependent focus scrolling behavior that is applied at the Scrollable modifier layer. ( I27aa5 , b/317453911 )
  • Removed TextFieldCharSequence . TextFieldBuffer.originalValues is replaced with TextFieldBuffer.originalText and TextFieldBuffer.originalSelection . ( I2c7d6 )
  • ImeOptions.hintLocales is no longer nullable. If you want to pass an empty Locale list, please use LocaleList.Empty . ( Ic5bc4 )
  • Renamed getOffsetFractionForPage to getOffsetDistanceInPages . ( Ia05e2 )

Исправления ошибок

  • When InputTransformations are joined with next , their KeyboardOptions are now properly merged by individual options using the new KeyboardOptions.merge method. ( Ie5304 , b/295951492 )
  • AnchoredDraggableState 's targetValue now does not consider positional thresholds anymore. It now has an implicit threshold of 50%, meaning that the targetValue changes at the midpoint between two anchors. ( I82c2c )

Внешний вклад

  • Renamed 2 scroll APIs ( I56a75 )

Version 1.7.0-alpha06

3 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha06 is released. Version 1.7.0-alpha06 contains these commits .

Новые возможности

  • Item appearance and disappearance animation support was added into LazyColumn and LazyRow . Previously it was possible to add Modifier.animateItemPlacement() modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called Modifier.animateItem() which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering. ( I2d7f7 , b/150812265 )
  • Clients of LazyColumn/LazyRow may now opt-out of maintaining an index based on the key for the upcoming measure-pass by calling a non-suspend LazyListState.requestToScroll . ( I98036 , b/209652366 )
  • Added parseAsHtml method for styled strings: it allows to convert a string marked with HTML tags into AnnotatedString . Note that not all tags are supported, for example you won't be able to display bullet lists yet. ( I84d3d )
  • Implemented experimental support for long screenshots in Compose scroll containers using the official Android API ( ScrollCaptureCallback ). This feature is experimental and may not currently handle all cases correctly. For that reason it is currently disabled by default. To opt-in, set the ComposeFeatureFlag_LongScreenshotsEnabled flag to true. This flag will be removed before 1.7 beta. ( I2b055 , b/329296471 )
  • Introduce new GraphicsLayer API to provide more flexibility in placement and rendering of GraphicsLayer instances and support intrinsic rendering features without needing to coordinate with Composable implementations to specify GraphicsLayer modifier instances.

Изменения API

  • All KeyboardOptions parameters now have an unspecified value by default. Added KeyboardOptions.merge method.
  • Renamed KeyboardOptions.autoCorrect to autoCorrectEnabled and made it nullable, where null indicates no value was specified. ( Ia8ba0 , b/295951492 )
  • Renamed outOfBoundsPageCount to beyondViewportPageCount . ( I129c6 )
  • fun ClipEntry.getMetadata() is changed to val ClipEntry.clipMetadata . ( I50155 )
  • Removed TextFieldState.valueAsFlow() . Prefer using snapshotFlow { state.text } , or snapshotFlow { TextFieldCharSequence(state.text, state.selection) } ( I7d629 )
  • Reorganized InputTransformation.transformInput parameters. Removed originalValue: TextFieldCharSequence . Instead TextFieldBuffer now carries this value with the same name. Also removed the valueWithChanges: TextFieldBuffer parameter. TextFieldBuffer now is the receiver scope on the function. ( I919cc )
  • BasicTextField(state) variant and BasicSecureTextField now use KeyboardActionHandler instead of KeyboardActions to process actions taken by the software keyboard. ( I58dda )
  • Stylus handwriting delegation APIs to support stylus handwriting on "fake" text input fields. ( I9c09c , b/327271923 )
  • Renamed KeyboardOptions.shouldShowKeyboardOnFocus to showKeyboardOnFocus . ( Ib4b7a , b/295951492 )
  • Removed hintMediaTypes parameter from Modifier.contentReceiver . Developers were already encouraged to check the received TransferableContent 's media type since it could be incompatible with the configured hintMediaTypes . ( I82f99 )
  • Reordered the parameters of BasicSecureTextField . Removed keyboardType and imeAction parameters in favor of full KeyboardOptions class while keeping the same defaults appropriate for BasicSecureTextField . Also removed the scrollState parameter. ( Ibbfa9 )
  • TextFieldState.text 's type is changed from TextFieldCharSequence to just CharSequence . Therefore, added TextFieldState.selection: TextRange and TextFieldState.composition: TextRange? to read the current selection and composition values directly from the state object.
  • Removed TextFieldState.forEachTextValue . ( Idb2a2 )
  • Removed ClipboardManager.getClipMetadata and ClipboardManager.hasClip functions. Please use clipEntry.getMetadata() to read the current clip entry's metadata. Also check ClipboardManager.getClip 's result if it's null or not to understand whether Clipboard has a current clip. ( I50498 )
  • ClipboardManager.setClip now accepts null to be able to clear the Clipboard. ( I7d2e9 )
  • ReceiveContentListener is converted to a function interface. Also Modifier.receiveContent overload that takes in a lambda is removed since ReceiveContentListener is a function interface now.
  • Modifier.receiveContent is renamed to Modifier.contentReceiver . ( I1e6af )
  • Renamed TransferableContent.consumeEach to TransferableContent.consume . ( I1e462 )
  • rememberTextFieldState has graduated to a Stable API. ( I37999 )

Исправления ошибок

  • Fixed a bug where BasicTextField(state) variant did not work with CJK(composition based) keyboards. ( I54425 )
  • Fixed a bug where Modifier.dragAndDropTarget() could reference stale data in certain scenarios with Modifier.Node re-use. ( I05bb1 )
  • Reverted a recent contract change where AnchoredDraggableState#anchoredDrag calls would snap at the end of an anchoredDrag operation. ( I95715 )

Version 1.7.0-alpha05

20 марта 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha05 is released. Version 1.7.0-alpha05 contains these commits .

Изменения API

  • Removed experimental LocalTextLinkStyle composition local for styling hyperlinks. ( Iebfa7 )
  • Removed experimental override of BasicText with onLinkClicked argument. A replacement API for hyperlinks support will follow in the future. ( I107d5 )
  • Removed Codepoints related methods and properties under TextFieldState and TextFieldBuffer . Also removed the inChars suffixes from the remaining selection and composition related APIs. ( Ief7ce )
  • AnchoredDraggable 's currentValue will now update when passing through an anchor point. Use settledValue to receive the previous currentValue semantics, only updating when settling at an anchor. The progress is now exposed as a function (requiring a starting and end point) instead of a property. ( Ibe6e8 , b/318707189 , b/298271489 , b/294991954 )
  • BasicTextField(state) , TextFieldState , InputTransformation , OutputTransformation , TextFieldLineLimits , TextFieldDecorator are graduated to stable. ( I9582b )
  • Introduced InterceptPlatformTextInput for helping write low-level IME-related tests and other low-level IME use cases. PlatformTextInputTestOverride has been deprecated. ( I862ed , b/322680547 )
  • Split restrictedConstraints() to two methods: fitPrioritizingWidth() and fitPrioritizingHeight() ( I6d7fd )

Внешний вклад

  • Added 2 new API isLastScrollForward / isLastScrollBackward to check scroll direction for latest scroll action, return false if no scroll action yet. ( I63a0e )

Version 1.7.0-alpha04

6 марта 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha04 is released. Version 1.7.0-alpha04 contains these commits .

Изменения API

  • Support stylus handwriting feature on devices after Android U. ( I002e4 )
  • Added hintLocales to KeyboardOptions to provide TextFields with the ability to hint IMEs with specific locales to preset a preferred language. ( Id18c2 )
  • Removed the Experimental BasicTextField2 and BasicSecureTextField overloads that took value: String and onValueChange: () -> String parameters. ( I568b4 )
  • Add an optional applySemantics function to InputTransformation to influence the semantics of the BasicTextField2 that it's applied to. ( I74a2f , b/170648072 )
  • In this CL we are adding the GetScrollViewportLength semantic action so we can pipe up information about the components being scrolled in compose to the a11y system. This CL also applies the usage of said property in Foundation Scrollable Lists. ( Ic5fa2 )
  • BasicTextField2 is renamed to BasicTextField . ( Ie5713 )
  • FocusRequester.createRefs is now stable ( I4d92c , b/261436820 )
  • Introduced DelegatableNode.scrollIntoView() to allow modifier nodes to make scrollIntoView requests directly. ( I2b3b7 , b/299939840 )
  • Introduced DelegatableNode.requireView() to allow modifier nodes to get the current Android View without reading a composition local. ( I40768 )
  • Introducing contextual layout information within Contextual Flow Row Scope and Contextual Flow Column Scope, featuring line index, position, and constraints on maximum width and height to stay in specified position. Items exceeding maximum width/height may flow to the next line or be omitted based on overflow settings. ( Id13f8 , b/292114798 )

Исправления ошибок

  • Fixed a bug where in certain conditions toggling enabled or readOnly attributes of TextField would cause a crash. ( Iae17b )

Version 1.7.0-alpha03

21 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha03 is released. Version 1.7.0-alpha03 contains these commits.

Изменения API

  • Introduced DelegatableNode.requireLayoutCoordinates() as a way to get a Modifier.Node 's current LayoutCoordinates without needing to override onPlaced and store the coordinates in a property yourself. ( Ia8657 )
  • Introduced DelegatableNode.currentLayoutCoordinates as a way to get a Modifier.Node 's current LayoutCoordinates without needing to override onPlaced and store the coordinates in a property yourself. ( Iaebaa )
  • Performance optimizations in DraggableAnchors used by AnchoredDraggable . ( I89cff )
  • BasicTextField2 and related APIs under androidx.compose.foundation.text2 package are moved to androidx.compose.foundation.text . ( I9f635 )
  • BasicTextField2 no longer accepts a CodepointTransformation parameter. Use BasicSecureTextField or OutputTransformation . ( Id34ff )
  • Added method to compare only the annotations of two AnnotatedStrings . ( I32659 )
  • Introducing ContextualFlowRow and Enhanced FlowRow / Column with MaxLines and Overflow . We are excited to announce enhancements to the experimental FlowRow and FlowColumn , now featuring maxLines and overflow support, alongside the debut of ContextualFlowRow and ContextualFlowColumn . This update is designed to provide performance optimal components, where ContextualFlow* is perfect for a large number of items making use of a small maxLines config and dynamic +N see more buttons, and FlowRow and FlowColumn is perfect for a small number of items, less than 100 items. Important: To maintain existing behavior in FlowRow or FlowColumn where all items are composed regardless of if they fit the cross axis max, set overflow to FlowRowOverflow.Visible or FlowColumnOverflow.Visible during initialization. Explore ContextualFlowRowSample and FlowRowSample for examples of these new features in action. ( Ib9135 , b/293577082 )

Исправления ошибок

  • Cursor animation no longer requests frames between on and off states. ( Ia2253 )
  • KeyboardOptions ' deprecated copy constructors will now correctly copy all properties. ( If12de )

Version 1.7.0-alpha02

7 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha02 is released. Version 1.7.0-alpha02 contains these commits.

Изменения API

  • HorizontalPager , VerticalPager and PagerState are promoted to stable. ( I67660 , b/316966909 )
  • Added LocalTextLinkStyle composition local that allows to change the style of the links in Text across the app. If you're using your own theme in the app, you should be setting this composition local according to your theming. When using Material theme the color of the link by default will be set to Material's primary color. ( I7eb10 )
  • Introduced receiveContent modifier that provides developers with a way to receive rich content in Jetpack Compose.
  • receiveContent integrates with BasicTextField2 to accept rich content provided by the software keyboard, or via Clipboard paste action. ( I81b72 )
  • In this change we're replacing SnapFlingBehavior with TargetedFlingBehavior in pager to unlock other use cases and provide greater flexibility. ( I762ea )
  • In this change we're making Snapping APIs Stable. We're also cleaning up some of the testing code and adding more samples to Snapping. ( Id8da9 )
  • Introduce TargetedFlingBehavior , a FlingBehavior that allows propagating information about the state of the ongoing animation and it's target scroll offset. ( I6a207 )

Исправления ошибок

  • BasicTextField2 now keeps the cursor in view while typing when it has been scrolled out of view or would move out of view due to input. ( Ieb856 , b/237190748 )

Внешний вклад

  • Adds an experimental API for configuring prefetch behavior of LazyLists. ( I022a4 )

Version 1.7.0-alpha01

24 января 2024 г.

androidx.compose.foundation:foundation-*:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.

Новые возможности

  • Added a new Indication API , IndicationNodeFactory . This leads to more performant Indication implementations compared to the previous (now deprecated) rememberUpdatedInstance API. For migration information, see developer.android.com .
  • clickable / combinedClickable / selectable / toggleable now accepts a nullable MutableInteractionSource parameter. If null, and the provided Indication is an IndicationNodeFactory , the Indication can be lazily created only when needed, which improves performance. If you are not hoisting and using the MutableInteractionSource , it is recommended to pass null.

Изменения API

  • Introduce DecayAnimation in AnchoredDraggable , this change adds a decayAnimationSpec parameter to AnchoredDraggable allowing to use decay animation when settling to one of the anchors. The change also includes renaming the existing animationSpec to snapAnimationSpec to help understanding the use case of each spec.
  • BasicTextField2 is available for experimental use. It should be roughly at feature parity with BasicTextField , and behavior should be production-ready. However, the API remains experimental for now. Before stabilizing, it will be renamed to BasicTextField and moved into the same package.
  • Introduced the first draft of the OutputTransformation API for BasicTextField2 . This API replaces most of the use cases of VisualTransformation in the old BasicTextField . However it is not complete yet, and some things won't work correctly, but we'd appreciate any feedback on the API usability for your use cases. ( aosp/2708848 )
  • Introduced LinkAnnotation that allows to add links and clickables into text. Links feature is not complete yet and more API changes are coming.
  • Introduced receiveContent modifier that provides developers with a way to receive rich content in Jetpack Compose.
  • receiveContent integrates with BasicTextField2 to accept rich content provided by the software keyboard, or via paste from Clipboard.
  • KeyboardOptions.shouldShowKeyboardOnFocus allows you to disable the default behavior of BasicTextField of requesting a software keyboard on focus.
  • TextInputService and LocalTextInputService are now deprecated. Use PlatformTextInputModifierNode to integrate directly with platform IME APIs instead. ( aosp/2862698 )
  • Indication#rememberUpdatedInstance has been deprecated. It has a high unavoidable performance penalty, and prevents other optimizations. Instead, you should use the new IndicationNodeFactory API.

Исправления ошибок

  • BasicTextField will now pre-validate a small selection of offset mappings when VisualTransformation is passed. This helps catch common coding errors that lead to unrecoverable exceptions in later measure or draw passes. By throwing during composition, it is more likely developers will see these errors during development helping avoid production crashes. ( I0fd42 )
  • VisualTransformation will not throw if you return an invalid index for an invalid index ( b/316401857 )

Version 1.6

Version 1.6.8

12 июня 2024 г.

androidx.compose.foundation:foundation-*:1.6.8 is released. Version 1.6.8 contains these commits .

Version 1.6.7

1 мая 2024 г.

androidx.compose.foundation:foundation-*:1.6.7 is released. Version 1.6.7 contains these commits .

Version 1.6.6

17 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.6.6 is released. Version 1.6.6 contains these commits .

Исправления ошибок

  • Fixed a bug where in certain conditions toggling enabled or readOnly attributes of TextField would cause a crash. ( Iae17b )

Version 1.6.5

3 апреля 2024 г.

androidx.compose.foundation:foundation-*:1.6.5 is released. Version 1.6.5 contains these commits .

Исправления ошибок

Version 1.6.4

20 марта 2024 г.

androidx.compose.foundation:foundation-*:1.6.4 is released. Version 1.6.4 contains these commits .

Исправления ошибок

  • A long-press-then-drag selection gesture which moves out of the text's layout bounds in the first frame of the drag no longer crashes. ( Icdf90 , b/325307463 )

Версия 1.6.3

6 марта 2024 г.

androidx.compose.foundation:foundation-*:1.6.3 is released. Version 1.6.3 contains these commits .

Version 1.6.2

21 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.6.2 is released. Version 1.6.2 contains these commits.

Исправления ошибок

  • Fix AnimateContentSize not resetting properly. ( I07051 )
  • Fix issue where intrinsicHeight of text would be over-cached in some circumstances. ( 3cd398 , b/217910352 )

Version 1.6.1

7 февраля 2024 г.

androidx.compose.foundation:foundation-*:1.6.1 is released. Version 1.6.1 contains these commits.

Исправления ошибок

  • Fix staggered grid measure when scrolled over limit. ( bffc39 )
  • Add check for layout with large dimensions. ( e74af5 )
  • Fix placement of 0-sized items at the start of the staggered grid. ( 785f94 )
  • Call onRelease callback in the same order as onForgotten. ( 31ce3b )

Version 1.6.0

24 января 2024 г.

androidx.compose.foundation:foundation-*:1.6.0 is released. Version 1.6.0 contains these commits.

Important changes since 1.5.0

  • New Modifier Modifier.anchoredDraggable that unlocks the ability to drag and animate between predefined set of anchors. This modifier is intended to be a replacement for Modifier.swipeable . Learn how to use it and migrate from Modifier.swipeable in the migration guide .
  • Drag and drop functionality between apps and components has been added. Refer to DragAndDropTarget , Modifier.dragAndDropSource and other APIs to get started
  • Modifier.draggable2D is the new modifier that allows for easy 2d dragging support. See Sample .
  • AndroidExternalSurface and AndroidEmbeddedExternalSurface have been added to make it easier to add surface-driven components in compose
  • Various API changes and improvements in Pager and snapFlingBehaviour
  • Various focus, text and insets APIs have been promoted to stable APIs

Version 1.6.0-rc01

10 января 2024 г.

androidx.compose.foundation:foundation-*:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.

Изменения API

  • The DragAndDropTarget() extension constructor has been removed. Create a new instance using object: DragAndDropTarget {} . ( I32318 )

Version 1.6.0-beta03

13 декабря 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta03 is released. Version 1.6.0-beta03 contains these commits.

Исправления ошибок

  • Fix crash that impacted very large text measured with infinite constraints. ( I1a7df , b/312294386 )
  • PlatformImeOptions is now a concrete class instead of an interface. ( If40a4 )

Version 1.6.0-beta02

29 ноября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta02 is released. Version 1.6.0-beta02 contains these commits.

Исправления ошибок

  • Fix for canScroll not being updated after relayout-only scroll. ( I60a86 )
  • Fix for Modifier.animateItemPlacement() and LookaheadScope after small scrolls. ( I3a2b7 )

Version 1.6.0-beta01

15 ноября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.

Изменения API

  • The DragAndDropTarget modifier now takes in the receiving DragAndDropTarget explicitly and has a lambda to opt into a drag and drop session. There are now two factory functions for a DragAndDropModifierNode . One for receiving transfers and one for transferring data ( I69481 )
  • Updated maximumFlingVelocity to be represented as Float. Updated documentation to be more clear about the maximumFlingVelocity unity. ( I8adc7 )
  • onDragAndDropStart in the DragAndDropModifierNode factory has been renamed to acceptDragAndDropTransfer .

    acceptsDragAndDropTransfer has been added to the dragAndDropTarget Modifier to accept from a drag and drop session. This lambda returns a viable DragAndDropTarget if interested in a drag and drop session. Other lambdas for processing drag events have been replaced by this.

    a DragAndDropTarget factory function has been added to receive from drag and drop sessions ( Iebf3a )

  • Exposing startDragImmediately in AnchoredDraggable gives control for detecting dragging gestures when using it. It is useful to set it when the widget is animating to a target anchor. See Sample . ( Ie6d13 , b/285139987 )

  • Foundation Tooltip APIs are now @ExperimentalFoundationApi ( I30b0b )

  • Removed DragAndDropInfo as a type DragAndDropModifierNode.drag now takes parameters for the transferData , decoration size and drag decoration DrawScope lambda

    DragAndDropTarget has methods for particular drag and drop events instead of being a single abstract method

    onDragAndDropEvent in the factory function for a DragAndDropModifierNode has been renamed to onDragAndDropStart to better communicate that the DragAndDropTarget provided is valid for a given drag and drop session only

    The DragAndDropEventType has been removed ( I645b1 )

  • Renamed PlatformTextInputModifierNode.runTextInputSession to establishTextInputSession . ( I03cd0 )

  • Replace OriginalText by TextSubstitution . ( Ifa5a8 )

  • Renamed PlatformTextInputModifierNode.textInputSession to runTextInputSession . ( Ie9c6b )

  • The children of SubcomposeLayout (and layouts like LazyColumn based on it) which are retained to be reused in future are considered deactivated. New assertIsDeactivated() test API was introduced to test such nodes. The rest of the test apis will filter out deactivated nodes by default. ( I2ef84 , b/187188981 )

  • clippingEnabled parameter of Modifier.magnifier is renamed to clip .

  • magnifierCenter parameter of Modifier.magnifier is made nullable preserving the same default behavior. ( I6aa66 )

  • Material SwipeToReveal APIs (for Cards and Chips) now rely on a slot based API (as recommended by Compose) instead of data class based instances to create those slots. This is a breaking change, please see the demo and sample code for examples on how to use the new API. ( Ia8943 )

Исправления ошибок

  • Implement equals and hashcode for PageSize.Fixed . ( Ie3ede , b/300134276 )
  • Fixed a bug that would cause BasicText layout to not shrink when minWidth changed and minWidth less than initial measure constraints maxWidth ( Idb19c )
  • Add renderer support for Sweep Gradient in ArcLine . ( I4d5bb )
  • Fix binary compatibility issue with Window Inset change ( Iee695 )
  • Remove material core layer for Material3 Chip/Button as the microbenchmarks show better performance without it. ( I55555 )

Version 1.6.0-alpha08

18 октября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha08 is released. Version 1.6.0-alpha08 contains these commits.

Новые возможности

  • Modifier.draggable2D is the new modifier that allows for easy 2d dragging support. See Sample ( Id95f5 , b/214412658 )

Изменения API

  • Modifier.dragAndDrawSource has had the onDrawDragShadow lambda renamed to drawDragDecoration and DragAndDropInfo has had the size parameter renamed to dragDecorationSize . ( Id0e30 , b/303904810 )
  • BasicTextField2 's decorationBox parameter is renamed to decorator . Its type is also changed to an equivalent fun interface TextFieldDecorator . ( I23c1c )

Исправления ошибок

  • Improved documentation on BasicTextField regarding onValueChange requirements. ( I90fc9 , b/160257648 )

Version 1.6.0-alpha07

4 октября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha07 is released. Version 1.6.0-alpha07 contains these commits.

Изменения API

  • Introduced PlatformTextInputMethodTestOverride for writing tests for custom text editors. ( Id159b )
  • Renamed GraphicsSurface to AndroidExternalSurface ( I11680 )
  • Added DisableNonLinearFontScalingInCompose temporary flag to disable non-linear font scaling. Set DisableNonLinearFontScalingInCompose = true in your tests if you need time to clean them up. This flag will be removed in Compose 1.6.0-beta01. ( Ic9486 )
  • Added ColorList and ColorSet collections that avoid allocations. ( I744bd )
  • This change removes shortSnapVelocityThreshold which has been turned into an implementation detail of the implementations of SnapLayoutInfoProvider . ( I65f6d )
  • Adds dragAndDropSource Modifier for starting drag and drop sessions, and dragAndDropTarget Modifier for receiving from drag and drop sessions ( Ib7828 , b/286038936 )
  • Update SnapPositionInLayout documentation and position method. Introduce content paddings to the position method in SnapPositionInLayout . ( Id7938 , b/300116110 )
  • Added UndoState to TextFieldState that provides the ability to undo/redo the changes made by the user. ( Icc024 )

Исправления ошибок

Version 1.6.0-alpha06

20 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha06 is released. Version 1.6.0-alpha06 contains these commits.

Новые возможности

  • New Composable wrappers for SurfaceView and TextureView: GraphicsSurface() and EmbeddedGraphicsSurface() . It is an experimental API and is subject to changes and modifications. ( I9ddb2 )
  • Modifier.magnifier() is now a stable API. This includes the removal of MagnifierStyle in favor of inline parameters in the modifier itself. ( I83bec , b/298381260 , b/262367109 , b/261438887 )

Изменения API

  • Introduced updateCurrentPage and updateTargetPage in ScrollScope , these are the last pieces necessary to allowing customization of animated scroll through PagerState.scroll . ( I9cad5 , b/267744105 , b/243786897 )
  • Remove density from SnapFlingBehavior . All implementations of SnapLayoutInfoProvider already have a way of accessing the density, the receiver scope could be removed which will lead to a less complex implementation of both SnapFlingBehavior and SnapLayoutInfoProviders . ( I153c3 )
  • More modifiers marked as stable. ( I56af1 , b/298046462 )
  • Removed SnapStepSize from SnapLayoutInfoProvider . The calculation should be done using the Layout information and provided through the approach or snapping offsets. ( If320c )

Behavior Changes

  • 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 )

Исправления ошибок

Version 1.6.0-alpha05

6 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha05 is released. Version 1.6.0-alpha05 contains these commits.

Изменения API

  • Add overloads for BasicSecureTextField that accept an immutable value and a callback to change that value, just like the current BasicTextField API. ( Ia4882 )
  • Add Modifier.preferKeepClear() to mark as composable as preferring to keep clear of floating windows on API 33 and above. ( Ib51d5 , b/297260115 )
  • Fling velocities in View components like ScrollView and RecyclerView are capped at ViewConfiguration.ScaledMaximumFlingVelocity . Compose now contains its own version of maximumFlingVelocity which now applies to Draggable . ( Ibf974 )
  • Removed deprecated Pager and PagerState overloads. ( Iea07e )
  • Added BasicTooltipBox to compose.foundation and updated PlainTooltipBox and RichTooltipBox to use TooltipBox with new PlainTooltip and RichTooltip composables. ( I79e1d )

Version 1.6.0-alpha04

23 августа 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha04 is released. Version 1.6.0-alpha04 contains these commits.

Изменения API

  • Add ReusableComposition interface for managing lifecycle and reuse of subcompositions. ( I812d1 , b/252846775 )
  • Modifier.focusGroup has been promoted to stable APIs. ( I7ffa3 )
  • Add overloads for BasicTextField2 that accept an immutable value and a callback to change that value, just like the current BasicTextField API. ( I3f2b8 )
  • GridItemSpan::currentLineSpan is now a stable API. ( Icc29c )
  • Canvas that accepts contentDescription is now a stable API. ( Ib3d29 )
  • Introduced viewportSize in ScrollState , a way of knowing the viewPort size of the component that uses ScrollState after measuring happens. ( I8b85a , b/283102682 )
  • Fixed an issue where the prefetching in Pager did not match the behavior in Views. ( I93352 , b/289088847 )
  • Modifier.consumeWindowInsets(PaddingValues) is now stable.
    • Deprecated Modifier.consumedWindowInsets API is now removed. Use Modifier.consumeWindowInsets instead. ( Id72bb )

Version 1.6.0-alpha03

9 августа 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.

Изменения API

  • Overload of LazyLayout added, it accepts a lambda of LazyLayoutItemProvider , not a plain object as it was before. The previous overload is deprecated. ( I42a5a )
  • Added support for configuring privateImeOptions ( Idb772 )

Исправления ошибок

  • Fixed text fields showing keyboard and being editable when readOnly is true. Also fixed the keyboard not showing when readOnly is changed from true to false while focused. ( I34a19 , b/246909589 )

Version 1.6.0-alpha02

26 июля 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.

Изменения API

  • Introduced PagerLayoutInfo with information collected after a measure pass in Pager . Also introduced PageInfo , the information about a single measured Page in Pager . ( Iad003 , b/283098900 )
  • Additional annotations to specify allowed inputs to composables ( I51109 )
  • Added SemanticsNodeInteraction.requestFocus as a more convenient and discoverable way to request focus in tests. ( Ie8722 )
  • Completely redesigned PlatformTextInput* API. ( I6c93a , b/274661182 , b/267235947 , b/277380808 )
  • SoftwareKeyboardController and LocalSoftwareKeyboardController are no longer experimental. LocalSoftwareKeyboardController is also now a proper CompositionLocal . ( I4c364 )
  • Modifier.transformable now provides pan delta in canPan parameter to help determine the direction of the pan to allow or disallow it. ( I692aa , b/266829800 )
  • Updates the modifier consumeWindowInsets to extend the superclass AbstractComposeView ( Iacd74 , b/269479941 )

Version 1.6.0-alpha01

21 июня 2023 г.

androidx.compose.foundation:foundation-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.

Новые возможности

  • Introduced a new AnchoredDraggable API in Foundation. It can be used to build components that can be dragged between discrete states, like modal bottom sheets. This API replaces Material's Swipeable API. ( I4a2ed )

Изменения API

  • Support InputConnection#requestCursorUpdates ( I0c69b )
  • Introduced scrollAnimationSpec to allow custom animation specs. Updated BringIntoViewCalculator to BringIntoViewScroller . ( Idb741 )
  • Add ResourceResolutionException type to wrap throwables thrown when attempting to load bitmap assets with a description of the asset path that failed to load. ( I19f44 , b/230166331 , b/278424788 )
  • Added semantics properties and actions to support text translation. ( I4a6bc )
  • Introduced a BringIntoViewCalculator API that can be used to customize how components like Scrollable respond to bringIntoView requests. Changed the overload of scrollable to optionally accept an instance of BringIntoViewCalculator . ( Iaf5af )

Исправления ошибок

  • Added a lint check to warn if you are creating a MutableInteractionSource in composition without remembering it, similar to the lint checks for creating mutable state / Animatable . ( I5daae )
  • Added support for selection by mouse. Touch based selection will expand by word, and shrink by character. ( Ic0c6c , b/180639271 )
  • Added FocusTargetModifierNode interface that can be used to create a custom FocusTarget . ( I9790e )

Версия 1.5

Версия 1.5.4

18 октября 2023 г.

androidx.compose.foundation:foundation-*:1.5.4 is released. Version 1.5.4 contains these commits.

Версия 1.5.3

4 октября 2023 г.

androidx.compose.foundation:foundation-*:1.5.3 is released. This version has no changes.

Version 1.5.2

27 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.5.2 is released. Version 1.5.2 contains these commits.

Исправления ошибок

  • Fixed a bug in text that led to crashes in certain circumstances when semantics were invalidated.

Version 1.5.1

6 сентября 2023 г.

androidx.compose.foundation:foundation-*:1.5.1 is released. Version 1.5.1 contains these commits.

Исправления ошибок

  • Fixed text fields showing keyboard and being editable when readOnly is true. Also fixed the keyboard not showing when readOnly is changed from true to false while focused. ( I34a19 , b/246909589 )

Version 1.5.0

9 августа 2023 г.

androidx.compose.foundation:foundation-*:1.5.0 is released. Version 1.5.0 contains these commits.

Important changes since 1.4.0

  • Many foundational modifiers, including Modifier.clickable , Modifier.draggable , Modifier.scrollable , layout modifier and more have been migrated to Modifier.Node API, reducing the overhead on the initial composition.
  • Improvements in Pagers stability. Many bugs have been addressed.
  • pageCount parameters now lives in PagerState instead of the Pager itself

Version 1.5.0-rc01

26 июля 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.

Исправления ошибок

  • An optional inspection to recommend migrating mutableStateOf() calls to their corresponding specialized types for primitives is available. Its lint ID is AutoboxingStateCreation . Previously, this inspection was enabled by default for all projects. To see this warning in Android Studio's editor and your project's lint outputs, change its severity from informational to warning (or higher) by declaring warning "AutoboxingStateCreation" inside your module's build.gradle or build.gradle.kts configuration as shown ( I34f7e ):

        android {
            lint {
                warning "AutoboxingStateCreation"
            }
            ...
        }
    

Version 1.5.0-beta03

28 июня 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta03 is released. Version 1.5.0-beta03 contains these commits.

Version 1.5.0-beta02

7 июня 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.

Версия 1.5.0-бета01

24 мая 2023 г.

androidx.compose.foundation:foundation-*:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.

Изменения API

  • Implement PlatformDataProvider to provide heart rate and daily steps. SensorGateway interface is removed from the public API. ( I55b84 )

Исправления ошибок

  • Reduce allocations during lazy list/grids/etc. measurements ( Iaf9e2 )
  • Reduced allocations when applying snapshots ( I65c09 )
  • Removed allocations from spring animations ( Ie9431 )
  • Removed allocation from TextLayout ( I0fd11 )
  • Removed multiple allocations in pointer velocity tracking ( I26bae )

Версия 1.5.0-альфа04

10 мая 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha04 and androidx.compose.foundation:foundation-layout:1.5.0-alpha04 are released. Version 1.5.0-alpha04 contains these commits.

Изменения API

  • Added optimized TextStyle.merge(...) with full parameter list. ( Iad234 , b/246961787 )
  • Introduce a SnapLayoutInfoProvider that can be used with LazyGridState . ( I92134 , b/269237141 , b/260914964 )
  • Experimental Modifier.animateItemPlacement() was added for the lazy staggered grids item scope. You can apply it on the items in order to achieve the automation position change/reordering animations. ( I4b62d , b/257034719 )
  • Promote GridCells.FixedSize to stable. FixedSize defines a LazyGrid where each cell takes exact size on cross axis, with the remaining space distributed by cross axis arrangement. ( I8542f )
  • Introduced receiver scope PagerScope for Pager and an utility function for calculation a given page offset. ( If2577 )
  • Introduce the snapPositionalThreshold when creating a snap fling behavior. Use this parameter to specify a positional threshold to short snapping in Pager. ( If8f7f )
  • Replaced SnapLayoutInfoProvider.calculateSnappingOffsetBounds with calculateSnappingOffset . In this new method we simply request the next offset to snap to. The calculation of the bounds should be performed at the implementation level as this may differ depending on how one needs snapping to happen. ( I923a4 )
  • LazyStaggeredGrid APIs have been promoted to stable. ( I633a5 )
  • Remove pageCount from Horizontal/VerticalPager . This should be provided at the state creation. Updated PagerState and rememberPagerState to accept the pageCount . ( Ieb52d , b/266965072 )
  • Remove pageCount from Horizontal/VerticalPager . This should be provided at the state creation. Updated PagerState and rememberPagerState to accept the pageCount . ( Ifa3cb , b/266965072 )
  • Introduce shortSnapVelocityThreshold in Pager's SnapFlingBehavior . ( I7379e , b/275579012 )
  • Adds a FlowRowScope and FlowColumnScope . ( I54fe2 )

Исправления ошибок

  • Calls to get semantics on Text when constraints have minWidth and minHeight no longer crash. ( Ibd072 )
  • Fixed regression where keyboard wasn't showing for text fields inside dialogs not created by the Dialog composable. ( I82551 , b/262140644 )

Версия 1.5.0-альфа03

19 апреля 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha03 and androidx.compose.foundation:foundation-layout:1.5.0-alpha03 are released. Version 1.5.0-alpha03 contains these commits.

This release enables the new text rendering stack for Compose. The new stack is performance optimized, and you should see no visible changes.

If you do see changes in rendered text, you can debug by setting NewTextRendering1_5 = false to confirm the behavior difference. Setting this will force recomposition. Please file any behavior differences as bugs.

The debug flag will be removed before the 1.5 beta01 release.( Iada23 , b/246960758 )

Изменения API

  • Make FlowColumn/FlowRow inline. ( Idab37 )

Версия 1.5.0-альфа02

5 апреля 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha02 and androidx.compose.foundation:foundation-layout:1.5.0-alpha02 are released. Version 1.5.0-alpha02 contains these commits.

Изменения API

  • Added support for fixed size cells in LazyGrid and arranging them with cross axis arrangement. ( I83ed9 , b/235121277 , b/267942510 )
  • Added support for fixed size lanes in LazyStaggeredGrid and arranging them with cross axis arrangement. ( I7d519 )
  • UrlAnnotation s in AnnotatedString s can now be opened via accessibility services like TalkBack . ( If4d82 , b/253292081 )
  • Added the InsertTextAtCursor semantics action for text fields. ( I11ed5 )
  • Text-related test actions (eg performTextInput ) will now request focus directly, using the semantics action, instead of clicking on the field. ( I6ed05 )
  • Adds support for cross axis spacing/arrangement using the verticalArrangement in FlowRow and horizontalArrangement in FlowColumn . We also remove the top-level verticalAlignment and horizontalAlignment in FlowRow/FlowColumn . Developers can use Modifier.align instead. This reduces confusion between the naming conventions of verticalAlignment and verticalArrangement . ( I87b60 , b/268365538 )

Версия 1.5.0-альфа01

22 марта 2023 г.

androidx.compose.foundation:foundation:1.5.0-alpha01 and androidx.compose.foundation:foundation-layout:1.5.0-alpha01 are released. Version 1.5.0-alpha01 contains these commits.

Изменения API

  • Text and BasicText is refactored to use the new modifier system. This leads to substantial performance improvements in many cases. No changes should be visible. ( If1d17 , b/246961435 )
  • Added the PerformImeAction semantics action to invoke the IME action on text editor nodes. ( Ic606f , b/269633506 )

Исправления ошибок

  • Updated internals of Modifier.hoverable . The hoverable modifier will only be shown in the inspector if it is enabled. ( I82103 )

Версия 1.4

Версия 1.4.3

3 мая 2023 г.

androidx.compose.foundation:foundation:1.4.3 and androidx.compose.foundation:foundation-layout:1.4.3 are released with no changes (only a version bump).

Версия 1.4.2

19 апреля 2023 г.

androidx.compose.foundation:foundation:1.4.2 and androidx.compose.foundation:foundation-layout:1.4.2 are released. Version 1.4.2 contains these commits.

Версия 1.4.1

5 апреля 2023 г.

androidx.compose.foundation:foundation:1.4.1 and androidx.compose.foundation:foundation-layout:1.4.1 are released. Version 1.4.1 contains these commits.

Версия 1.4.0

22 марта 2023 г.

androidx.compose.foundation:foundation:1.4.0 and androidx.compose.foundation:foundation-layout:1.4.0 are released. Версия 1.4.0 содержит эти коммиты.

Важные изменения с версии 1.3.0

  • Added Emoji compat integration to Text and TextField , as well as the lower level Paragraph. It is enabled by default when emojicompat is configured.
  • EmojiCompat can be configured on a specific Text using PlatformParagraphStyle .
  • Added full line span support to LazyStaggeredGrid (I28252)
  • Adding experimental onHover to ClickableText (I6938f)
  • Introduced new experimental overloads for the runComposeUiTest function and create*ComposeRule functions that accept CoroutineContext parameters. The context will be used for the test composition and any LaunchedEffect and rememberCoroutineScope() calls in the composition. ( I10614 , b/265177763 )
  • FlowRow and FlowColumn are now available as @ExperimentalFoundationApi that allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 )
  • Modifier.basicMarquee() is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )

Версия 1.4.0-rc01

8 марта 2023 г.

androidx.compose.foundation:foundation:1.4.0-rc01 and androidx.compose.foundation:foundation-layout:1.4.0-rc01 are released. Версия 1.4.0-rc01 содержит эти коммиты.

Изменения API

  • Introduced new low-level PlatformTextInputAdapter API for building custom text input implementations that talk directly to platform APIs. ( I58df4 )
  • Add support for reverse layout to LazyStaggeredGrid . ( I3ef4a )

Исправления ошибок

  • BasicTextField 's SetText semantics action will now update the text buffer using the same code path as IME updates and the testing functions (eg performTextReplacement ).
  • Text testing functions performTextClearance , performTextReplacement , and performTextSelection now use SemanticsActions . ( I0807d , b/269633168 , b/269624358 )

Версия 1.4.0-бета02

22 февраля 2023 г.

androidx.compose.foundation:foundation:1.4.0-beta02 and androidx.compose.foundation:foundation-layout:1.4.0-beta02 are released. Версия 1.4.0-beta02 содержит эти коммиты.

Изменения API

  • Added a new Modifier.Node.onReset() callback allowing you to reset some local state to properly handle the case when the Layout will be reused (for example as an item of LazyColumn ). Fixed FocusTargetModifierNode to properly reset the focused state. ( I65495 , b/265201972 )
  • Added BlendMode parameter to DrawScope.drawText , Paragraph.paint , and MultiParagraph.paint methods to support different blending algorithms when drawing text on Canvas. ( I57508 )
  • Removed the modifierElementOf() API. Please extend from ModifierNodeElement directly instead. ( Ie6d21 )

Исправления ошибок

  • Adjusting selection handles can no longer select a partial character. ( Idedd1 )
  • Fix crash when ctrl+backspace on empty TextField ( I0427f , b/244185537 )

Версия 1.4.0-бета01

8 февраля 2023 г.

androidx.compose.foundation:foundation:1.4.0-beta01 and androidx.compose.foundation:foundation-layout:1.4.0-beta01 are released. Версия 1.4.0-beta01 содержит эти коммиты.

Новые возможности

  • Since 1.3, added Emoji compat integration to Text and TextField , as well as the lower level Paragraph. It is enabled by default when emojicompat is configured.
  • EmojiCompat can be configured on a specific Text using PlatformParagraphStyle .

Изменения API

  • Added common implementation of PinnableContainer API used in all LazyLayouts to retain items that exit composition, but still need to be active. ( If45a4 )
  • PinnableContainer.PinnedHandle.unpin() was renamed to release() ( I4667a )

Внешний вклад

  • Added mainAxisItemSpacing property to LazyListLayoutInfo , LazyGridLayoutInfo and LazyStaggeredGridItemInfo ( I52fad )

Version 1.4.0-alpha05

25 января 2023 г.

androidx.compose.foundation:foundation:1.4.0-alpha05 and androidx.compose.foundation:foundation-layout:1.4.0-alpha05 are released. Version 1.4.0-alpha05 contains these commits.

Новые возможности

  • Added full line span support to LazyStaggeredGrid ( I28252 )
  • Adding experimental onHover to ClickableText ( I6938f )
  • Introduced new experimental overloads for the runComposeUiTest function and create*ComposeRule functions that accept CoroutineContext parameters. The context will be used for the test composition and any LaunchedEffect and rememberCoroutineScope() calls in the composition. ( I10614 , b/265177763 )

Изменения API

  • Merges the pre/post APIs of OverscrollEffect into combined 'decorator' applyToScroll and applyToFling functions. See the updated samples in the documentation for examples of how to implement an overscroll effect with the new API shape. ( I8a9c4 , b/255554340 )
  • More type/nullability of inline/deprecated-hidden functions ( I24f91 )
  • LineBreak and Hyphens APIs in TextStyle are graduated to stable. ( Ic1e1d )

Исправления ошибок

  • The cursor in text fields will now continue to blink even when animations are disabled. ( I95e70 , b/265177763 )
  • Modifier.basicMarquee now animates even when animations are disabled in the system settings. ( I23389 , b/262298306 , b/265177763 )

Внешний вклад

  • notifyFocusedRect methods in TextInputSession and TextInputService are not deprecated again. ( I23a04 , b/262648050 )

Version 1.4.0-alpha04

11 января 2023 г.

androidx.compose.foundation:foundation:1.4.0-alpha04 and androidx.compose.foundation:foundation-layout:1.4.0-alpha04 are released. Version 1.4.0-alpha04 contains these commits.

Новые возможности

  • FlowRow and FlowColumn are now available as @ExperimentalFoundationApi that allow for a more flexible row and column based layout of components that will break to a new line if there is not enough space on the main axis. ( I3a7b2 )
  • Modifier.basicMarquee() is available as experimental for displaying content with a scrolling marquee effect. ( I2df44 , b/139321650 )

Изменения API

  • FocusRequesterModifier is deprecated in favor of FocusRequesterNode ( I7f4d7 , b/247708726 , b/255352203 , b/253043481 , b/247716483 , b/254529934 , b/251840112 , b/251859987 , b/257141589 )
  • AndroidFont constructor with variationSettings is now a stable API, and can be used to create new types of font descriptors. ( I5adcc , b/261565807 )
  • Introduced PinnableContainer api propagated by lazy lists via a composition local which allows to pin current item. This means such item will not be disposed when it is scrolled away from the view. For example, Modifier.focusable() will pin the current focused item via this mechanism. ( Ib8881 , b/259274257 , b/195049010 )
  • Rewrote the way scrollables respond to bringIntoViewRequesters and focusables to better model the complexity of those operations and handle more edge cases. ( I2e5fe , b/241591211 , b/192043120 , b/237190748 , b/230756508 , b/239451114 )
  • More return type nullability of deprecated-hidden functions ( Ibf7b0 )
  • Added experimental TextMotion to TextStyle to define Text either to be Static(default) or Animated. Use TextMotion.Animated if Text is going to be scaled, translated, or rotated via animation. ( I24dd7 )
  • Add TextFieldFocusModifier to fix focus navigation behaviour for android platform ( I00303 )
  • Replaced maxSize: IntSize argument in drawText with size: Size to be inline with other DrawScope functions. size is set to Size.Unspecified by default which should not change the previous default behavior. ( Icd27d )

Исправления ошибок

  • Adjustments in the snapping physics in SnapFlingBehaviour for a more natural feel.

Known Issue

  • When updating from androidx.compose.foundation:1.4.0-alpha03 to androidx.compose.foundation:1.4.0-alpha04 , you might experience a java.lang.NoSuchFieldError error. Here is where the issue was orginially reported. A fix has been submitted, and will be available on the next Compose update. As a work around, update your androidx.compose.material and androidx.compose.material3 libraries to the latest version(1.1.0-alpha04) or downgrade your androidx.compose.foundation to 1.4.0-alpha03.

Version 1.4.0-alpha03

7 декабря 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha03 and androidx.compose.foundation:foundation-layout:1.4.0-alpha03 are released. Version 1.4.0-alpha03 contains these commits.

Изменения API

  • In UI tests using a Compose rule, continuations resumed during withFrameNanos callbacks 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 calls withFrameNanos or withFrameMillis directly, 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) -> Unit parameter to TestMonotonicFrameClock constructor and factory function to run code after withFrameNanos callbacks but before resuming callers' coroutines. ( Idb413 , b/254115946 , b/222093277 , b/255802670 )
  • Introduce Page accessibility actions: PageUp , PageDown , PageLeft , PageRight . Note that these are only available from API 29. ( Ida4ab )
  • Introduce HorizontalPager and VerticalPager , a way of showing composables in a Pager manner. Introduced PagerState to control the Pagers as well as query information about the Pager's current state. Introduced PageSize , a way of controlling the size of a Pager's page, this can be used to create a carousel like Pagers. Introduced PagerSnapDistance , a way to control how snapping will work in Pager's fling behavior. ( I01120 )
  • Introduced an overload in SnapFlingBehavior.performFling to help to understand where the fling will settle. ( I569f6 )
  • Removed OverscrollEffect#isEnabled . Instead of needing to remember and set this flag, just don't dispatch events to the overscroll effect in cases where you do not want overscroll to show (for example if ScrollableState#canScrollForward/backward both return false). ( I1a4b0 , b/255554340 , b/255557085 )
  • Added ScrollableState#canScrollForward and ScrollableState#canScrollBackward to query whether a ScrollableState has room to scroll in either direction (whether it is at the minimum / maximum of its range). This defaults to true for backwards compatibility with existing implementations of ScrollableState . Consumers can use this to show indication to the user that there is still room to scroll, and this could also be used to avoid dispatching delta to ScrollableStates that have no room to scroll in a given direction, to reduce unnecessary work. ( Idf1a0 , b/255557085 )
  • Added an Modifier API to query ancestors scroll info. ( I2ba9d , b/203141462 )
  • Used in Clickable to correctly delay press interactions, when gestures could become scroll events.
  • Fixed Clickables not correctly delaying ripples, when used inside an Scrollable ViewGroup .
  • Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events.
  • Update snapStepSize naming to be consistent with other methods in SnapLayoutInfoProvider . ( Ife67c )
  • Added EmojiCompat to Compose ( Ibf6f9 , b/139326806 )
  • Renamed consumedWindowInsets() to consumeWindowInsets() and withConsumedWindowInsets() to onConsumedWindowInsetsChanged() and made the Modifiers public. ( Ie44e1 )

Исправления ошибок

  • The crash with Modifier.animateItemPlacement() and Lazy grids was fixed. It was happening in some conditions when the new items count is smaller then the previous one. ( I0bcac , b/253195989 )

Версия 1.4.0-альфа02

9 ноября 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha02 and androidx.compose.foundation:foundation-layout:1.4.0-alpha02 are released. Версия 1.4.0-alpha02 содержит эти коммиты.

Изменения API

  • awaitFirstDown and waitForUpOrCancellation now accept a PointerEventPass for greater flexibility. ( I7579a , b/212091796 )
  • Revert beyondBoundCount API from Lazy* APIs ( I12197 )
  • Introduced parameter in Lazy APIs to compose and place out of viewport items ( I69e89 , b/172029355 )
  • Added minLines parameter to the BasicText and BasicTextField . It allows to set the minimum height of these composables in terms of number of lines ( I24294 , b/122476634 )

Версия 1.4.0-альфа01

24 октября 2022 г.

androidx.compose.foundation:foundation:1.4.0-alpha01 and androidx.compose.foundation:foundation-layout:1.4.0-alpha01 are released. Версия 1.4.0-alpha01 содержит эти коммиты.

Изменения API

  • A new method, awaitEachGesture() , for gesture detectors was added. It operates similar to forEachGesture() , but the loop over gestures operates entirely within the AwaitPointerEventScope so events can't be lost between iterations.
  • forEachGesture() has been deprecated in favor of awaitEachGesture() because it allows events to be lost between gestures. ( Iffc3f , b/251260206 )
  • Added WindowInsets.imeAnimationSourc e and WindowInsets.imeAnimationTarget to determine the animation progress and know where the IME will be after animation completes. ( I356f1 , b/217770337 )

Version 1.3

Version 1.3.1

9 ноября 2022 г.

androidx.compose.foundation:foundation:1.3.1 and androidx.compose.foundation:foundation-layout:1.3.1 are released. Version 1.3.1 contains these commits.

Исправления ошибок

  • Fix performance issue in BeyondBoundsLayout ( aosp/2255266 )
  • ContentInViewModifier will not read layout coordinates unless attached ( aosp/2241316 )

Версия 1.3.0

24 октября 2022 г.

androidx.compose.foundation:foundation:1.3.0 and androidx.compose.foundation:foundation-layout:1.3.0 are released. Версия 1.3.0 содержит эти коммиты.

Важные изменения с версии 1.2.0

  • Experimental versions of LazyVerticalStaggeredGrid and LazyHorizontalStaggeredGrid were introduced.
  • SnapFlingBehavior , rememberSnapFlingBehavior and other corresponding APIs were added as experimental.
  • Modifier.clickable , Modifier.toggleable , and Modifier.selectable now show ripples if clicked with the keyboard or d-pad on a remote control.

Версия 1.3.0-rc01

5 октября 2022 г.

androidx.compose.foundation:foundation:1.3.0-rc01 and androidx.compose.foundation:foundation-layout:1.3.0-rc01 are released. Версия 1.3.0-rc01 содержит эти коммиты.

Изменения API

  • Introduced lowVelocityAnimationSpec used by the approach step when there's not enough fling velocity to decay. ( Iaeb27 )
  • Added new experimental API Hyphens to support automatic hyphenation in Text ( Iaa869 )

Version 1.3.0-beta03

21 сентября 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta03 and androidx.compose.foundation:foundation-layout:1.3.0-beta03 are released. Version 1.3.0-beta03 contains these commits.

Изменения API

  • Add options to customize line breaking in Text. ( I86907 )
  • BringIntoViewResponder s are now able to get the most up-to-date bounds of a request while processing it. ( If86a5 , b/241591211 )
  • Introduce support for spacings between items to experimental Staggered Grid ( I10b82 )
  • Introduce content padding to experimental Staggered Grid ( I342ea )
  • Changed size:IntSize argument with constraints: Constraints in TextMeasurer.measure method to support minimum width constraints. ( I37530 , b/242707525 )
  • Added Modifier.withConsumedWindowInsets() to get consumed WindowInsets for use outside windowInsetsPadding .
  • Added MutableWindowInsets to allow easily changing WindowInsets without recomposition. ( I7fd28 , b/237019262 , b/243119659 )

Version 1.3.0-beta02

7 сентября 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta02 and androidx.compose.foundation:foundation-layout:1.3.0-beta02 are released. Version 1.3.0-beta02 contains these commits.

Изменения API

  • Initial version of experimental StaggeredGrid ( Ia48be )
  • Renamed FocusDirection.In and FocusDirection.Out to FocusDirection.Enter and FocusDirection.Exit ( Ia4262 , b/183746982 )
  • Introduced a rememberSnapFlingBehavior overload that provides a quick way of enabling snapping in LazyLists . ( Ifb48a )
  • Replaced the snapFlingBehavior factory with a concrete SnapFlingBehavior class. Scoped SnapLayoutInfoProvider methods to Density to make Dp<->Px conversions easier for the API users. ( I54a11 )
  • Update LazyLayoutMeasureScope.measure to return list of placeables, highlighting desired immutability of the returned value. ( I48b7c )
  • Introduced SnapLayoutInfoProvider which takes a LazyListState to create an instance of SnapLayoutInfoProvider that can be used to enable a snap FlingBehavior for LazyLists . ( I2dd10 )

Исправления ошибок

  • Refactors AwaitPointerEventScope#awaitLongPressOrCancellation to match other await functions ( I646e6 )

Версия 1.3.0-бета01

24 августа 2022 г.

androidx.compose.foundation:foundation:1.3.0-beta01 and androidx.compose.foundation:foundation-layout:1.3.0-beta01 are released. Версия 1.3.0-beta01 содержит эти коммиты.

Изменения API

  • Removed pointerPosition from OverscrollEffect - effects that care about pointer position can use Modifier.pointerInput { } in the effectModifier to get the current pointer position instead. ( I9f606 , b/241239306 )
  • Exposed AwaitPointerEventScope#awaitLongPressOrCancellation as additional building block for more complex gesture detection ( I04374 , b/181577176 )
  • Introduced lazyListSnapLayoutInfoProvider to enable snapping in Lazy Lists. ( I3ecdf )
  • Introduced SnapFlingBehavior , a fling behavior that enables list snapping. Provide an instance of SnapLayoutInfoProvider with information about your snapping layout. ( Ie754c )

Версия 1.3.0-альфа03

10 августа 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha03 and androidx.compose.foundation:foundation-layout:1.3.0-alpha03 are released. Версия 1.3.0-alpha03 содержит эти коммиты.

Изменения API

  • Resource Fonts now support setting font variation settings (API 26+). ( I900dd , b/143703328 )
  • Variable font support in DeviceFontFamilyNameFont ( Ic1279 , b/143703328 )
  • Removed experimental annotation from PlatformTextStyle and LineHeightStyle . ( I64bef )
  • Text fields will now throw more detailed exceptions when the OffsetMapping provided by a VisualTransformation returns invalid indices. ( Ie73f9 , b/229378536 )
  • Introduce experimental APIs to share item provider logic between Lazy layouts. ( Ic891c )
  • ScrollableDefaults.reverseDirection() is not experimental anymore. ( Iba646 )
  • Deprecated SemanticsModifier.id and moved the semantics id to LayoutInfo.semanticsId instead. ( Iac808 , b/203559524 )
  • checkScrollableContainerConstraints() is not experimental anymore. ( I2c290 )
  • Modifier.clipScrollableContainer() is not experimental anymore. ( Ia2b44 )
  • Deprecate TextInputService.show|hideSoftwareKeyboard . Please use SoftwareKeyboardController instead in app code and TextInputSession in IME-management code. ( I14e4c , b/183448615 )

Версия 1.3.0-альфа02

27 июля 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha02 and androidx.compose.foundation:foundation-layout:1.3.0-alpha02 are released. Версия 1.3.0-alpha02 содержит эти коммиты.

Изменения API

  • Added drawText extension function on DrawScope to provide a way to draw multi-styled text on composables and modifiers that operate on a DrawScope like Canvas and drawBehind . ( I16a62 , b/190787898 )

Исправления ошибок

  • Soft keyboard will now be hidden when a text field is disabled while focused. ( I6e3e4 , b/237308379 )
  • When adding InputEventChange events to Velocity Tracker we will consider now deltas instead of positions, this will guarantee the velocity is correctly calculated for all cases even if the target element moves ( Icea9d , b/216582726 , b/223440806 , b/227709803 )
  • When a scrollable has a focused child, it will now correctly scroll to keep the focused child in view when its size is decreased, even when the size is animated. ( I80867 , b/230756508 , b/220119990 )
  • Fixed a crash where TextField is cleared and refilled while selection is active. ( I1235b , b/208655565 , b/214253689 )

Версия 1.3.0-альфа01

29 июня 2022 г.

androidx.compose.foundation:foundation:1.3.0-alpha01 and androidx.compose.foundation:foundation-layout:1.3.0-alpha01 are released. Версия 1.3.0-alpha01 содержит эти коммиты.

Изменения API

  • Introduced the UrlAnnotation annotation type and associated methods to support TalkBack link support in AnnotatedString s. ( I1c754 , b/231495122 )

Исправления ошибок

  • BasicTextField cursorBrush may now be animated without restarting the cursor timer. ( I812e6 , b/236383522 )

Версия 1.2

Version 1.2.1

10 августа 2022 г.

androidx.compose.foundation:foundation:1.2.1 and androidx.compose.foundation:foundation-layout:1.2.1 are released. Version 1.2.1 contains these commits.

Версия 1.2.0

27 июля 2022 г.

androidx.compose.foundation:foundation:1.2.0 and androidx.compose.foundation:foundation-layout:1.2.0 are released. Версия 1.2.0 содержит эти коммиты.

Важные изменения с версии 1.1.0

  • LazyVerticalGrid and LazyHorizontalGrid are stable now.
  • You can now specify a content type for items in Lazy lists and grids. This will allow the components to reuse elements more efficiently.
  • Lazy lists and grids now have userScrollEnabled param which allows to disable scrolling via the user gestures.
  • A new experimental API called LazyLayout was added. It It is the API we use internally to power Lazy lists and grids.
  • OverscrollEffect API has been introduced as experimental. You can define custom overscroll effects as well as adding a standard platform one to custom scrollable containers.
  • Nested scrolling interoperability APIs have been introduced to allow for interoperability between views and compose scrolling actors.
  • Mouse and trackpad scrolling has been added to all scrolling containers.

Version 1.2.0-rc03

29 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc03 and androidx.compose.foundation:foundation-layout:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits.

  • No changes since 1.2.0-rc02.

Version 1.2.0-rc02

22 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc02 and androidx.compose.foundation:foundation-layout:1.2.0-rc02 are released. Version 1.2.0-rc02 contains these commits.

Версия 1.2.0-rc01

15 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-rc01 and androidx.compose.foundation:foundation-layout:1.2.0-rc01 are released. Версия 1.2.0-rc01 содержит эти коммиты.

Изменения API

  • An experimental OverscrollEffect has been introduced to allow for custom overscroll effects, alongside the Modifier.scrollable overloads that accept it.
  • Experimental LocalOverScrollConfiguration has been moved from foundation.gesture to foundation package and renamed to LocalOverscrollConfiguration ( If19fb , b/204650733 )
  • Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
  • Introduced an experimental api checkScrollableContainerConstraints() which allows to check that we do not nest scrollable containers. You can use it when create your own scrollable lazy layouts via LazyLayout . ( Id6fab , b/233352497 )
  • Removed deprecated LazyVerticalGrid from androidx.compose.foundation.lazy package. The new stable api is located in androidx.compose.foundation.lazy.grid ( I73c76 , b/225192009 )

Version 1.2.0-beta03

1 июня 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta03 and androidx.compose.foundation:foundation-layout:1.2.0-beta03 are released. Version 1.2.0-beta03 contains these commits.

Изменения API

  • Added new experimental IntervalList and MutableIntervalList . It allows to represent some list of values via multiple intervals. It will be useful when you want to define your own dsl similar to the one used by LazyColumn where list items can be defined via multiple item/items calls. ( I2d05e , b/228580728 )

Исправления ошибок

  • Clarified the documentation for WindowInsets.ime to state that ime insets are reported as far back as API 23, but only animated on 30+. ( Ia7fc0 , b/230756508 )
  • Pressing the forward delete key when the cursor is at the end of a text field will no longer crash.
  • DeleteSurroundingTextCommand and DeleteSurroundingTextInCodePointsCommand now require their constructor arguments to be non-negative. ( Ica8e6 , b/199919707 )

Version 1.2.0-beta02

18 мая 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta02 and androidx.compose.foundation:foundation-layout:1.2.0-beta02 are released. Version 1.2.0-beta02 contains these commits.

  • Downloadable font resolution that does not change the layout size of Text or TextField previously would not redraw, leading to stale font display. This bugfix ensures that text layout always triggers redraw (b/229727404). ( I1d49e , b/229727404 )

Версия 1.2.0-бета01

11 мая 2022 г.

androidx.compose.foundation:foundation:1.2.0-beta01 and androidx.compose.foundation:foundation-layout:1.2.0-beta01 are released. Версия 1.2.0-beta01 содержит эти коммиты.

Новые возможности

  • This is the first beta release of 1.2!

Изменения API

  • Added experimental BeyondBoundsInterval that can be used by custom implementations of LazyList when they layout items beyond visible bounds ( Ifabfb , b/184670295 )
  • LineHeightBehavior is renamed as LineHeightStyle
  • LineVerticalAlignment is renamed as LineHeightStyle.Alignment
  • Renames LineHeightTrim is renamed as LineHeightStyle.Trim
  • Default constructor values from LineHeightStyle is removed ( I582bf , b/181155707 )
  • Added default values for the optional members of LazyLayoutItemProvider interface. ( Iba8a0 )
  • In the LazyLayoutItemProvider api instead of a factory returning the composable lambda by index we now have a simpler composable function Item accepting the index. ( Id2196 )
  • LazyLayoutItemsProvider is renamed to LazyLayoutItemProvider ( I0638c )
  • LazyLayoutItemsProvider.itemsCount is renamed to itemCount ( Id409c )
  • Added Brush to TextStyle and SpanStyle to provide a way to draw text with gradient coloring. ( I53869 , b/187839528 )
  • trimFirstLineTop , trimLastLineBottom attributes of LineHeightBehavior changed into a single enum: LineHeightTrim . LineHeightTrim have values of 4 states defined by two booleans: FirstLineTop , LastLineBottom , Both and None ( Ifc6a5 , b/181155707 )
  • Added LineHeightBehavior to the TextStyle and ParagraphStyle. LineHeightBehavior controls 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 by TextStyle ( 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 , trimLastLineBottom configurations works correctly only when includeFontPadding is false. ( I97332 , b/181155707 )

  • Added experimental imeNestedScroll() modifier so that developers can control the IME through scrolling. ( I60759 )

Bug Fixes

  • Fixed regression where text fields would not hide the keyboard when removed from the composition while focused. ( I7a410 , b/230536793 , b/225541817 )
  • Support ellipsis when height is limited and doesn't fit all text lines ( Ie528c , b/168720622 )
  • BringIntoViewRequester.bringIntoView will now always suspend until the request is either completed or was interrupted by a newer, non-overlapping request. Overlapping requests will be queued. ( I43e7f , b/216790855 )
  • Concurrent BringIntoViewRequester.bringIntoView calls for rectangles that are completely overlapping will now only honor the larger rectangle's request. ( I34be7 , b/216790855 , b/184760918 )
  • Turned on default includeFontPadding . It is possible to turn off the includeFontPadding using TextStyle.platformTextStyle attribute. 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 solve TextField clipping issues. ( I01423 , b/171394808 )
  • Modifier.bringIntoViewRequester no longer uses onGloballyPositioned . ( I630f5 )

Внешний вклад

  • MouseInjectionScope.scroll(delta = someDelta) is now inverted on Android if we scroll vertically (if someDelta is positive, it will scroll downward) ( Ifb697 , b/224992993 )

Version 1.2.0-alpha08

20 апреля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha08 and androidx.compose.foundation:foundation-layout:1.2.0-alpha08 are released. Version 1.2.0-alpha08 contains these commits.

Изменения API

  • Display all available weights for systems fonts on Android when using FontFamily.SansSerif . This will use fallback font names like sans-serif-medium internally on API 21-28. This is a behavior change as previously only weights 400 and 700 were supported on API 21-28. ( I380fe , b/156048036 , b/226441992 )
  • Paragraph and MultiParagraph are now accepting Constraints parameter. Passing Constraints.maxHeight is a no-op at the moment but will allow to do some calculation in the future, like ellipsizing based on the height. ( I6afee , b/168720622 )
  • SubcomposeSlotReusePolicy.getSlotsToRetain() now accepts a custom MutableSet-like class which doesn't allow adding new items in it. ( Icd314 )
  • Partial consumption (down OR position) has been deprecated in PointerInputChange . You can use consume() to consume the change completely. You can use isConsumed to determine whether or not someone else has previously consumed the change.
  • PointerInputChange::copy() now always makes a shallow copy. It means that copies of PointerInputChange will be consumed once one of the copies is consumed. If you want to create an unbound PointerInputChange , use constructor instead. ( Ie6be4 , b/225669674 )
  • New experimental LazyLayout API is introduced. This allows you to build your own components like LazyColumn of LazyVerticalGrid . Note that the API is in its early stages and can be changed in the future releases. ( Iba2bc , b/166591700 )
  • AndroidFont now takes typefaceLoader as a constructor parameter. ( I2c971 )
  • WindowInsets companion now exposes the visibility (whether they are on the screen, regardless of whether they intersect with the window) and the size they could be if they are available on the device, but not currently active. ( I65182 , b/217770337 )

Version 1.2.0-alpha07

6 апреля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha07 and androidx.compose.foundation:foundation-layout:1.2.0-alpha07 are released. Version 1.2.0-alpha07 contains these commits.

Изменения API

  • Added a PinnableParent API that allows children of lazy layouts to prevent the currently composed items from being disposed ( Ibbdd0 , b/184670295 )
  • LazyListLayoutInfo and LazyGridLayoutInfo now have beforeContentPadding and afterContentPadding fields ( I3b628 , b/200920410 )
  • Added KeyboardType.Decimal as an alternative to Keyboard.Number for specifically including decimal separator in IME. ( Iec4c8 , b/209835363 )
  • Add new font descriptor Font(DeviceFontFamilyName) to optionally lookup system-installed fonts during font fallback chains. ( I30468 , b/219754572 )
  • PointerEventType.Scroll and PointerEvent.scrollDelta are stable APIs now ( I574c5 , b/225669674 )
  • Added temporary compatibility configuration for includeFontPadding in TextStyle/ParagraphStyle. includeFontPadding can be changed via TextStyle(platformStyle = PlatformTextStyle(includeFontPadding = true/false)) . This is a temporary configuration option to enable migration and will be removed. ( If47be , b/171394808 )
  • Updated FontFamily.Resolver to integrate System-wide bold text accessibility setting ( I6c1e7 )
  • The consumeWindowInsets extension property of ComposeView allows developers to disable consumption of Android WindowInsets. This allows separate ComposeViews in the hierarchy to each apply WindowInsets without interfering with each other. ( I0ef08 , b/220943142 )

Version 1.2.0-alpha06

23 марта 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha06 and androidx.compose.foundation:foundation-layout:1.2.0-alpha06 are released. Version 1.2.0-alpha06 contains these commits.

Изменения API

  • Added RequestFocus semantics action to request focus on the focusable target. ( I17b71 )
  • FocusOrder has now been merged into FocusProperties and focusProperties() now has all the capabilities of focusOrder() . FocusOrder and focusOrder() have been deprecated. focusOrder() that accepts a focusRequester should be replaced with a focusRequester() modifier in combination with focusProperties() . This allows the modifiers to have a stronger separation of concerns. ( I601b7 )
  • WindowInsets.asPaddingValues(Density) was added to allow developers to do the conversion without needing to be in composition. ( I94c35 )
  • Updated parsing of vector drawables to support auto mirroring to flip the content of a VectorPainter if the current layout direction is RTL. ( I79cd9 , b/185760237 )

Исправления ошибок

  • Scroll modifiers ( Modifier.verticalScroll() , Modifier.horizontalScroll() , and Modifier.scrollable() ) will now scroll to keep the focused composable visible if the scroll area is resized and the focused composable was previously visible.
  • TextFields will now be kept above the keyboard when they are focused and the keyboard is shown, when inside a non-lazy scrollable and the soft input mode is ADJUST_RESIZE . ( I4a485 , b/190539358 , b/192043120 , b/216842427 )

Version 1.2.0-alpha05

9 марта 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha05 and androidx.compose.foundation:foundation-layout:1.2.0-alpha05 are released. Version 1.2.0-alpha05 contains these commits.

Изменения API

  • LazyVerticalGrid and LazyHorizontalGrid are now stable. ( I307c0 )
  • LazyGridItemInfo.Unknown was replaced with separate LazyGridItemInfo.UnknownRow and LazyGridItemInfo.UnknownColumn ( I56d51 )
  • LazyVerticalGrid / LazyHorizontalGrid and all related apis were moved into .grid subpackage. Please update your imports from androidx.compose.foundation.lazy to androidx.compose.foundation.lazy.grid . ( I2d446 , b/219942574 )
  • Text: includeFontPadding is now turned off by default. The clipping issues as a result of includeFontPadding=false is handled and no clipping should occur for tall scripts. ( I31c84 , b/171394808 )
  • Measured interface now exposes parentData property ( I3313f )
  • Introduced experimental Modifier.onFocusedBoundsChanged to allow observing the bounds of child focusables. ( I14283 , b/220030968 , b/190539358 , b/192043120 , b/216842427 )
  • LazyHorizontalGrid was added. ( I61ae7 , b/191238807 )
  • Added a new LazyVerticalGrid API to define cross axis sizes ( I17723 )
  • Added FocusGroup modifier ( I64bc0 , b/213508274 , b/184670295 )

Исправления ошибок

  • WindowInsets.toString() will now show the correct values. ( I1585d )

Внешний вклад

  • Updated to use Kotlinx coroutines 1.6.0 ( I3366d )

Version 1.2.0-alpha04

23 февраля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha04 and androidx.compose.foundation:foundation-layout:1.2.0-alpha04 are released. Version 1.2.0-alpha04 contains these commits.

Изменения API

  • BringIntoViewResponders are no longer required to manually pass requests up to parent responders, and are instead required to immediately return the rectangle they want their parent to bring into view. ( I8e66a )
  • Support async font loading in Text ( I77057 , b/214587005 )
  • LazyVerticalGrid now supports line breaking before items with span not fitting inside the current line. ( I05c40 , b/207462103 )
  • Renamed excludeFromSystemGestures to systemGesturesExclusion ( I19526 )
  • LazyVerticalGrid now supports reverseLayout. ( I6d7d7 , b/215572963 , b/211753558 )
  • Add WindowInsets.only() method to allow developers to include only dimensions from the WindowInsets. ( I14c94 , b/217768486 )
  • Added ComposableTarget , ComposableTargetMarker and ComposableOpenTarget that 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 ComposeNode or a related composable functions .

    For custom appliers the composable functions that calls ComposeNode or ReusableComposeNode need to add a CompoableTarget annotation for the function and any composable lambda parameter types. It is recommended, however, to create an annotation that is annotated with ComposableTargetMarker and then the marked annotation be used instead of ComposableTarget directly. A composable annotation marked with ComposableTargetMarker is equivalent to a ComposbleTarget with the fully qualified name of the attribute class as the applier parameter. For an example of using ComposableTargetMarker see anroidx.compose.ui.UiComposable . ( I38f11 )

Bug Fixes

  • Now it is allowed to pass negative scroll offsets into LazyGridState.scrollToItem() and LazyGridState.animateScrollToItem() . ( I025c6 , b/211753558 )
  • Support async font loading for TextField. ( Icc4bf , b/214587005 )

Version 1.2.0-alpha03

9 февраля 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha03 and androidx.compose.foundation:foundation-layout:1.2.0-alpha03 are released. Version 1.2.0-alpha03 contains these commits.

Изменения API

  • notifyFocusedRect methods in TextInputSession and TextInputService are now deprecated and won't be called. Use BringIntoViewRequester instead. ( Ia4302 , b/192043120 , b/216842427 , b/178211874 )
  • Animations were enabled for items of lazy grids with Modifier.animateItemPlacement(). ( Ib6621 , b/211753218 )
  • BringIntoViewRequester now propagates requests to the hosting Android View. ( Ia7a51 )
  • FontFamilyResolver is now available via LocalFontFamilyResolver.current
    • Added createFontFamilyResolver(context) and createFontFamilyResolver(context, coroutineScope) to create new FontFamily resolvers outside of compose usage.
    • Paragraph and MultiParagraph now take FontFamily.Resolver
    • TextLayoutResult.layoutInput.fontFamilyResolver now contains the resolver used for this layout, deprecated TextLayoutResult.layoutInput.resourceLoader as it is no longer used. ( Id5a45 , 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.ResourceLoaded API to support optional and async font loading. It is not recommended that application developers use this API directly. To add new types of fonts see AndroidFont.
    • Font.AndroidResourceLoader extension function allows construction of a Font.ResourceLoader when outside of composition.
    • Added loadingStrategy parameter 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 use FontFamilyResolver.preload
    • fontResource(FontFamily): Typeface is deprecated. This was previously used to preload fonts, which may take up to 10 seconds for downloadable fonts. Instead use FontFamilyResolver.preload ( If8e7c , b/174162090 )
  • You can now specify the content type for the items of LazyVerticalGrid - item/items functions on LazyGridScope now accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I7b355 , b/215372836 )
  • LazyListLayoutInfo and LazyGridLayoutInfo now have new properties: viewportSize , orientation , reverseLayout ( Ifc8ed , b/200920410 )
  • You can now specify the content type for the items of LazyColumn/LazyRow - item/items functions on LazyListScope now accept such parameter. Providing such information helps item composition reusing logic to make it more efficiently and only reuse the content between the items of similar type. ( I26506 )
  • SubcomposeLayoutState constructor accepting maxSlotsToRetainForReuse is now deprecated. Instead there is a new constructor accepting SubcomposeSlotReusePolicy - a new interface allowing more granular control on what slots should be retained for the future reuse. ( I52c4d )
  • Adds Modifiers for WindowInsets, both for padding and sizing. This allows some content to extend into the inset area, and still have primary content stay out of the inset area. For example, windowInsetsPadding can be used to pad the content area to avoid areas that may be fully or partially covered. ( Id0395 , b/213942085 )

Bug Fixes

  • 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 FontLoader is deprecated
    • New createFontFamilyResolver factory on Desktop ( I6bbbb , b/174162090 )
  • The soft keyboard input type no longer flickers when changing focus between text fields. ( I1bf50 , b/187746439 )
  • Text fields no longer require an extra back press when the cursor handle is showing. ( Ideb4b , b/205726883 )
  • Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )

Version 1.2.0-alpha02

26 января 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha02 and androidx.compose.foundation:foundation-layout:1.2.0-alpha02 are released. Version 1.2.0-alpha02 contains these commits.

Изменения API

  • Added NonRestartableComposable to methods that are overloads of existing methods without complex logic. This reduces compiler generated memoization checks (equals) for all parameters which are repeated in the inner function that is called. ( I90490 )
  • Added excludeFromSystemGesture Modifiers for easy access to Android's setSystemGestureExclusionRects ( I46f07 )

Bug Fixes

  • Text selection magnifier behavior has been polished to match the platform magnifier. ( Idd918 , b/206833278 )
  • LazyColumn , LazyRow , Modifier.verticalScroll and other containers that use Modifier.scrollable now support mouse wheel scrolling. ( I2b5e1 , b/198214718 )

Версия 1.2.0-альфа01

12 января 2022 г.

androidx.compose.foundation:foundation:1.2.0-alpha01 and androidx.compose.foundation:foundation-layout:1.2.0-alpha01 are released. Версия 1.2.0-alpha01 содержит эти коммиты.

Изменения API

  • New parameter userScrollEnabled was added to LazyColumn , LazyRow , and LazyVerticalGrid in order to allow users to temporarily or permanently disable the user initiated scroll via touch gestures or accessibility actions. Scrolling programmatically via the methods on the state will still be allowed. ( I7eae9 , b/201150093 )
  • Add onSizeChanged callback to magnifier modifier. ( I6879f )
  • The magnifier widget now shows when dragging selection handles in a SelectionContainer . ( I30b38 , b/139320979 )

Bug Fixes

  • Fixes TextField cursor handle not hiding when scrolled out of view. ( I14552 , b/208883748 )

Dependency Updates

  • Now depends on Kotlin 1.6.10 .

Version 1.1

Version 1.1.1

23 февраля 2022 г.

androidx.compose.foundation:foundation:1.1.1 and androidx.compose.foundation:foundation-layout:1.1.1 are released. Version 1.1.1 contains these commits.

Bug Fixes

Версия 1.1.0

9 февраля 2022 г.

androidx.compose.foundation:foundation:1.1.0 and androidx.compose.foundation:foundation-layout:1.1.0 are released. Version 1.1.0 contains these commits.

Important changes since 1.0.0

  • Stable support for the Android 12 Overscroll effect
  • Improvements to touch target sizing
  • Note that, with respect to Compose 1.0, Material components will expand their layout space to meet Material accessibility guidelines for touch target size . For instance, Button touch target will expand to a minimum size of 48x48dp, even if you set the Button's size to be smaller. This aligns Compose Material to the same behavior of Material Design Components, providing consistent behavior if you mix Views and Compose. This change also ensures that when you create your UI using Compose Material components, minimum requirements for touch target accessibility will be met.
  • Stable support for Navigation Rail
  • Graduates a number of previously experimental APIs to stable
  • Support for newer versions of Kotlin

Version 1.1.0-rc03

26 января 2022 г.

androidx.compose.foundation:foundation:1.1.0-rc03 and androidx.compose.foundation:foundation-layout:1.1.0-rc03 are released. Version 1.1.0-rc03 contains these commits.

Исправления ошибок

  • Updated to support Compose Material 1.1.0-rc03

Версия 1.1.0-rc01

15 декабря 2021 г.

androidx.compose.foundation:foundation:1.1.0-rc01 and androidx.compose.foundation:foundation-layout:1.1.0-rc01 are released. Version 1.1.0-rc01 contains these commits.

Bug Fixes

  • Now it is allowed to pass negative scroll offsets into LazyListState.scrollToItem() and LazyListState.animateScrollToItem() . ( Iceb90 , b/184252837 )
  • Fixed a bug that caused missing accessibility scroll actions ( I7cbfb )

Version 1.1.0-beta04

1 декабря 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta04 and androidx.compose.foundation:foundation-layout:1.1.0-beta04 are released. Version 1.1.0-beta04 contains these commits.

Новые возможности

  • Updated to be compatible with Kotlin 1.6.0

Изменения API

  • Cleaned up nullability in androidx.core.view ( I7078a , b/204917439 )
  • Experimental APIs were added that allow to consume PointerInputchange as a whole or check whether it was consumed or not. ( I2e59d )
  • Show a magnifier widget when dragging the cursor or selection handles inside text fields. ( I5391e , b/203781358 )

Bug Fixes

  • Fix text handles not moving when IME visibility changes. ( I25f2e )

Version 1.1.0-beta03

17 ноября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta03 and androidx.compose.foundation:foundation-layout:1.1.0-beta03 are released. Version 1.1.0-beta03 contains these commits.

Изменения API

  • Support for horizontal spans was added to LazyVerticalGrid. ( I7e2fa , b/176758183 )
  • Experimental ability to animate Lazy lists item positions was added. There is a new modifier available within LazyItemScope called Modifier.animateItemPlacement() . Пример использования:

      var list by remember { mutableStateOf(listOf("A", "B", "C")) }
      LazyColumn {
          item {
              Button(onClick = { list = list.shuffled() }) {
                  Text("Shuffle")
              }
          }
          items(list, key = { it }) {
              Text("Item $it", Modifier.animateItemPlacement())
          }
      }
    
    • When you provide a key via LazyListScope.item or LazyListScope.items this modifier will enable item reordering animations. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated. ( I59e7b , b/150812265 )

Version 1.1.0-beta02

3 ноября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta02 and androidx.compose.foundation:foundation-layout:1.1.0-beta02 are released. Version 1.1.0-beta02 contains these commits.

Bug Fixes

  • Ripples and other indications will now only be delayed if they are inside a Modifier.scrollable() container, instead of always being delayed for a down event. ( Ibefe0 , b/203141462 )
  • Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )

Внешний вклад

  • Added Modifier.pointerHoverIcon ( I95f01 )

Версия 1.1.0-бета01

27 октября 2021 г.

androidx.compose.foundation:foundation:1.1.0-beta01 and androidx.compose.foundation:foundation-layout:1.1.0-beta01 are released. Version 1.1.0-beta01 contains these commits.

Bug Fixes

  • Added experimental BringIntoView API that lets you send a request to parents so that they scroll to bring an item into view ( Ib918d , b/195353459 )

Version 1.1.0-alpha06

13 октября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha06 and androidx.compose.foundation:foundation-layout:1.1.0-alpha06 are released. Version 1.1.0-alpha06 contains these commits.

Изменения API

  • A child-less overload for Layout was added, with improved efficiency ( Ib0d9a )
  • SemanticsNodeInteraction.performSemanticsAction now returns the SemanticsNodeInteraction on which the function was called. ( I9e5db )
  • Added performScrollToNode(matcher: SemanticsMatcher) that scrolls a scrollable container to the content that is matched by the given matcher. ( Ic1cb8 )

Version 1.1.0-alpha05

29 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha05 and androidx.compose.foundation:foundation-layout:1.1.0-alpha05 are released. Version 1.1.0-alpha05 contains these commits.

Изменения API

Bug Fixes

  • Fixed accessibility support for scrollables (both lazy and non-lazy) with respect to scrolling ( I6cdb0 )

Version 1.1.0-alpha04

15 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha04 and androidx.compose.foundation:foundation-layout:1.1.0-alpha04 are released. Version 1.1.0-alpha04 contains these commits.

Изменения API

  • Deprecated performGesture and GestureScope , which have been replaced by performTouchInput and TouchInjectionScope . ( Ia5f3f , b/190493367 )
  • Added touchBoundsInRoot to SemanticsNode that includes the minimum touch target size so that developers can ensure that touch targets meet accessibility minimums. ( I2e14b , b/197751214 )

Bug Fixes

  • Support for stretch overscroll has been added on Android 12 devices. ( Iccf3c , b/171682480 )

Версия 1.1.0-альфа03

1 сентября 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha03 and androidx.compose.foundation:foundation-layout:1.1.0-alpha03 are released. Version 1.1.0-alpha03 contains these commits.

Новые возможности

  • Updated Compose 1.1.0-alpha03 to depend on Kotlin 1.5.30 . ( I74545 )

Изменения API

  • Glow effect for scroll has been added. New experimental OverScrollConfiguration API has been added to allow for configuration of the overscroll visual effect. Provide null to turn off the overscroll effect. ( I0c304 , b/171682480 )
  • AwaitPointerEventScope now has withTimeout() and withTimeoutOrNull() ( I507f0 , b/179239764 , b/182397793 )
  • Added test method to get the clipped bounds. ( I6b28e )
  • Added minimum touch target size to ViewConfiguration for use in semantics and pointer input to ensure accessibility. ( Ie861c )

Версия 1.1.0-альфа02

18 августа 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha02 and androidx.compose.foundation:foundation-layout:1.1.0-alpha02 are released. Version 1.1.0-alpha02 contains these commits.

Изменения API

Версия 1.1.0-альфа01

4 августа 2021 г.

androidx.compose.foundation:foundation:1.1.0-alpha01 and androidx.compose.foundation:foundation-layout:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits.

Изменения API

  • 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 )
  • TextField now clears selection when back button is pressed, which matches Android EditText behavior. ( I3ca16 , b/174173645 )
  • Add Cursor Handle. ( I07a82 , b/173016579 )

Исправления ошибок

  • Scrolling via semantics actions for lazy lists and regular scrolling components is now animated ( Id9066 , b/190742024 )

Внешний вклад

  • LazyVerticalGrid now accepts both horizontal and vertical arrangement parameters. ( If9c92 )

Версия 1.0

Version 1.0.5

3 ноября 2021 г.

androidx.compose.foundation:foundation:1.0.5 and androidx.compose.foundation:foundation-layout:1.0.5 are released. Version 1.0.5 contains these commits.

Bug Fixes

  • Fixed a crash tracking derivedStateOf instances. ( aosp/1792247 )

Version 1.0.4

13 октября 2021 г.

androidx.compose.foundation:foundation:1.0.4 and androidx.compose.foundation:foundation-layout:1.0.4 are released. Version 1.0.4 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.31

Version 1.0.3

29 сентября 2021 г.

androidx.compose.foundation:foundation:1.0.3 and androidx.compose.foundation:foundation-layout:1.0.3 are released. Version 1.0.3 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.30

Version 1.0.2

1 сентября 2021 г.

androidx.compose.foundation:foundation:1.0.2 and androidx.compose.foundation:foundation-layout:1.0.2 are released. Version 1.0.2 contains these commits.

Updated to support the Compose 1.0.2 release. Compose 1.0.2 is still compatible with Kotlin 1.5.21 .

Version 1.0.1

4 августа 2021 г.

androidx.compose.foundation:foundation:1.0.1 and androidx.compose.foundation:foundation-layout:1.0.1 are released. Version 1.0.1 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.21 .

Версия 1.0.0

July 28, 2021

androidx.compose.foundation:foundation:1.0.0 and androidx.compose.foundation:foundation-layout:1.0.0 are released. Version 1.0.0 contains these commits.

Major features of 1.0.0

This is the first stable release of Compose. Please see the official Compose Release blog for more details!

Известные проблемы

  • If you are using Android Studio Bumblebee Canary 4 or AGP 7.1.0-alpha04 / 7.1.0-alpha05 , you may hit the following crash:

      java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"
    

    To fix, temporarily increase your minSdkVersion to 24+ in your build.gradle file. This issue will be fixed in the next version of Android Studio Bumblebee and AGP 7.1 . ( b/194289155 )

Version 1.0.0-rc02

July 14, 2021

androidx.compose.foundation:foundation:1.0.0-rc02 and androidx.compose.foundation:foundation-layout:1.0.0-rc02 are released. Version 1.0.0-rc02 contains these commits.

  • Updated border rendering for generic shapes to address issues with paths defined with fixed dimensions. ( aosp/1748871 , b/191817116 )

Version 1.0.0-rc01

1 июля 2021 г.

androidx.compose.foundation:foundation:1.0.0-rc01 and androidx.compose.foundation:foundation-layout:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.

Изменения API

  • Canvas now supports a contentDescription parameter for accessibility. ( Ib547c )

Bug Fixes

  • Disabled Button, Card, Checkboxes and overall Modifier.clickable(enabled=false) will block clicks from going up to the parent. ( Ic2c3b , b/183908811 )

Version 1.0.0-beta09

16 июня 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta09 and androidx.compose.foundation:foundation-layout:1.0.0-beta09 are released. Version 1.0.0-beta09 contains these commits.

Изменения API

  • Removed ManualFrameClock . If you need to control animations, use composeTestRule.mainClock instead. ( I3c3e8 , b/189951065 )
  • change enum Role and LiveRegionMode to inline classes with private constructor ( Id1890 )
  • KeyboardCapitalization is converted into inline class. ( Id5a1c )
  • TextOverflow is changed to an inline class. ( I433af )

Bug Fixes

  • Now when you specify the unique keys for LazyColumn/Row items the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one . ( Id263f , b/184257857 )
  • Key constants are @ExperimentalComposeUiApi for now. Consuming code can declare private constants prior to stabilization. ( Ia5d48 )
  • Added IdlingStrategy to AndroidComposeTestRule that can be used by testing frameworks to install an alternative mechanism to await or achieve quiescence. Use AndroidComposeTestRule.setIdlingStrategyFactory() before your test starts to install your own strategy. ( I608fa )

Added Profile Rules

This release adds profile rules to the following compose modules ( I14ed6 ):

  • androidx.compose.animation
  • androidx.compose.animation-core
  • androidx.compose.foundation
  • androidx.compose.foundation-layout
  • androidx.compose.material
  • androidx.compose.material-ripple
  • androidx.compose.runtime
  • androidx.compose.ui
  • androidx.compose.ui.geometry
  • androidx.compose.ui.graphics
  • androidx.compose.ui.text
  • androidx.compose.ui.text
  • androidx.compose.ui.unit
  • androidx.compose.ui.util

What are profile rules?

  • Profile rules for a library are specified in a text file baseline-prof.txt located in the src/main or 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 using adb 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 characters H , S , and P to 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 class androidx.compose.runtime.SlotTable would have a descriptor of Landroidx/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 method fun isPlaced(): Boolean on LayoutNode has the signature isPlaced()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 H indicates that this method is a "hot" method, and should be compiled ahead of time.

  • A method that has the flag S indicates 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 P indicates that it is a method which is called after startup.

  • A class that is present in this file indicates that it is used during startup and should be pre-allocated in the heap to avoid the cost of class loading.

Как это работает?

  • Libraries can define these rules which will be packaged in AAR artifacts. When an app is then built which includes these artifacts, these rules are merged together and the merged rules are used to build a compact binary ART profile that is specific to the app. ART can then leverage this profile when the app is installed on devices in order to ahead-of-time compile a specific subset of the application to improve the performance of the application, especially the first run. Note that this will have no effect on debuggable applications.

Version 1.0.0-beta08

2 июня 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta08 and androidx.compose.foundation:foundation-layout:1.0.0-beta08 are released. Version 1.0.0-beta08 contains these commits.

Изменения API

  • NestedScrollSource enum is replaced by an inline class. ( Ie321b , b/187055290 )
  • Refactored enum usages to inline classes to avoid issues with exhaustive when statements when new enum values are added. ( I2b5eb )
  • Adds a tap timeout to clickable / toggleable to prevent showing a ripple during a scroll / drag ( Ia2704 , b/168524931 )
  • ContentDescription and Text semantics properties are no longer single values but lists. This enables to merge them as they are instead of concatenations. Also provided better testing APIs to utilize these changes ( Ica6bf , b/184825850 )
  • Modifier.focusModifier() is deprecated and replaced by Modifier.focusTarget() ( I6c860 )
  • KeyboardType enum is replaced by an inline class. ( I73045 , b/187055290 )
  • Replaced FocusState enum with a FocusState interface ( Iccc1a , b/187055290 )
  • ImeAction enum is replaced by an inline class. ( I18be5 , b/187055290 )
  • AnnotatedString.withAnnotation functions are now ExperimentalTextApi instead of ExperimentalComposeApi. ( I0cd0a )
    • TextUnit constructor with TextUnitType is now ExperimentalTextApi instead of ExperimentalComposeApi.
  • PaddingValues is now @Stable rather than @Immutable ( I88c50 )

Bug Fixes

  • Fix crashes of long press the blank area in non-empty text. ( I33ab5 , b/187437299 )
  • Show Toolbar after SelectAll ( I495d9 , b/185919613 )
  • Fix for scrollable containers clipping its children on the cross axis. It was easily reproducible if you have a LazyRow with Card items. now the shadow will not be clipped. ( Icb635 , b/186318448 )
  • Fixed an issue where ripples / other indication would sometimes get stuck on a long click when using Modifier.combinedClickable ( I2298c , b/186223077 )
  • Now detectDragGesures , detectVerticalGestures , and detectHorizontalGestures will consume the position change automatically, no need to call change.consumePositionChange in the onDrag callbacks ( I42fc4 , b/185096350 , b/187320697 )
  • Modifier.onGloballyPositioned() was changed to report the coordinates of this modifier in the modifier chain, not the layout coordinates after applying all the modifiers. This means that now the ordering of modifiers is affecting what coordinates would be reported. ( Ieb67d , b/177926591 )

Version 1.0.0-beta07

18 мая 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta07 and androidx.compose.foundation:foundation-layout:1.0.0-beta07 are released. Version 1.0.0-beta07 contains these commits.

Изменения API

Bug Fixes

  • LazyColumn/Row will now keep up to 2 previously visible items active (not disposed) even when they are scrolled out already. This allows the component to reuse the active subcompositions when we will need to compose a new item which improves the scrolling performance. ( Ie5555 )
  • Remove paintBackground. ( I38660 )
  • Draw Selection Background using DrawScope. ( I73c61 , b/186674472 )
  • A beta06 regression affecting Row/Column using spacedBy arrangements to layout weighted children was fixed. ( Ifaf8c , b/187326588 )

Version 1.0.0-beta06

5 мая 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta06 and androidx.compose.foundation:foundation-layout:1.0.0-beta06 are released. Version 1.0.0-beta06 contains these commits.

Изменения API

  • Solve Conflict with Navigation Gesture ( I1145e )
  • Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services ( Id54ef , b/180479017 )
  • Added SemanticsActions.ScrollToIndex to scroll a list with indexed items to the item with a certain index, and SemanticsProperties.IndexForKey to get the index of an item in a list with keyed items. Both actions are implemented by LazyList.
    • Added SemanticsNodeInteraction.performScrollToIndex that scrolls a list to the given index, and SemanticsNodeInteraction.performScrollToKey that scrolls a list to the item with the given key. ( I4fe63 , b/178483889 , b/161584524 )
  • AnnotatedString save support to TextFieldValue.Saver. Added addTtsAnnotation and withAnnotation utility functions to AnnotatedString.Builder ( I8cbdc , b/178446304 )
  • Default 0.dp parameter values were added to PaddingValues(horizontal, vertical) ( I05571 , b/181336792 )

Исправления ошибок

  • Row & Column children with weight(fill = false) are no longer making the parent fill the entire available main axis space. ( Ied94d , b/186012444 , b/184355105 )

Version 1.0.0-beta05

21 апреля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta05 and androidx.compose.foundation:foundation-layout:1.0.0-beta05 are released. Version 1.0.0-beta05 contains these commits.

Изменения API

  • FlingBehavior interface is now marked as @Stable. All implementations should comply with the @Stable contract. ( I93354 , b/184830577 )

Bug Fixes

  • Fixed ACTION_SCROLL_FORWARD , ACTION_SCROLL_BACKWARD , accessibilityActionScrollLeft , accessibilityActionScrollUp , accessibilityActionScrollRight and accessibilityActionScrollDown accessibility scroll actions. Instead of scrolling to the end of the scrollable, it will now scroll by one screen in the given direction. ( Ieccb0 )
  • The AndroidManifest files from ui-test-manifest and ui-tooling-data are now compatible with Android 12 ( I6f9de , b/184718994 )

Version 1.0.0-beta04

7 апреля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta04 and androidx.compose.foundation:foundation-layout:1.0.0-beta04 are released. Version 1.0.0-beta04 contains these commits.

Изменения API

  • Rename hideSoftwareKeyboard and showSoftwareKeyboard on SoftwareKeyboardController to hide() and show() respectively.
    • Provide the full CompositionLocal interface for LocalSoftwareKeyboardController, allowing it to be set (especially useful in tests) ( I579a6 )
  • TextOverflow.Visible is introduced. ( Ic8f89 )
  • Public instances of RowScope , ColumnScope , BoxScope , BoxWithConstraintsScope were removed. ( I4e83e , b/181869067 )

Bug Fixes

  • Fixed the issue when items of LazyColumn / LazyRow located on the edges were incorrectly positioned after fast fling ( Ie4d13 , b/183877420 )
  • Prior to this change, local composable functions were skippable based on their parameters. After this change, no local composable functions will skip. This change is done because it is common and expected for local functions to capture parameters from the parent and them skipping is a common source of bugs.

    To summarize, consider the example:

    @Composable fun Counter(count: Int, onCountChange: (Int) -> Unit) {
      @Composable fun ShowCount() { Text("Count: $count") }
      ShowCount()
      Button(onClick={ onCountChange(count + 1) }) {
        Text("Increment")
      }
    }
    

    Prior to this change, the ShowCount composable function would always skip, even after the count parameter was updated. Это уже не так. ( I5648a )

Version 1.0.0-beta03

24 марта 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta03 and androidx.compose.foundation:foundation-layout:1.0.0-beta03 are released. Version 1.0.0-beta03 contains these commits.

Изменения API

  • DefaultMonotonicFrameClock is deprecated. Calling withFrameNanos or Recomposer.runRecomposeAndApplyChanges with no MonotonicFrameClock will now throw IllegalStateException . ( I4eb0d )

Bug Fixes

  • FlingBehavior.performFling() is now called even when velocity is 0 ( I0b6e5 , b/181237123 )

Version 1.0.0-beta02

10 марта 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta02 and androidx.compose.foundation:foundation-layout:1.0.0-beta02 are released. Version 1.0.0-beta02 contains these commits.

Изменения API

  • Multiple small optimizations in LazyColumn measuring logic were added ( Ic6889 )
  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I5951e , b/168778053 )
  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I84472 , b/168778053 )

Bug Fixes

Version 1.0.0-beta01

24 февраля 2021 г.

androidx.compose.foundation:foundation:1.0.0-beta01 and androidx.compose.foundation:foundation-layout:1.0.0-beta01 are released. Version 1.0.0-beta01 contains these commits.

This is the first release of Compose 1.0.0 Beta.

Изменения API

  • onStart callback has been added to detectDragGestures ( I67269 , b/179995594 )
  • Modifiers for sizing to intrinsics are no longer experimental. ( I15744 )
  • Removed dp assertions ( I798d2 )
  • Removed SoftwareKeyboardController callback from all text fields to be replaced by a new API shortly. ( Iae869 , b/168778053 )
  • MeasureBlocks was renamed to MeasurePolicy which became a fun interface. Layout APIs were updated / simplified to use MeasurePolicy. ( Icab48 , b/167662468 , b/156751158 )
  • InteractionState has been replaced with [Mutable]InteractionSource
    • Interfaces are responsible for emitting / collecting Interaction events.
    • Instead of passing interactionState = remember { InteractionState() } to components such as Button and Modifier.clickable() , use interactionSource = remember { MutableInteractionSource() } .
    • Instead of: Interaction.Pressed in interactionState you should instead use the extension functions on InteractionSource, such as InteractionSource.collectIsPressedAsState().
    • For complex use cases you can use InteractionSource.interactions to observe the stream of Interactions. See the InteractionSource documentation and samples for more information.
    • ( I85965 , b/152525426 , b/171913923 , b/171710801 , b/174852378 )
  • Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
  • Created new TextInputSession for input sessions from low level text components such as CoreTextField. ( I8817f , b/177662148 )
  • Placeable now exposes measuredSize, representing the size which the child layout actually measured to. This size might not respect the measurement constraints. ( Ib2729 , b/172560206 , b/172338608 )
  • Add selectionGroup modifier that allows to mark collection of Tabs or RadioButtons for accessibility purposes ( Ie5c29 )
  • Add LazyListState.animateScrollToItem

    This method smooth scrolls to a specific item in the list. ( I4bfd7 )

  • ScrollableState.smoothScrollBy() was renamed to animateScrollBy() LazyListState.snapToItemIndex() was renamed to scrollToItem() ScrollState.smoothScrollTo() was renamed to animateScrollTo() ( I35ded )

  • Modifier.zoomable has been replaced my Modifier.transformable. smoothPanBy, smoothRotationBy have been added as a functionality. ( Ifc32b , b/175294473 )

  • The defaultFactory for compositionLocalOf and staticCompositionLocalOf is 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 defaultFactory lambda should throw an exception. However throwing an exception means that consumers of the local will have an implicit dependency on it being provided that is not enforced by the type system. ( Ifbd2a )

  • Changed Indication#createIndication() to Indication#rememberUpdatedIndication(InteractionState) and removes InteractionState parameter from I ndicationInstance#drawIndication() . IndicationInstance should only be responsible for drawing visual effects, and not launching animations / writing state in response to InteractionState changes. These animations and state writes should happen within rememberUpdatedIndication() instead. The indication parameter in Modifier.indication was also changed to be a required parameter. ( Ic1764 , b/152525426 )

  • Text actions now check focus automatically ( I13777 , b/179648629 )

  • Removed runBlockingWithManualClock ( I15cdc , b/179664814 )

  • Scroll position in Modifier.verticalScroll()/horizontalScroll() is represented with Ints now ( I81298 )

  • smoothScrollBy and scrollBy methods' packages changed to androidx.compose.foundation.gestures.* ( I3f7c1 , b/175294473 )

  • FlingConfig has been renamed to FlingBehavior now allows for customization of suspend animation rather than predefined Decays. ( I02b86 , b/175294473 )

  • Size modifiers were renamed. Modifier.width/height/size were renamed to requiredWidth/requiredHeight/requiredSize. Modifier.preferredWidth/preferredHeight/preferredSize were renamed to width/height/size. ( I5b414 )

  • defaultMinSizeConstraints was renamed to defaultMinSize. ( I4eaae )

  • Modifier.tapGestureFilter has been removed. Use Modifier.pointerInput { detectTapGestures(...) } instead. ( I266ed , b/175294473 )

  • partial consumption was removed from pointer input system. The recommended way of coordinating partial consumtion is Modifier.nestedScroll. ( Ie9c9b )

  • Orientation has been moved to foundation package. VelocirtTracker moved from ui.gesture to ui.input.pointer. ( Iff4a8 , b/175294473 )

  • AnimationClockObservable and subclasses have been removed. AnimatedFloat has been removed. ( Icde52 , b/177457083 )

  • drawerState.open() and drawerState.close() are now suspending functions. Use rememberCoroutineScope() to get the scope of the composition to call them ( I16f60 , b/175294473 )

  • Providers has been renamed to CompositionLocalProvider

    • The Composition constructor no longer accepts a key parameter, and has been deprecated.
    • currentCompositeKeyHash has been turned into a composable top level property instead of a composable top level function.
    • CompositionData and CompositionGroup have been moved to the androidx.compose.runtime.tooling namespace
    • ComposableLambda has been made an interface instead of a concrete class, and no longer has type parameters.
    • ComposableLambdaN has been made an interface instead of a concrete class, and no longer has type parameters.
    • The snapshotFlow function has been moved to the androidx.compose.runtime namespace
    • the merge method of SnapshotMutationPolicy is no longer experimental
    • The @TestOnly top level clearRoots function has been removed. В этом больше нет необходимости.
    • keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
    • Composer.collectKeySourceInformation has been removed. В этом больше нет необходимости.
    • isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
    • Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
    • ( I99b7d , b/177245490 )
  • Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )

  • Modifier.draggable now accepts DraggableState instead of a simple lambda. you can create state via rememberDraggableState { delta -> } to get the same behaviour as before ( Ica70f , b/175294473 )

  • requiredWidth(IntrinsicSize) and requiredHeight(IntrinsicSize) modifiers were added for required sizing to intrinsic sizes. ( I0a6b4 )

  • Deprecated emptyContent() is removed. Use {} instead. ( Idb33f , b/179432510 )

  • Deleted some previously deprecated APIs ( Ice5da , b/178633932 )

Bug Fixes

  • Added new LocalSoftwareKeyboardController composition local API to replace previous SoftwareKeyboardController interface on TextField. ( I658b6 , b/168778053 )

Version 1.0.0-alpha12

10 февраля 2021 г.

androidx.compose.foundation:foundation:1.0.0-alpha12 and androidx.compose.foundation:foundation-layout:1.0.0-alpha12 are released. Version 1.0.0-alpha12 contains these commits.

Изменения API

  • Modifier.pointerInput now requires remember keys to indicate when the pointer input detection coroutine should restart for new dependencies. ( I849cd )
  • Testing update: hasText() will check for both input and label/hint/placeholder texts in the text field ( Iab803 )
  • PaddingValues.Absolute was added and can be used in APIs accepting PaddingValues. ( Ia5f30 )
  • onImeActionPerformed is deprecated. use KeyboardActions instead ( If0bbd , b/179071523 )
  • In order to better match naming conventions with ImageBitmap and ImageVector, ImagePainter has been renamed to BitmapPainter to parallel VectorPainter. ( Iba381 , b/174565889 )
  • Better substring test APIs with substring now as an argument ( Icbe78 )
  • Introduced an InfiniteAnimationPolicy coroutine context element that will be applied in infinite animations. By default no policy is installed, except when running tests with ComposeTestRule . ( I50ec4 , b/151940543 )
  • Animatable.snapTo and Animatable.stop are now suspend functions ( If4288 )
  • ComponentActivity.setContent has moved to androidx.activity.compose.setContent in the androidx.activity:activity-compose module. ( Icf416 )
  • Destructuring and copy() methods have been removed from several classes where they were rarely used. ( I26702 , b/178659281 )
  • Custom keys support for LazyColumn/LazyRow was added. This allows us to smarter handle items reordering. So the state you stored in remember {} blocks will move together with the item when you reorder elements or removed the item from the middle.

    LazyColumn {
        items(users, key = { user -> user.id }) { ... }
    }
    
  • Changed Indication#createInstance to be @Composable, and changed LocalIndication to contain an Indication, not () -> Indication. ( I5eeea , b/157150564 )

  • 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 )

  • Modifier.clickable now doesn't have double and long click support. Use Modifier.combinedClickable to achieve this functionality. ( Iafad1 )

  • toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )

  • IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )

  • Modifier.dragGestureFilter has been deprecated. Use Modifier.pointerInput { detectDragGestures (...)} instead. Alternatively, use Modifier.draggable for one axis drags ( I0ba93 , b/175294473 )

  • Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )

  • Selection was moved to foundation. ( I7892b )

  • Similarly to how we previously removed state { 0 } composable and now promote usage like remember { mutableStateOf(0) } we are going to remove savedInstanceState { 0 } composable. You should use rememberSaveable { mutableStateOf(0) } instead and it will save and restore automatically if the type used inside the MutableState can be stored in the Bundle. If previously you were passing a custom saver object now you need to use a new overload of rememberSaveable which has the stateSaver parameter. The usage will look like this: val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) } ( Ib4c26 , b/177338004 )

  • Added password semantics for accessibility ( I231ce )

  • Added ProgressBarRangeInfo.Indeterminate to mark indeterminate progress bars for accessibility ( I6fe05 )

  • Playtime in animation is now unfiied to nanoseconds ( If776a )

  • @ComposableContract has been deprecated in favor of three more specific annotations.

    @ComposableContract(restartable = false) has become @NonRestartableComposable @ComposableContract(readonly = true) has become @ReadOnlyComposable @ComposableContract(preventCapture = true) has become @DisallowComposableCalls @ComposableContract(tracked = true) has been removed. ( I60a9d )

  • emptyContent() and (@Composable () -> Unit).orEmpty() utilities have been deprecated as they no longer have any positive performance impact or value ( I0484d )

  • Recomposers can now be closed. Closed recomposers will continue recomposition until composition child coroutines complete. Recomposer.shutDown renamed to cancel to contrast with close. ( Ib6d76 )

  • APIs related to LazyVerticalGrid are marked as experimental ( Ia53e3 , b/178519862 )

  • rememberSavedInstanceState() was renamed to rememberSaveable() and moved to androidx.compose.runtime.saveable package. ( I1366e , b/177338004 )

  • RestorableStateHolder was renamed to SaveableStateHolder and moved to androidx.compose.runtime.saveable package. Inner method RestorableStateProvider was renamed to SaveableStateProvider. Generic type was removed so you can just pass Any as a key. Experimental annotation is not needed anymore. ( I0902e , b/174598702 )

  • Saver, listSaver(), mapSaver(), autoSaver was moved from androidx.compose.runtime.savedinstancestate to androidx.compose.runtime.saveable ( I77fe6 )

  • Artefact androidx:compose:runtime:runtime-saved-instance-state was renamed to androidx:compose:runtime:runtime-saveable ( I6dcac )

  • Many longstanding deprecated APIs in the ui package are deleted. ( I2f2dc )

  • The compose:runtime-dispatch artifact is now deprecated. MonotonicFrameClock can now be found in compose:runtime and AndroidUiDispatcher can be found in compose:ui. ( Ib5c36 )

  • Parameters on RounderCornerShape, CutCornerShape and CornerBasedShape were renamed from left/right to start/end in order to support the shape's auto mirroring in the rtl direction. AbsoluteRounderCornerShape and AbsoluteCutCornerShape were introduced for the cases when auto-mirroring is not desired. ( I61040 , b/152756983 )

  • canDrag has been removed from the Modifier.scrollable. ( Id66e7 , b/175294473 )

  • The API the Compose compiler plugin targets has been refactored to use an interface instead of a concrete class. The interface also no longer uses a type parameter.

    This is an internal change that should not effect source code compatibility but is a binary breaking change. ( I3b922 , b/169406779 )

  • Modifier.scaleGestureFilter has been removed. Use Modifier.zoomable instead. Alternatively, use Modifier.pointerInput { detectMultitouchGestures { ... }} ( Id5da1 , b/175294473 )

  • AnimatedValue/Float is now deprecated. Please use Animatable instead. ( I71345 , b/177457083 )

    • Removed CoreText and CoreTextField from public API
    • Removed deprecated SelectionContainer overload ( I99c19 )
  • Remove deprecated non-suspend scrolling functions Continuing with the changes from last release, the non-suspend scrolling functions are now removed entirely. Please convert to the suspend functions with the same names. A coroutine scope can be obtained via rememberCoroutineScope(). ( I3d39c , b/178169563 )

  • androidx.compose.foundation.layout.ConstraintLayout was deprecated in favor of androidx.constraintlayout.compose.ConstraintLayout. You will need to add a dependency on androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha01 . ( I87adc )

  • tapGestureFilter, doubleTapGestureFilter, longPressGestureFilter and pressIndicaitonGestureFilter have been deprecated. Use Modifier.clickable or Modifier.pointerInput with detectTapGestures function instead. ( I6baf9 , b/175294473 )

  • Removed Recomposer.current() . [Abstract]ComposeView now default to lazily created, window-scoped Recomposers driven by the ViewTreeLifecycleOwner for the window. Recomposition and withFrameNanos-based animation ticks are paused while the host Lifecycle is stopped. ( I38e11 )

  • Recomposer.runningRecomposers now offers a global StateFlow of read-only RecomposerInfo for observing ongoing composition state in the process. Prefer this API to Recomposer.current(), which is now deprecated. ( If8ebe )

Version 1.0.0-alpha11

January 28, 2021

androidx.compose.foundation:foundation:1.0.0-alpha11 and androidx.compose.foundation:foundation-layout:1.0.0-alpha11 are released. Version 1.0.0-alpha11 contains these commits.

Изменения API

  • Deprecate non-suspend scrollBy, remove non-suspend scrollTo

    We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating and/or removing the non-suspend versions of these functions as part of this transition. ( Ie9ced )

  • Deprecate non-suspend smoothScrollBy We now recommend using suspend functions to control scrolling and wait for the scroll to finish. We are deprecating the non-suspend versions of these functions as part of this transition. ( I12880 )

  • Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )

  • BasicTextField received a new parameter called 'decorationBox'. It allows to add the decorations like icons, placeholder, label and similar to the text field and increase the hit target area of it. ( I16996 )

  • canDrag parameter has been removed from the Modifier.draggable ( Ic4bec , b/175294473 )

  • AnimatedFloat.fling that accepts FlingConfig has been removed. Please use suspend Animatable.animateDecay instead. ( I4659b , b/177457083 )

  • Removed data class from the following classes:

    • InlineTextContent
    • LocaleList
    • ( I605c7 )
  • clickable, toggleable and selectable can be created outside of composition now ( I0a130 , b/172938345 , b/175294473 )

  • ScrollableColumn/Row were deprecated. Using ScrollableColumn is less efficient comparing to LazyColumn when you have a large scrolling content because with LazyColumn we can only compose/measure/draw visible elements. To prevent users from going inefficient way we decided to deprecate ScrollableColumn and ScrollableRow and promote usages of LazyColumn and LazyRow instead. Users can still decide they don't need the lazy behaviour and use the modifiers directly like this: Column(Modifier.verticalScroll(rememberScrollState())) ( Ib976b , b/170468083 )

  • New items(count: Int) factory method for scope of LazyColumn/LazyRow/LazyVerticalGrid. items(items: List) and itemsIndexed(items: List) are now extension functions so you have to manually import them when used. New extension overloads for Arrays: items(items: Array) and itemsIndexed(Array) ( I803fc , b/175562574 )

  • The deprecated AbsoluteArrangement was removed. ( Iffa96 , b/177641870 )

  • The propagateMinConstraints parameter was added to Box, for specifying whether the incoming min constraints should be passed to the content of the Box or not. Default is false. ( I0125b , b/152613457 )

Bug Fixes

  • onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
  • WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
  • Changes to factory functions for Font/FontFamily/Typeface

    • Added factory functions that start with capital letter
    • Deprecated previous factory functions with lowercase first letters
    • New factory functions return the FontFamily instead of subclasses
    • Hid constructors of the subclasses, so that they can only be constructed via factory functions.
    • Renamed Font.asFontFamily to Font.toFontFamily
    • ( I42aa7 )
  • Introduced ComposeContentTestRule , which extends ComposeTestRule and defines setContent , which has been removed from ComposeTestRule . Added a factory method createEmptyComposeRule() that returns a ComposeTestRule and does not launch an Activity for you. Use this when you want to launch your Activity during your test, eg using ActivityScenario.launch ( I9d782 , b/174472899 )

  • animateAsState is now animateFooAsState, where Foo is the type of the variable being animated. eg Float, Dp, Offset, etc ( Ie7e25 )

  • Density is now receiver scope for Arrangement interfaces. ( I18aad )

  • TextFieldValue accepts AnnotatedString. However this is an API only change and multi-style text editing is not implemented yet.

    • Removed initial from EditingBuffer constructor parameters. ( I326d5 )
  • invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )

  • AnnotatedString is changed to extend from kotlin.CharSequence. Therefore length and subSequence are now instance functions, and extension functions are removed. ( Iaf429 )

  • Duration and Uptime will be replace with Long milliseconds, and this step removes the dependency of pointer input on those classes. ( Ia33b2 , b/175142755 , b/177420019 )

  • RememberObserver replaces CompositionLifecycleObserver and CompositionLifecycleObserver is now deprecated.

    RememberObserver is a replacement for CompositionLifecycleObserver with 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 composition onRemembered is called for each reference where onEnter is only called once. onEnter was called multiple time if the object was used in subcompositions, such as WithConstraints and Scaffold making the single onEnter call guarantee unreliable and it was removed for RememberObserver .

    RememberObserver adds onAbandoned which is called if the RememberObserver instance is returned from the callback passed to remember but was not remembered in the composition state and, therefore, will never have onRemembered called. 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 of RememberObserver following the single reference recommendation above is tracking an external resource both onForgotten and onAbandoned each indicate that the resource is no longer needed. If the object is tracking work started or resources allocated in onRemembered , onAbandoned can be ignored as it will not be called if onRemembered is called. ( I02c36 )

  • Renamed TransformedText.transformedText to TransformedText.text

    • TransformedText is no longer a data class ( Ie672a )
  • The following classes are not data classes anymore:

    • AnnotatedString
    • ParagraphStyle
    • SpanStyle
    • TextStyle
    • FontWeight
    • TextDecoration
    • TextGeometricTransform
    • TextIndex
    • TextLayoutResult
    • TextLayoutInput ( Iaff99 )
  • Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )

  • Deprecated global coordinates methods and made new window-based coordinates methods. ( Iee284 )

  • Please use ImeAction.None instead of ImeAction.NoAction

    • Please use ImeAction.Default instead of ImeAction.Unspecified ( Ie1bcc )
  • FocusRequester.createRefs is now marked as experimental as it might change. ( I2d898 , b/177000821 )

  • SemanticsPropertyReceiver.hidden was renamed to invisibleToUser and marked @ExperimentalComposeUiApi. AccessibilityRangeInfo was renamed to ProgressBarRangeInfo. stateDescriptionRange was renamed to progressBarRangeInfo. AccessibilityScrollState was renamed to ScrollAxisRange. horizontalAccessibilityScrollState was renamed to horizontalScrollAxisRange. verticalAccessibilityScrollState was renamed to verticalScrollAxisRange. ( Id3148 )

  • Changed VisualTransformation to be a functional interface ( I3bba4 )

  • Leverage TestCoroutineDispatcher in testing ( I532b6 )

  • Removed PointerInputData and modified PointerInputChange to give it all of PointerInputData's fields. Made PointerInputEvent and PointerInputEventData internal because they aren't used in any public API. ( Ifff97 , b/175142755 )

  • Renamed TextInputService.onStateUpdated as updateState ( Id4853 )

  • Remove displaySize as it should be avoided. Typically it is better to use size of onRoot() or window size at least. ( I62db4 )

Version 1.0.0-alpha10

13 января 2021 г.

androidx.compose.foundation:foundation:1.0.0-alpha10 and androidx.compose.foundation:foundation-layout:1.0.0-alpha10 are released. Version 1.0.0-alpha10 contains these commits.

Изменения API

  • ImeOptions and KeyboardOptions are no more a data class ( I3c898 , b/168684531 )
  • VisualTransformation API Changes
    • Renamed OffsetMap to OffsetMapping
    • Renamed OffsetMapping.identityOffsetMap to OffsetMapping.Identity
    • PasswordTransformation is no longer data-class
    • Moved OffsetMapping to its own file
    • ( I0bdf3 )
  • EditOperations API Changes
    • Renamed EditOperation as EditCommand
    • Added Command suffix for EditOperation concrete implementations
    • EditCommand's are no longer data classes
    • Renamed EditOperation.process function to applyTo
    • Renamed InputEventListener to InputEventCallback
    • ( I0a366 )
  • Modified Velocity to have component parts and mathematical operations. ( Ib0447 )
  • Renamed @ExperimentalTesting to @ExperimentalTestApi to be consistent with similar experimental api annotations ( Ia4502 , b/171464963 )
  • Added experimental stickyHeader method for LazyColumn/LazyRow ( I0a81d )
  • Ranamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
  • Deprecated TestUiDispatcher. Use Dispatchers.Main instead ( Ic171f , b/175385255 )
  • Add Toggle to foundation Strings.kt ( I4a5b7 , b/172366489 )
  • Moved nativeClass to ui module and made it internal. Updated usages of nativeClass in equals implementations to use 'is MyClass' instead. ( I4f734 )
  • FlowRow and FlowColumn were deprecated. Please use a custom layout instead. ( I09027 )
  • Modifier.focus() and Modifier.focusRequester() are deprecated. Use Modifier.focusModifier() and Modifier.focusReference() instead. ( I75a48 , b/175160751 , b/175160532 , b/175077829 )
  • Introduced SelectionRegistrar.notifySelectableChange to notify Selectable updates to SelectionManager. ( I6ff30 , b/173215242 )
  • Changed fun Dp.isFinite() to a val Dp.isFinite ( I50e00 )
  • Constraints#satisfiedBy was renamed to isSatisfiedBy. ( I9cf5c )
  • Added isSpecified, isUnspecified, and useOrElse for inline classes with an Unspecified constant. ( I93f7b , b/174310811 )

Bug Fixes

  • New coroutine-based API Animatable that ensures mutual exclusiveness among its animations. New DecayAnimationSpec to support multi-dimensional decay animation ( I820f2 , b/168014930 )
  • Added support for disabled and read-only text fields ( I35279 , b/171040474 , b/166478534 )
  • animate() is now replaced with animateAsState() , which returns a State<T> instead of T . This allows better performance, as the invalidation scope can be narrowed down to where the State value is read. ( Ib179e )
  • Add Semantics role API and add Role as a parameter to clickable, selectable and toggleable SemanticsModifier. Changed Modifier.progressSemantics so that Slider can also use it. ( I216cd )
  • The native keyEvent can now be accessed through keyEvent.nativeKeyEvent ( I87c57 , b/173086397 )

Version 1.0.0-alpha09

16 декабря 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha09 and androidx.compose.foundation:foundation-layout:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.

Изменения API

  • Add Scrollable interface

    This allows ScrollState and LazyListState to be treated as a common type, allowing custom scrolling to be implemented across both types.

    This also moves smoothScrollBy to an extension function on Scrollable, taking advantage of this functionality. ( I2153b )

  • LazyVerticalGrid is added. ( I17267 , b/162213211 )

  • Deprecate LazyColumnFor, LazyRowFor, LazyColumnForIndexed and LazyRowForIndexed. Use LazyColumn and LazyRow instead ( I5b48c )

  • For suspending pointer input APIs, renamed HandlePointerInputScope to AwaitPointerEventScope and handlePointerInput() to awaitPointerEventScope(). ( Idf0a1 , b/175142755 )

  • LazyListState.layoutInfo was added which exposes the list of sizes and offsets of the currently visible items ( If8678 , b/170472532 )

  • Removed ExperimentalPointerInput annotation ( Ia7a24 )

  • InteractionState support for TextFields has been added. ( I61d91 )

  • Add reverseLayout param for LazyColumn/Row. when true items will be composed from the bottom to the top and LazyListState.firstVisibleItemIndex == 0 will mean the first item is located at the bottom. ( I552ae , b/166589935 )

  • verticalArrangement param was added for LazyColumn. horizontalArrangement param was added for LazyRow. Arrangement allows us to add a spacing between items and specify the arrangement of the items when we do not have enough of them to fill the whole minimum size. ( Icf79a , b/170394300 )

  • detectMultitouchGestures now uses one callback with combined centroid, pan, zoom and rotate parameters. ( Ie6e1c )

  • Moved ContentDrawScope to ui-graphics module to be with DrawScope. ( Iee043 , b/173832789 )

Bug Fixes

  • Lambdas in offset modifiers now return IntOffset rather than Float. ( Ic9ee5 , b/174137212 , b/174146755 )
  • Removed SlotTable, SlotReader and SlotWriter from the public API. These were marked as InternalComposeAPI previously. Now they are internal to the compose module.

    CompositionData and CompositionGroup were added as a replacement for the ui-tooling API to use to extract composition information. These are public but are not intended for use outside the ui-tooling API as they provide the raw information the ui-tooling API interprets ( I31a9c )

  • Refactored ShaderBrush to lazily create a shader instance when sizing information of the drawing environment is available. This is useful to define gradients that occupy the full drawing bounds of a composable at composition time, without having to implement custom DrawModifier implementations.

    Deprecated gradient function constructor APIs in favor of factory methods on a Gradient object. ( I511fc , b/173066799 )

  • Modifier.focusObserver is deprecated. Use Modifier.onFocusChanged or Modifier.onFocusEvent instead ( I30f17 , b/168511863 , b/168511484 )

  • Autofill API is now experimental API and requires opt-in ( I0a1ec )

  • Adding destructuring declarations to create FocusRequester instances ( I35d84 , b/174817008 )

  • accessibilityLabel has been renamed to contentDescription. accessibilityValue has been renamed to stateDescription. ( I250f2 )

  • Introduced several new functions in SelectionRegistrar and also renamed onPositionChange to notifyPositionChange. ( Ifbaf7 )

  • AndroidOwner made internal ( Ibcad0 , b/170296980 )

  • New infiniteRepeatable function for creating an InfiniteRepeatableSpec ( I668e5 )

  • The Applier interface has changed to simplify building trees bottom-up instead of top-down.

    The insert() method has been renamed to insertTopDown() .

    A new method, insertBottomUp() , was added.

    An applier either inserts nodes into the tree it is editing using insertTopDown() or insertBottomUp() depending on which performs better.

    Some trees, such as LayoutNode and View , 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 an Applier overrides insertBottomUp() to build a tree bottom-up and insertTopDown() to build the tree top-down. ( Icbdc2 )

  • Added painterResource API to handle opaquely loading Painter objects from either rasterized asset formats (like PNGs) or VectorDrawables. Consumers no longer have to determine the type of asset in advance and can call this method to get a Painter object to use in Image composables or painter modifiers. ( I2c703 , b/173818471 )

  • Added buildAnnotatedString factory function in order to build an AnnotatedString. Deprecated annotatedString builder function. ( Idfe0b )

Version 1.0.0-alpha08

2 декабря 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha08 and androidx.compose.foundation:foundation-layout:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.

Изменения API

  • Removed maxLines parameter from the CoreTextField . If you'd like to constraint the height of the text field by the number of lines, use BasicTextField instead. ( Iec002 )
  • Changed the await*TouchSlop() methods to not detect the pointer down and renamed them to *OrCancellation . Also removed the need for orientationLock parameter. ( Ie96e1 )
  • Added lint check for composable lambda parameter naming and position, to check for consistency with Compose guidelines. Also migrated some APIs using children as the name for their trailing lambda to content , according to the lint check and guidance. ( Iec48e )
  • foundation:foundation-text apis moved to foundation:foundation . The package structure remained the same ( Id3eb2 )
  • New multitouch gesture detector, including helpers for detecting rotation, zoom, and panning. ( Ic459d )
  • New drag gesture detector suspending pointer input API, including orientation locking. ( Icef25 )
  • Renamed VectorAsset to ImageVector Moved and renamed VectorAsset to Builder to be an inner class of ImageVector as per API council guidelines. Added typealias of VectorAssetBuilder to link to ImageVector.Builder for compat. ( Icfdc8 )
  • Renamed ImageAsset and related methods to ImageBitmap. ( Ia2d99 )
  • Moved foundation semantics properties to ui ( I6f05c )
  • Add coroutine-based scrolling APIs:

    Adds LazyListState.snapToItem and LazyListState.smoothScrollBy, as well as lower-level APIs for scroll control. These APIs provide a suspend interface to control scrolling that waits until the scroll is finished before returning. ( Ie5642 )

  • Added a singeLine parameter into BasicTextField, TextField and OutlinedTextField. Set this parameter to true to make the text field a single horizontally scrollable line. ( I57004 , b/168187755 )

  • Gesture detector for tap, double-tap, long press, and press indication were added using the new suspending pointer input. A few utilities were added as well, making it easier for developers to write their own gesture detectors. ( I00807 )

  • Modifier.focusable has need added in foundation. Use this to add focusable behavior to a component, with correct semantics and accessibility. ( I41eb9 , b/152525426 , b/162865824 )

  • Previously deprecated APIs have been removed: Border was removed, use BorderStroke instead. Modifier.drawBorder was removed, use Modifier.border instead. Modifier.gravity was removed, use Modifier.align instead. Stack was removed, use Box instead ( I32c2b , b/172470874 )

  • AbsoluteArrangement was renamed to Arrangement.Absolute. ( If26f2 )

Bug Fixes

  • Moved DrawModifier APIs from the androidx.compose.ui package to the androidx.compose.ui.draw package. Created DrawModifierDeprecated.kt file to include typealiases/helper methods to assist with the migration from the deprecated to the current APIs. ( Id6044 , b/173834241 )
  • Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API council feedback. ( I0bd29 , b/173834241 )
  • <T> was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 )
  • Made PointerInputData's uptime and position fields non-nullable. ( Id468a )
  • MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection. ( I1e6f4 , b/139320372 , b/139320907 )
  • The alignment parameter of Box was renamed to contentAlignment. ( I2c957 )
  • offsetPx modifiers were renamed to offset. They are now taking lambda parameters instead of State. ( Ic3021 , b/173594846 )
  • Added WindowManager.isWindowFocused to check if the host window is in focus, and a WindowFocusObserver that provides an onWindowFocusChanged callback. ( I53b2a , b/170932874 )
  • Added resetInput parameter to TextInputService#onStateUpdated ( I3e8f5 , b/172239032 , b/171860947 )
  • Updated TextFieldValue API
    • made TextFieldValue.composition readonly
    • removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
  • Deprecated Ambients named with Ambient as their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 )
  • Added Android Typeface wrapper. You can load an Android Typeface via typeface function ie typeface(Typeface.DEFAULT) . Also renamed typefaceFromFontFamily() to typeface() ( I52ab7 )
  • Added lint check to check that Modifier factories use androidx.compose.ui.composed {} internally, instead of being marked as @Composable . ( I3c4bc )
  • Added lint check to check that Modifier factory functions are defined as extensions on Modifier, so they can be fluently chained together. ( I07981 )
  • Semantics argument mergeAllDescendants was renamed to mergeDescendants. ( Ib6250 )
  • Time control in tests (TestAnimationClock and its usages) is now experimental ( I6ef86 , b/171378521 )
  • Remove old ui-test module and its stubs ( I3a7cb )
  • TextUnit.Inherit is renamed to TextUnit.Unspecified in consistent with other units. ( Ifce19 )
  • The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
  • foundation:foundation-text module has been merged into foundation:foundation ( Idac0f )
  • Deprecate place(Offset) and placeRelative(Offset). Use overloads with int offsets instead ( I4c5e7 )
  • id was renamed to layoutId for LayoutIdParentData . Measurable.id was renamed to Measurable.layoutId . ( Iadbcb , b/172449643 )

Version 1.0.0-alpha07

11 ноября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha07 , androidx.compose.foundation:foundation-layout:1.0.0-alpha07 , and androidx.compose.foundation:foundation-text:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.

Изменения API

  • Similarly to Modifier.fillMaxSize[Width|Height] we now support fractions in Modifier.fillParentMaxSize[Width|Height] inside the scope of LazyColumn/Row ( I797e2 , b/166586426 )
  • Removed KeyboardOptions.toImeOptions from public API. ( Ic2e45 )
  • The foundation AmbientTextStyle, ProvideTextStyle, and AmbientContentColor have been deprecated. Instead use the new versions available in the Material library. For non-Material applications, you should instead create your own design system specific theming ambients that can be consumed in your own components. ( I74acc , b/172067770 )
  • foundation.Text has been deprecated and replaced with material.Text. For a basic, unopinionated text API that does not consume values from a theme, see androidx.compose.foundation.BasicText. ( If64cb )
  • Added maxLines to TextFields ( Ib2a5b )
  • Update TextFields to accept KeyboardOptions ( Ida7f3 )
  • Added KeyboardOptions for use in TextFields ( I9ca32 )
  • Adds BasicText as a design-unopinionated API for text, parallel to BasicTextField. ( I28268 )
  • ExperimentalLazyDsl annotation was removed. LazyColumn/LazyRow can now be used without adding @OptIn ( Idab7a , b/166584730 )
  • BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
  • BasicTextField has been added as a replacement for both CoreTextField and BaseTextField ( Id4cea )
  • Remove deprecated LazyColumnItems/LazyRowItems ( I1d8a8 )
  • The deprecated composables for sizing to intrinsic measurements were removed. ( I18537 , b/171811496 )
  • relativePaddingFrom was renamed to paddingFrom. The paddingFromBaseline modifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 )
  • The matchHeightConstraintsFirst parameter was added to the aspectRatio modifier, which can be used to specify the modifier to size to height constraints before trying the width correspondents. ( Ie7c43 , b/155290593 )
  • The deprecated DpConstraints was removed. ( I87884 , b/171702471 )

Bug Fixes

  • Introduced ScaleFactor inline class to represent scale factors for the horizontal and vertical axes independent of one another in order to support non-uniform scaling use cases.
    • Added computeScaleFactor method to ContentScale
    • Added ContentScale.FillBounds to perform non-uniform scaling to stretch the src bounds to fully occupy the destination.
    • Added operator methods to compute ScaleFactor parameters with Size parameters.
    • ( Ic96a6 , b/172291582 )
  • captureToBitmap moved to captureToImage. ( I86385 )
  • Marks CoreText as @InternalTextApi. Use BasicText instead. ( I6aaeb )
  • Rename KeyboardOptions as ImeOptions ( I82f36 )
  • Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
  • CoreTextField has been marked as @InternalTextApi. Use BasicTextField instead ( Ie2469 )
  • ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
  • Introduce ui-test-junit4 module ( Ib91f8 )
  • Updated Icon API to take in Color.Unspecified as a possible tint color which will draw the provided asset or painter without a ColorFilter. Previously attempts to ignore tinting with Color.Unspecified would tint with a transparent color ending up with nothing rendered at all. ( I049e2 , b/171624632 )
  • MeasureResult was moved out of MeasureScope. ( Ibf96d , b/171184002 )
  • Several layout related symbols were moved from androidx.compose.ui to androidx.compose.layout.ui. ( I0fa98 , b/170475424 )
  • androidx.ui.test moved to androidx.compose.ui.test ( I9ffdb )
  • FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
  • Added SelectionContainer without the callback ( Ibfadb )
  • Add Tests for SelectionHandles' Positions in SelectionContainer. ( Ie93db )
  • Added Keyboard auto correct IME Option ( I57b8d )

Version 1.0.0-alpha06

28 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha06 , androidx.compose.foundation:foundation-layout:1.0.0-alpha06 , and androidx.compose.foundation:foundation-text:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.

Изменения API

  • androidx.compose.foundation.Icon has been moved to androidx.compose.material.Icon. You can also use the Image component / Modifier.paint() with a Painter if you do not want to use the Material library. ( I9f622 )
  • Added interactionState to Modifier.scrollable, ScrollableColumn and LazyColumnFor ( I81566 , b/169509805 )
  • alignByBaseline was added to RowScope and alignWithSiblings was renamed to alignBy ( I06503 , b/170628732 )
  • Box was made an inline function. ( Ibce0c , b/155056091 )
  • Added maxLines to CoreTextField ( Ibee58 , b/143687793 )
  • Added softwrap to CoreTextField. ( I21a4b )

Исправления ошибок

  • Deprecate VectorPainter in favor of rememberVectorPainter to better indicate that the composable API internally leverages 'remember' to persist data across compositions. ( Ifda43 )
  • Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. ( If0de3 )
  • Added single line keyboard option to CoreTextField ( I72e6d )
  • Renamed Radius API to CornerRadius to better express how it is used throughout Compose. Updated documentation to indicate that negative corner radii are clamped to zero. ( I130c7 , b/168762961 )
  • Add ability to specify inspector info in composed modifier ( Idee08 , b/163494569 )
  • Added KeyboardCapitalization IME Option ( I8ac38 )
  • Fix Rtl Handle Position. ( I6e1e0 )
  • Breaking change: removed the return value from PointerInputFilter.onPointerEvent(...) given that the only value that should be able to be changed in pointer events is consumption data. Instead of returning data from PointerInputFilter.onPointerEvent(...), now you can just mutate the consumption data of the PointerEvents passed in. ( I6acd0 )
  • Added SelectAll option into selection menu ( Ief02b )

Version 1.0.0-alpha05

14 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha05 , androidx.compose.foundation:foundation-layout:1.0.0-alpha05 , and androidx.compose.foundation:foundation-text:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.

Изменения API

  • CoreTextField now supports cursor functionality ( Id23aa )
  • Deprecates contentColor() and currentTextStyle() APIs, and replaces them with AmbientContentColor and AmbientTextStyle ambients respectively. You can access the current value by using .current on the ambient property, as with any other ambient. This was change was made for consistency and to avoid having multiple ways to accomplish the same thing. Additionally renames some ambient properties to better describe their purpose as follows:

    • ContentColorAmbient -> AmbientContentColor
    • TextStyleAmbient -> AmbientTextStyle
    • IndicationAmbient -> AmbientIndication
    • EmphasisAmbient -> AmbientEmphasisLevels
    • RippleThemeAmbient -> AmbientRippleTheme ( I37b6d )

Bug Fixes

  • As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes ( I97611 , b/169797763 )
  • Added Copy/Paste/Cut accessibility actions ( I6db4f )
  • TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. ( I175c9 , b/158830170 )
  • Updated Size.Unspecified parameters to be Float.NaN instead of Float.POSITIVE_INFINITY. Updated Painter implementations to check against Size.Unspecified as well as non-finite Sizes. ( I95a7e )
  • Added Paging Compose module and paging integration ( Ib85da )
  • Modify LazyListScope to receive nullable values ( I1765b )
  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )
  • Added samples for LazyColumn/Row ( Idc16d )
  • Fix for the items and itemsIndexed methods to allow emptyList ( I06647 )
  • Add a DSL for specifying inspector information ( Ic9a22 )
  • Move LongPress into Text. ( Iff2bc )
  • Disable Selection in Text, and a Demo. ( Ie7e97 )
  • Support AnnotatedString to SpannableString conversion for accessibility. ( Ief907 )
  • Removed PointerInputFilter.onPointerInput(...) . PointerInputFilter.onPointerEvent(...) should be used in its place. ( I6f04a )

Version 1.0.0-alpha04

1 октября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha04 , androidx.compose.foundation:foundation-layout:1.0.0-alpha04 , and androidx.compose.foundation:foundation-text:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

Изменения API

  • Stack was renamed to Box. The previously existing foundation.Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. ( I94893 , b/167680279 )
  • Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) ( Ibae92 , b/167680279 )
  • Add a new LazyListState class. This allows for observation and control of the scroll position of LazyRow and LazyColumn components. Instances can be created using rememberLazyListState() and passed into the state parameter of the component. Currently, the first visible item and offsets can be observed in this initial version. ( Ic7cb7 , b/159307669 )
  • Lazy list position and scroll offset are now saved and restored across Activity recreation ( Ie045f , b/166589058 )
  • Add long click semantics action ( I6281b , b/156468846 )
  • MutatorMutex utility added for keeping a single mutator of shared state over time and cancelling conflicting mutators by priority ( I3f975 )
  • Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc ( I554eb , b/168308412 )
  • Removed inlineContent parameter from Text with String input. It won't be used because inlineContent must work with AnnotatedString. ( Ief403 )
  • The deprecated custom Arrangement APIs were removed. ( Ic576d , b/168297922 , b/168297923 )
  • The unbounded parameter was added to wrapContentSize modifiers, which enables measuring the layout element with infinite max constraints. ( I77951 , b/158559319 )
  • We prevented static imports of contents of layout scopes (eg alignWithSiblings in RowScope). The explicit scope alternative should be used instead: with(RowScope) { Modifier.alignWithSiblings(FirstBaseline) } . ( I216be , b/166760797 )

Bug Fixes

  • Updated many Graphics APIs
    • Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
    • Removed Rect.expandToInclude and Rect.join methods
    • Updated Radius documentation to say oval in addition to elliptical
    • Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
    • Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
    • Deprecated Rect.shift in favor of Rect.translate
    • Removed RoundRect.grow and Rect.shrink APIs
    • Renamed RoundRect.outerRect to Rect.boundingRect
    • Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
    • Renamed RoundRect.longestSide to RoundRect.maxDimension
    • Renamed RoundRect.shortestSide to RoundRect.minDimension
    • Changed RoundRect.center to be a property instead of a function
    • Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
    • Removed Size APIs that assumed it was a Rectangle with origin at 0,0
    • Added a destructing API to Radius
    • Migrated various RoundRect extension functions to be properties instead
    • ( I8f5c7 , b/168762961 )
  • Performance optimizations for LazyColumnFor/LazyRowFor scrolling by not doing unnecessary recompositions during every scroll ( I64f65 , b/168293643 , b/167972292 , b/165028371 )
  • Fixed crash in LazyColumnFor/LazyRowFor after scrolling and then changing items and implemented auto scrolling up when the previously visible item was removed so we don't display empty gaps in the end anymore ( I220ab , b/161480164 , b/167855468 )
  • Nesting scrollable in the same direction containers like ScrollableContainer and LazyColumnFor is not allowed anymore. It was never supported and was breaking the fling and all the laziness of composing the items of LazyColumnFor ( I6e101 )
  • Updated many Graphics APIs
    • Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
    • Updated clipPath documentation to refer to Path instead of rounded rectangle
    • Fixed spacing in documentation for right parameter in clipPath
    • Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
    • Renamed dx/dy parameters in inset method to horizontal and vertical
    • Added inset overload that provides the same inset value to all 4 bounds
    • Removed documentation on inset method indicating that inset would be applied to all 4 sides
    • Updated documentation for Rect class
    • Updated comments on Rect parameters to match kdoc style
    • Removed Rect.join and Rect.expandToInclude
    • Created overload for Rect.translate(offset) and deprecated Rect.shift
    • ( If086a , b/167737376 )
  • add AccessibilityScrollState to semantics properties. ( Ifeda9 )
  • Make TextRange inline to avoid object creation. ( Id034b )
  • ParagraphConstraints is removed. Width is directly passed to Paragraph now. ( Ica712 )

Version 1.0.0-alpha03

16 сентября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha03 , androidx.compose.foundation:foundation-layout:1.0.0-alpha03 , and androidx.compose.foundation:foundation-text:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.

Изменения API

  • InnerPadding was renamed to PaddingValues. ( I195f1 , b/167389171 )
  • Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
  • An alignment parameter was added to Stack, which allows specifying the default alignment for all the Stack children. ( Ie80ca , b/164085265 )

Bug Fixes

  • DpConstraints and APIs using it were deprecated. ( I90cdb , b/167389835 )
  • The parameters minWidth and maxWidth of widthIn were renamed to min and max . Similarly for preferredWidthIn , heightIn , preferredHeightIn . ( I0e5e1 , b/167389544 )
  • Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
  • Fixed size and position calculations in GestureScope, which caused amongst others generation of invalid swipe gestures ( Iaf358 , b/166589947 )
  • Moved createAndroidComposeRule and AndroidInputDispatcher from androidx.ui.test.android to androidx.ui.test ( Idef08 , b/164060572 )

Version 1.0.0-alpha02

2 сентября 2020 г.

androidx.compose.foundation:foundation:1.0.0-alpha02 , androidx.compose.foundation:foundation-layout:1.0.0-alpha02 , and androidx.compose.foundation:foundation-text:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

Bug Fixes

  • TestUiDispatcher is marked experimental ( Iae99d , b/161247083 )
  • Added ManualFrameClock.hasAwaiters to see if anything is awaiting a frame from that clock; runWithManualClock as a replacement for runBlocking when running tests that need a ManualFrameClock; TestUiDispatcher.Main that gives easy access to the main UI dispatcher in your tests.

    Например:

    @Test
    fun myTest() = runWithManualClock { clock ->
        // set some compose content
        withContext(TestUiDispatcher.Main) {
            clock.advanceClock(1000L)
        }
        if (clock.hasAwaiters) {
            println("The clock has awaiters")
        } else {
            println("The clock has no more awaiters")
        }
    }
    

    ( I0a85b , b/161247083 )

Version 1.0.0-alpha01

August 26, 2020

androidx.compose.foundation:foundation:1.0.0-alpha01 , androidx.compose.foundation:foundation-layout:1.0.0-alpha01 , and androidx.compose.foundation:foundation-text:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

Version 0.1.0-dev

Version 0.1.0-dev17

19 августа 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev17 , androidx.compose.foundation:foundation-layout:0.1.0-dev17 , and androidx.compose.foundation:foundation-text:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.

Изменения API

  • The spacedBy Arrangement was added for Row and Column, to enable positioning layout children with a fixed spacing. The aligned Arrangment was also added, to enable positioning layout children one next to the other and aligned in the Row/Column according to an Alignment. The previous Arrangement.Vertical#arrange and Arrangement.Horizontal#arrange methods were deprecated, and writing custom Arrangements will not be supported in the future. ( I6733d , b/161985975 )
  • Offset has become an inline class ( Iaec70 )
  • Removed onFocusChanged callbacks from TextField. Use Modifier.focusObserver instead. ( I51089 , b/161297615 )
  • Modifier.drawBorder has been deprecated. Use Modifier.border instead. Border data class has been replaced by BorderStroke ( I4257d , b/158160576 )
  • VerticalScroller and HorizontalScroller have been removed. Use ScrollableColumn/Row instead. Modifier.drawBackground has been removed. Use Modifier.background ( I73b0d , b/163019183 )
  • Remove marked as deprecated fillMax* modifiers from LazyItemScope as they are making it harder to add such modifiers correctly for items which are not direct children of LazyColumnFor ( Ifa78d )
  • added LazyColumn/LazyRow implementation as DSL ( I93cc6 )
  • Constraints is now an inline class ( I88736 )
  • Added the ability to size a layout to a fraction of the available space, using the fillMaxWidth, fillMaxHeight and fillMaxSize modifiers. ( I945bb , b/161562591 )

Bug Fixes

  • Added a modifier param to SelectionContainer ( I4aada , b/161487952 )
  • Added mergePolicy lambda to SemanticsPropertyKey. This can be used to define a custom policy for mergeAllDescendants semantics merging. The default policy is to use the parent value if already present, otherwise the child value. ( Iaf6c4 , b/161979921 )
  • PlacementScope.placeAbsolute() was renamed to PlacementScope.place() , and the previous PlacementScope.place() was renamed to PlacementScope.placeRelative() . As a result, the PlacementScope.place() method will not automatically mirror the position in right-to-left contexts anymore. If this is desired, use PlacementScope.placeRelative() instead. ( I873ac , b/162916675 )
  • Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. ( I5e889 )
  • Added backgroundColor parameter to LinearProgressIndicator and removed internal padding from CircularProgressIndicator. Added new ProgressIndicatorConstants.DefaultProgressAnimationSpec which can be used as the default AnimationSpec when animating progress between values ( If38b5 , b/161809914 , b/161804677 )
  • The state { ... } composable is now deprecated in favor of explicit calls to remember { mutableStateOf(...) } for clarity. This reduces the overall API surface and number of concepts for state management, and matches the by mutableStateOf() pattern for class property delegation. ( Ia5727 )
  • Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors ( I5d325 )
  • Removed onChildPositioned and OnChildPositionedModifier. Developers should use onPositioned and OnPositionedModifier on the child layout instead. ( I4522e , b/162109766 )
  • IntSize is now an inline class ( I2bf42 )
  • LongPress the Blank Area to Edit. ( Ib1e5b )
  • Hide FloatingToolbar After Tapping on the Text. ( If4525 )
  • Hide FloatingToolbar When Updating the Selection. ( I8444c )
  • Deselect When Blur. ( I781a2 )

Version 0.1.0-dev16

5 августа 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev16 , androidx.compose.foundation:foundation-layout:0.1.0-dev16 , and androidx.compose.foundation:foundation-text:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.

Изменения API

  • LazyItemScope was added for itemContent param of Lazy lists. It provides modifiers to fill the parent max size which solves the use case when the item should fill the viewport and the regular Modifier.fillMaxSize() doesn't work as the item is measured with infinity constraints. ( Ibd3b2 , b/162248854 )
  • Move dialog to ui ( I47fa6 )
  • Added LazyColumnForIndexed/LazyRowForIndexed - versions of LazyColumnFor/LazyRowFor which provides both index and item in the itemCallback. It is useful when in addition to a current item you need to know a current index. ( I65ff3 )
  • Modifier.deternimateProgress has been renamed to Modifier.progressSemantics ( I9c0b4 )
  • LazyColumnItems was renamed to LazyColumnFor. LazyRowItems was renamed to LazyRowFor ( I84f84 )
  • Add some Marks/Annotations for best practice reason. ( I66b20 )
  • foundation.shape.corner package were flatten to foundation.share ( I46491 , b/161887429 )
  • Added сrossaxis gravity param for LazyRowItems/LazyColumnItems. LazyRowItems/LazyColumnItems now support wrap content behaviour. ( Ib39fc )
  • ZoomableState has been renamed to ZoomableController. Custom curve support has been added for smoothScale. enabled and onZoomStarted functionality has been added ( If8b8f )
  • Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use ( Ia6242 , b/155482676 )
  • Previously deprecated AdapterList has been removed. Use LazyColumnItems instead ( I12b9b )
  • Modifier.drawBackground has been renamed to Modifier.background ( I13677 )
  • The old ConstraintLayout DSL was removed. ConstraintSet2 has been renamed to ConstraintSet. ( If58d1 , b/162450908 )
  • Added Modifier.absoluteOffset() and Modifier.absoluteOffsetPx(). Unlike offset modifiers, absolute offset modifiers will not auto-mirror in right-to-left context ( I3aa21 )
  • Row and Column are now inline function significantly reducing the overhead of using them. ( I75c10 )

Bug Fixes

  • Address broad API fixes ( I077bc )
    1. Remove unused OffsetBase interface
    2. Align Offset and IntOffset classes to have a consistent API surface
    3. Rename IntOffset.Origin to IntOffset.Zero to be consistent with Offset API
    4. Moved nativeCanvas method off of Canvas interface to support consumers to create their own Canvas instances
    5. Created stub EmptyCanvas class to refactor DrawScope to be a non-null parameter instead of lateinit and ensure non-nullability of the field
    6. Renamed ClipOp enums to be Pascal Case
    7. Renamed FilterQuality enums to be Pascal Case
    8. Renamed StrokeJoin enums to be Pascal Case
    9. Renamed PointMode enums to be Pascal Case
    10. Renamed PaintingStyle enums to be Pascal Case
    11. Renamed PathFillType enums to be Pascal Case
    12. Renamed StrokeCap enums to be Pascal Case
    13. Updated DrawCache implementation to no longer use lateinit params
    14. Updated DrawScope to no longer use lazy delegation for fillPaint and strokePaint internal parameters
    15. Updated Image composable to avoid Box usage for less overhead
    16. Updated Outline class to have @Immutable annotations
    17. Updated PathNode to have @Immutable annotations for each path instruction
    18. Updated Vector subcomposition to remove redundant conditional checks for equality as compose already handles them
    19. Deprecated Rect companion constructor methods in favor of function constructors
    20. Updated Brush classes and function constructors with @Immutable and @Stable APIs
    21. Updated VertexMode enum to be PascalCase
    22. Updated DrawScope selectPaint method to conditionally overwrite stroke parameters on the paint if they have changed
    23. Updated Size to add destructuring API, rename UnspecifiedSize to Unspecified and removed unused methods
  • Added MonotonicFrameAnimationClock that enables you to use a MonotonicFrameClock as an AnimationClockObservable to bridge the gap between the new coroutines based clocks and APIs that still use the old callback based clocks.

    The MonotonicFrameClock equivalent of ManualAnimationClock is now ManualFrameClock. ( I111c7 , b/161247083 )

  • Removed SemanticsNodeInteraction.performPartialGesture . Use SemanticsNodeInteraction.performGesture instead. ( Id9b62 )

  • Renamed SemanticsNodeInteraction.getBoundsInRoot() to SemanticsNodeInteraction.getUnclippedBoundsInRoot() ( Icafdf , b/161336532 )

  • The APIs for right-to-left support has been updated. LayoutDirectionAmbient has been added, which can be used to read and change the layout direction. Modifier.rtl and Modifier.ltr have been removed. ( I080b3 )

  • Modifier.plus has been deprecated, use Modifier.then instead. 'Then' has a stronger signal of ordering, while also prohibits to type Modifier.padding().background() + anotherModifier , which breaks the chain and harder to read ( Iedd58 , b/161529964 )

  • Added isFocused() and isNotFocused() SemanticsMatcher. ( I0b760 )

  • RemeasurementModifier was added. It allows users to synchronously remeasure the layout. In general, you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll. ( I5f331 , b/160791058 )

  • isSystemInDarkTheme now always considers the system-wide dark theme setting, and ignores power saving status before Q, following latest guidance. ( I0c10c )

  • OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )

  • Renamed AndroidComposeTestRule to createAndroidComposeRule. ( I70aaf )

  • Add accessibility action to get TextLayoutResult ( I9d6e6 )

Version 0.1.0-dev15

22 июля 2020 г.

androidx.compose.foundation:foundation:0.1.0-dev15 , androidx.compose.foundation:foundation-layout:0.1.0-dev15 , and androidx.compose.foundation:foundation-text:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.

To use the 0.1.0-dev15 version of Compose, you will need to:

Dependencies Update

  • To use the 0.1.0-dev15 version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies .

Изменения API

  • Similarly to the new param in ScrollableColumn/ScrollableRow LazyColumnItems/LazyRowItems now also have contentPadding param which allows to add a padding for the content after it has been clipped, which is not possible via just a modifier param. It also allows to add a spacing only before first item/after last item. ( Ibc24e )
  • onFocusChange callback in text fields renamed to onFocusChanged ( Ida4a1 )
  • VerticalScroller and HoriziontalScroller have been deprecated. Use ScrollableColumn and ScrollableRow for build-in experience with Column/Row behaviour and parameters, or Modifier.verticalScroll and Modifier.horizontalScroll on your own element. Similarly, ScrollerPosition has been deprecated in favor of ScrollState' ( I400ce , b/157225838 , b/149460415 , b/154105299 )
  • Modifier.draggable and Modifier.scrollable APIs were reworked. DragDirection was removed in favor of Orientation. State required for scrollable has beed simplified. ScrollableState has been renamed to ScrollableController ( Iab63c , b/149460415 )
  • Single-value semantics properties now use a calling style. For example, 'semantics { hidden = true }' is now written as: semantics { hidden() } . ( Ic1afd , b/145951226 , b/145955412 )
  • Corner sizes used by RoundedCornerShape and CutCornerShape can now be larger than 50% ( Id2340 , b/160400213 )
  • Changed the default ContentScale parameter for the Image composable from Inside to Fit. This was done in order to get behavior to scale up the underlying Painter if the layout size is larger than the intrinsic size of the painter while maintaining the aspect ratio. This behavior better matches expectations for providing fixed sizes to the Image while not affecting the default behavior if only the intrinsic size is used to compute the size of the composable. ( I40ae3 , b/159838006 )
  • Use AnimationSpec instead of AnimationBuilder in the top level APIs to clarify the concept of static animation specification -Improve the transition DSL by removing the lambda requirement for creating AnimationSpecs such as tween, spring. They instead take constructor params directly. -Improve the overall ease of use of AnimationSpec opening up constructors instead of relying on builders -Change the duration and delay for KeyFrames and Tween to Int. This eliminates unnecessary type casts and method overloading (for supporting both Long and Int). ( Ica0b4 )
  • Clickable was removed. Use Modifier.clickable ( I84bdf )
  • Added LazyRowItems - Horizontally scrolling analogue of LazyColumnItems ( Ibbcf7 )
  • Introduced low level stateless animation APIs. These APIs ( I63bf7 )
  • androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead ( I4066d , b/155211005 )
  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )
  • androidx.ui.foundation.shape.RectangleShape removed; use androidx.ui.graphics.RectangleShape ( I94939 , b/154507984 )
  • In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. ( Ic0191 )
  • In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. ( I3ad98 )
  • Added Modifier.zoomable for pinch-to-zoom functionality ( Id5d63 )
  • Toggleable component has been deprecated. Use Modifier.toggleable instead ( I35220 , b/157642842 )
  • MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. ( I02b47 , b/157642842 )
  • TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )
  • Adds fontWeight parameter to Text, which was accidentally not added previously ( I56937 )
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I19d02 )
  • VerticalScroller now provides Column out of the box. HorizontalScroller now provides Row out of the box. ( Ieca5d , b/157020670 )
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Iede0b )
  • Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements ( I8425f , b/155287131 )
  • VerticalScroller and HorizontalScroller now support reversed scrolling is isReversed is set on ScrollerPosition ( I953bd )
  • Support adding composables into text layout. ( I1373c )
  • Consolidated CanvasScope implementations so there is now just DrawScope and ContentDrawScope Renamed CanvasScope to DrawScope. Updated DrawScope to implement Density interface and provide LayoutDirection Deleted DrawScope subclass in ContentDrawScope Painter and PainterModifier have been updated to no longer maintain an RTL property themselves as DrawScope provides this already without manually providing it ( I1798e )
  • Removed deprecated DrawBackground API in favor of drawBackground extension APIs on Modifier. Refactored color, brush and paint drawBackground implementations to reduce code paths as well as remove requirement for Modifier to be created as part of composition. ( I0343a )
  • Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )
  • HorizontalScroller and VerticalScroller not restores their scroll position using saved instance state. ( Ia0fae , b/155075048 )
  • FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. ( Ic4826 )
  • Table layout was removed temporarily until we will make it available again with a refreshed API. ( Id88a7 )
  • Created CanvasScope API that wraps a Canvas object to expose a stateless, declarative drawing API surface. Transformations are contained within their own receiver scope and sizing information is also scoped to corresponding inset bounds. It does not require a consumer to maintain its own Paint state object for configuring drawing operations.

    Added CanvasScopeSample as well as updated the demo app to include a declarative graphics demo ( Ifd86d )

  • ColoredRect has been removed. User Box with drawBackground modifier instead ( I983c7 , b/152753731 )

  • Add cursor color customisation to the TextField ( I6e33f )

  • Now it is possible to hide/show software keyboard by using SoftwareKeyboardController which is delivered by onTextInputStarted callback ( I8dc44 , b/151860051 )

  • TextFieldValue used with TextField can now be survive activity recreation when used like this: var text by savedInstanceState(saver = TextFieldValue.Saver) { TextFieldValue() } ( I5c3ce , b/155075724 )

  • Adds commonly used parameters to Text(). If you are currently creating a local text style to pass a small number of these parameters, such as Text(style = TextStyle(textAlign = TextAlign.Center)) , you can now just provide the parameters directly: Text(textAlign = TextAlign.Center) ( I82768 )

  • Replaced CoreTextField/TextField focusIdentifier parameter with FocusNode in order to integrate with focus subsystem. ( I7ea48 )

  • TextField update - in horizontal dimension it will occupy all available space granted to it ( Ib08df , b/154638552 )

  • Added InteractionState and Interaction, making it easier to build components that react to UI state changes such as press, and drag ( Icfe25 , b/152525426 )

  • RectangleShape moved from androidx.ui.foundation.shape.* to androidx.ui.graphics.* ( Ia74d5 , b/154507984 )

  • Replaced all nullable Color uses in API with non-nullable and use Color.Unset instead of null ( Iabaa7 )

  • TextField API update - merged onFocus and onBlur callbacks into a single onFocusChange(Boolean) callback with parameter ( I66cd3 )

  • Renamed ScaleFit to ContentScale Moved ContentScale from ui-graphics to ui-core module to live in the same module as the Alignment API. Renamed FillMaxDimension to Crop Renamed FillMinDimension to Fit Renamed Fit to Inside to better match ImageView.ScaleType equivalents Added documentation indicating that the combination of Crop and Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_CROP and Fit used with Alignment.Center achieves the same result as ImageView.ScaleType.FIT_CENTER Inside used with Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_INSIDE ( I45f09 , b/152842521 )

  • Removes ProvideContentColor, instead just use ContentColorAmbient directly with Providers ( Iee942 )

  • Adds color parameter to text, allowing overriding the color of the text style without needing to manually merge with the style provided in a theme. ( I41a66 )

  • Improve DrawModifier API:

    • Made the receiver scope for draw() ContentDrawScope
    • Removed all parameters on draw()
    • DrawScope has same interface as former CanvasScope
    • ContentDrawScope has drawContent() method ( Ibaced , b/152919067 )
  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. ( I499fa , b/152753731 )

  • Shape theming system is updated according to the Material design specification. Now you can provide small, medium and large shapes to be used by most of the components ( Ifb4d1 )

  • Replaced Modifier plus operator with factory extension functions ( I225e4 )

  • Draggable has been moved to modifier ( Id9b16 , b/151959544 )

  • Moved Text to androidx.ui.foundation package, from androidx.ui.core. ( I87ce5 )

  • add enabled param to Checkbox, Switch and Toggleable ( I41c16 )

  • Ripple is now a Modifier. While Clickable is not yet converted the recommended usage is Clickable(onClick = { ... }, modifier = ripple()) ( Ie5200 , b/151331852 , b/150060763 )

  • Added VectorPainter API to replace existing subcomposition API for vector graphics. Result of subcomposition is a VectorPainter object instead of a DrawModifier. Deprecated previous DrawVector composables in favor of VectorPainter.

    Renamed Image(Painter) API to PaintBox(Painter) Created Vector composable that behaves like the Image composable except with a VectorAsset instead of an ImageAsset ( I9af9a , b/149030271 )

  • Created Image composable to handle sizing/layout in addition to drawing a given ImageAsset to the screen. This composable also supports drawing any arbitrary Painter instance respecting its intrinsic size as well as supporting a given fixed size or minimum size ( Ibcc8f )

  • Button, FloatingActionButton and Clickable now have a separate enabled param. Some of the params on Button were renamed or reordered. ( I54b5a )

  • Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content.

    Created extension method on android.graphics.Bitmap, Bitmap.asImageAsset() , to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework. ( Id5bbd )

  • DrawImage composable was removed. Use ImagePainter to draw image on existing layout, or SimpleImage to introduce Image that takes space ( I595e1 , b/149827027 )

  • Stack component supports right-to-left directionality ( Ic9e00 )

  • Added Icon, IconButton and IconToggleButton, removing AppBarIcon. You can directly replace existing usages of AppBarIcon with IconButton, and they will now have the correct touch target. See the samples for usage information, and see Icons for the provided Material Icons you can use directly with these components. ( I96849 )

  • DrawShape composable was removed. Use DrawBackground modifier instead. ( I7ceb2 )

  • Added AdapterList, a scrolling list component that only composes and lays out the visible items. Currently known issues include that it is vertical-only and does not fully handle all cases of changes to its children. ( Ib351b )

  • Scrollable component has been added, which allows creation of custom Scrollers/Lists ( I5fd37 )

  • Renamed background to DrawBackground and make it to be memorized by default ( Ia0bd3 )

  • Add paddings, border, shape and background param to Box ( I05027 , b/148147281 )

  • Added Canvas component. This composable takes up some size (provided by user) and allows you to draw using CanvasScope ( I0d622 )

  • rename Border modifier to DrawBorder ( I8ffcc )

  • Added Box component for combining layout and drawing common functionality. ( I6e2a7 )

  • Scrollers now exhibit native Android fling motion behavior. ( I922af , b/147493715 )

  • Replaced DrawBorder in favor of Border Modifier ( Id335a )

  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )

  • The percent parameter when creating ConstraintLayout guidelines has been renamed to fraction. ( Ida2db )

  • Added support for margins of ConstraintLayout barriers. ( I47ffe )

  • Fixed RTL support in ConstraintLayout. Added RTL unaware APIs. ( I3b1c7 )

  • A new DSL for ConstraintLayout has been added. Please see the samples for more details. ( Icaa9a )

  • Added the @ExperimentalLayout annotation. ConstraintLayout, FlowRow and FlowColumn are now tagged with it to mark that their APIs are going to change. ( I412a8 )

  • Modifier.padding(InnerPadding) has been added ( I94985 , b/157133803 )

  • Removed deprecated RowAlign, ColumnAlign in Row and Column. ( If60d4 , b/155858731 )

  • Removed deprecated LayoutTag(), please use Modifier.tag() instead. Removed deprecated Modifier.matchParent(), please use Modifier.matchParentSize() instead. ( If8044 )

  • Added the offsetPx layout modifier, which can be used to define (dynamic) offsets in px. ( I5af57 )

  • AlignmentLineOffset composable is deprecated, please use relativePaddingFrom() modifier instead. CenterAlignmentLine composable is removed. ( I60107 )

  • Added defaultMinSizeConstraints layout modifier, which sets size constraints to the wrapped layout only when the incoming corresponding constraints are unspecified (0 for min constraints and infinity for max constraints). ( I311ea , b/150460257 )

  • Container has been removed. Use Box instead ( Ibbc2b , b/151407926 )

  • Removed deprecated LayoutWidth/Height/Size modifiers. ( Ib0bc1 )

  • Added default parameter values for the offset modifier. ( I37f06 )

  • Added symmetric padding modifier. ( I39840 )

  • Removed deprecated LayoutAspectRatio modifier. ( I65a74 )

  • Removed deprecated LayoutAlign modifiers. ( I10877 )

  • Fixed a bug in the width and height modifiers that was causing the wrapped layout to be measured with no opposite axis constraints. ( I210b8 , b/154797971 )

  • Added verticalGravity and horizontalGravity parameters to Row and Column, respectively. ( I7dc5a )

  • Updated wrapContentWidth and wrapContentHeight to expect vertical or horizontal Alignment rather than any Alignment. The gravity modifier was updated to accept vertical or horizontal Alignment. Row, Column and Stack were updated to support custom continuous Alignments. ( Ib0728 )

  • Made Alignment instantiable with arbitrary values. Added 1D Alignments. ( Ia0c05 )

  • Renamed EdgeInsets to InnerPadding. Renamed innerPadding parameter of Material Buttons to paddding. ( I66165 )

  • alignToSiblings now accepts a Measured instead of Placeable. ( I5788d )

  • Added modifiers for sizing to intrinsic measurements and deprecated the components serving this purpose. ( I8295d )

  • Added support for customizing dimensions of children of ConstraintLayout ( Idb1a5 )

  • Removed deprecated Wrap and Center composables. ( I29e23 )

  • Added LayoutModifier2, a new API for defining layout modifiers; deprecated LayoutModifier ( If32ac )

  • RowScope and ColumnScope members are now accessible outside Row and Column. ( I3a641 )

  • Container has been deprecated. Use Box instead. ( I675ce , b/151407926 )

  • Added the LayoutOffset modifier for offsetting layout position ( I0b8a3 )

  • Initial support for Rtl in Compose layout ( Ia5519 )

  • Updated LayoutAlign to not fill the available space anymore ( I2b14f )

  • Removed AspectRatio composable in favor of modifier. Deleted obsolete FlexColumn, FlexRow composables and Spacing modifier ( Iec8a7 )

  • Removed the LayoutInflexible modifier for Row and Column ( I0d820 )

  • Implement Drag Selection Handles to change selection for TextField. ( I27032 )

  • Implements LongPressAndDrag for TextField Selection. ( I17919 )

Исправления ошибок

  • FocusModifier is deprecated in favor of Modifier.focus, Modifier.focusRequester, Modifier.focusObserver. FocusState and FocusDetailedState are deprecated in favor of FocusState2 ( I46919 , b/160822875 , b/160922136 )
  • runOnIdleCompose renamed to runOnIdle ( I83607 )
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. ( I7f164 )
  • Removes previously deprecated Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. ( I663b2 , b/155375067 )
  • Removed obsolete size testing APIs. ( Iba0a0 )
  • Made LayoutNode experimental API ( I4f2e9 )
  • Version 1 of scroll orientation locking is implemented across Compose. ( I1ce7a , b/150289741 )
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
  • Removed layout direction parameter from the measure block of the Layout() function. Layout direction is however available inside the callback through the measure scope object ( Ic7d9d )
  • Add AbsoluteArrangement - allows for arrangement of the children inside the Row without automatic mirroring in RTL ( I3a1df )
  • @Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) ( Id211e )
  • Prior to this change, the compose compiler plugin would non-trivially intercept calls to constructors inside of a @Composable function if there was an ( I5205a , b/158123804 )
  • Add viewModel() composable which allows to create or get already created ViewModel similarly to how it works in Activity or Fragment ( I5fdd1 )
  • Refactored Radius class to be an inline class. Removed companion creation methods in favor of function constructor with default parameter to have the radius along the y-axis match that of the mandatory x-axis radius parameter.

    Updated DrawScope.drawRoundRect to consume a single Radius parameter instead of 2 separate float values for the radius along the x and y axis ( I46d1b )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters. Deleted Px class in its entirety ( I3ff33 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I086f4 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( Id3434 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I97a5a )

  • TextField's cursor has a blinking animation ( Id10a7 )

  • Partial gestures no longer require passing around of a GestureToken ( Id7ae5 )

  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters ( I57bff )

  • Modifier.semantics has been undeprecated to allow usages for high level components. ( I4cfdc )

  • Rename AnnotatedString.Builder.addAnnotationString to addStringAnnotation. ( I5059e )

  • Updated Alignment API and added support for absolute alignment (which does not auto-mirror in Rtl context) ( I38cd3 )

  • Layout and LayoutModifier children can be measured with a different layout direction. ( Ibd731 )

  • Introduce additional optional rect parameter to ImagePainter to support drawing a subsection of underlying ImageAsset ( I0ea9e )

  • Fixed a crash in AdapterList when removing items ( Ic64b0 , b/153195921 )

  • We changed how we measure the first layout you put inside activity.setContent { } block. Previously it was forced to fill the whole activity screen, and now it behaves as if you put your layout inside a Stack: it can be smaller than a screen and will be positioned in the top left screen. If you want the old behaviour you can apply Modifier.fillMaxSize() for your layout. ( Ie88a7 , b/153453714 )

  • ui-text-compose module is renamed as ui-text. ui-text now contains CoreText and CoreTextField composables ( Ib7d47 )

  • ui-text module is renamed as ui-text-core ( I57dec )

  • Moved ui-framework/CoreText, CoreTextField composables under ui-text-compose. You might want to include ui-text-compose in your project. ( I32042 )

  • runOnIdleCompose and runOnUiThread are now global functions instead of methods on ComposeTestRule. ( Icbe8f )

  • [Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using by state { ... } or by mutableStateOf(...) . ( I5312c )

  • DrawLayerModifier and drawLayer() now default clipToBounds and clipToOutline to false. ( I0eb8b , b/152810850 )

  • Renamed LayoutResult to MeasureResult. ( Id8c68 )

  • Deprecated Center composable. It should be replaced either with the LayoutSize.Fill + LayoutAlign.Center modifier, or with one of the Box or Stack composables with suitable modifiers applied ( Idf5e0 )

  • Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. ( If4738 )

  • DrawVector has been changed from a regular composable function to returning a Modifier drawVector() that will draw the vector as a background to a layout. ( I7b8e0 )

  • Replace composable function Clip with modifier drawClip(). DrawClipToBounds is a convenient modifier to use when you only need to clip to the layer bounds with a rectangle shape. ( If28eb )

  • Replaced DrawShadow composable function with drawShadow() modifier. Shadows are now drawn as part of LayerModifier. ( I0317a )

  • androidx.compose.ViewComposer has been moved to androidx.ui.node.UiComposer androidx.compose.Emittable has been removed. It was redundant with ComponentNode. androidx.compose.ViewAdapters has been removed. They are no longer a supported use case. Compose.composeInto has been deprecated. Use setContent or setViewContent instead. Compose.disposeComposition has been deprecated. Use the dispose method on the Composition returned by setContent instead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move ( Idef00 )

  • Deprecated Wrap composable. It can be replaced either with the LayoutAlign modifier or with the Stack composable ( Ib237f )

  • Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )

  • Rename Painter.toModifier to Painter.asModifier as the newly created Modifier has a reference to the original Painter that can be shared across multiple Modifier instances ( I7195b )

  • Support right-to-left direction in LayoutPadding modifier ( I9e8da )

  • Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) ( I11cb1 )

  • Removed ValueHolder class. Restructured AnimatedValue, AnimatedFloat classes to make the animation value field abstract so that subclasses can watch the value update.

    • Added model classes for AnimatedValue, AnimatedFloat, etc.
    • Added a new set of light-weight @Composable API for animating between values.
    • ( I79530 )
  • Breaking changes to the ambients API. See log and Ambient<T> documentation for details ( I4c7ee , b/143769776 )

  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. ( I896c5 , b/158134875 )

  • Fixed a ConstraintLayout bug causing a crash on recompositions. ( Ibee5a , b/158164341 )

  • WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp ( I91b9a , b/149979702 )

  • Renamed LayoutModifier2 to LayoutModifier. ( Id29f3 )

  • Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )

  • LayoutDirectionAmbient is deprecated. To read the layout direction defined by the locale, use localeLayoutDirection on ConfigurationAmbient ( I851b1 )

  • Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )

  • ParentData composable is deprecated. You should either create a modifier which implements ParentDataModifier interface, or use LayoutTag modifier if you simply need to tag layout children to recognize them inside the measure block. ( I51368 , b/150953183 )

  • Add OnPositionedModifier and OnChildPositionedModifier to replace OnPositioned and OnChildPositioned composable functions. ( I2ec8f )

  • Disallow negative padding in LayoutPadding. LayoutOffset should be used instead for negative position offsets. ( Ifb5b1 )

  • WithConstraints got LayoutDirection parameter ( I6d6f7 )

  • Updated the ComposeFlags.COMPOSER_PARAM flag to be true , which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. ( I7971c )

  • Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. ( I0245a )

  • LayoutCoordinates no longer has a position property. The position property does not make sense when considering LayoutModifiers, rotation, or scaling. Instead, developers should use parentCoordinates and childToLocal() to calculate the transform from one LayoutCoordinate to another.

    LayoutCoordinates uses IntPxSize for the size property instead of PxSize. Layouts use integer pixel sizes for layouts, so all layout sizes should use integers and not floating point values. ( I9367b )

  • Improvements to the API surface of Constraints ( I0fd15 )

  • Added TextDirection.Content ( I48f36 )

  • Ajdust the Toolbar Menu to show copy, cut, paste properly. ( Id3955 )

  • Add FloatingToolbar for TextField Selection. ( Ie8b07 )

  • TextDirectionAlgorithm is renamed as TextDirection ( I75ce8 )

  • TextDirection is renamed as ResolvedTextDirection ( I3ff38 )

  • Add HapticFeedback to TextField Selection. ( I58050 )

  • Add Copy, Cut, and Paste methods to TextField Selection. ( Idb70b )

  • TestTag and Semantics have been deleted. Use Modifier.testTag and Modifier.semantics instead ( I15ff0 , b/158841414 )

  • Changed the package name for Locale and LocaleList from androidx.ui.text to androidx.ui.intl ( I8132c )

  • API change: AnnotatedString(builder: Builder) is renamed to annotatedString(builder: Builder) . ( Ia6377 )

  • API change: AnnotatedString.Item is renamed to AnnotatedString.Range . ( I2d44d )

  • Add Toolbar for text related operations. ( I49d53 )

  • New LifecycleOwnerAmbient is now available. Now an Activity you are using with Compose UI should extend androidx.activity.ComponentActivity (or AppCompatActivity). setContent on android.app.Activity is now deprecated ( Idb25a , b/153141084 )

  • ui-android-text package name (androidx.text) replaced with androidx.ui.text.platform in order to align with androidx policy. ( I42711 )