Составление материала

Создавайте пользовательские интерфейсы Jetpack Compose с готовыми к использованию компонентами Material Design. Это точка входа более высокого уровня в Compose, предназначенная для предоставления компонентов, соответствующих описанным на сайте www.material.io.
Последнее обновление Стабильный выпуск Кандидат на выпуск Бета-версия Альфа-релиз
2 октября 2024 г. 1.7.3 - - 1.8.0-альфа03

Структура

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.material:material:1.7.3"
}

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

Котлин

dependencies {
    implementation("androidx.compose.material:material:1.7.3")
}

android {
    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

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

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

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

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

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

Версия 1.8

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

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

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

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

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

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

Изменения API

  • Добавлен новый построитель NavGraphBuilder.bottomSheet для создания нижнего листа с безопасными аргументами (( I28589 , I777db , b/351858980 ))

Версия 1.7

Версия 1.7.2

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

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

Версия 1.7.1

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

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

Версия 1.7.0

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

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

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

  • Компоненты материалов были перенесены для использования новых API-интерфейсов Ripple и больше не запрашивают RippleTheme .
  • Компоненты материала, которые ранее принимали MutableInteractionSource и по умолчанию remember { MutableInteractionSource() } теперь принимают MutableInteractionSource допускающий значение NULL, и вместо этого по умолчанию принимают значение NULL. Если вы не поднимаете и не используете MutableInteractionSource , вам следует передать значение null. Это позволяет некоторым компонентам лениво создавать экземпляры только при необходимости, что повышает производительность. Также рекомендуется внести аналогичные изменения в ваши собственные компоненты.
  • BottomDrawer , ModalBottomSheet , BackdropScaffold и стандартный Bottomsheet переведены в стабильный API.

Версия 1.7.0-rc01

21 августа 2024 г.

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

Версия 1.7.0-beta07

7 августа 2024 г.

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

Версия 1.7.0-beta06

24 июля 2024 г.

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

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

10 июля 2024 г.

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

Версия 1.7.0-beta04

26 июня 2024 г.

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

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

12 июня 2024 г.

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

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

29 мая 2024 г.

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

Изменения API

  • Обновите API для стилизации ссылок: TextLinkStyles перемещены в TextStyle и удалены TextDefaults из материала ( I5477b ).

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

14 мая 2024 г.

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

Изменения API

  • Обновлен API для получения тематических ссылок Material в тексте. В частности, из TextDefaults удалены методы для создания тематических LinkAnnotations и анализа HTML с тематическими ссылками. Вместо этого добавлен класс TextLinkStyles , который позволяет стилизовать ссылки в качестве параметра составного текста. ( I31b93 )

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

1 мая 2024 г.

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

Изменения API

  • Исправлена ​​ошибка backgroundColor не применялся к TextFieldDecorationBox и OutlinedTextFieldDecorationBox . Декоративные коробки теперь принимают параметр shape . ( I371c2 , б/307694651 )
  • RippleConfiguration#isEnabled был удален, а LocalRippleConfiguration стал нулевым. Чтобы отключить пульсацию, вместо предоставления RippleConfiguration с isEnabled = false укажите значение null для LocalRippleConfiguration . ( I22725 )
  • Текстовые ссылки имеют опцию стилизации нажатого состояния в дополнение к обычному стилю, наведению и фокусу. Каждый из методов TextDefaults имеет аргумент pressedStyle для поддержки этого. ( Ic473f , б/139312671 )

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

  • Отступ OutlinedTextField для метки теперь учитывает размер системного шрифта. ( Idc781 )

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

17 апреля 2024 г.

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

Изменения API

  • Текстовые ссылки получили опцию стилизации нажатого состояния в дополнение к обычному стилю, наведению курсора и фокусу. ( I5f864 , б / 139312671 )
  • Добавлен объект TextDefaults , содержащий методы для создания LinkAnnotation и анализа строки с HTML-тегом, которая применяет MaterialTheme к ссылкам. ( I98532 , б / 139312671 )

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

3 апреля 2024 г.

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

Объявление

  • androidx.compose.material больше не требует использования одной и той же версии каждого артефакта в этой группе maven. Пользователи могут смешивать и сопоставлять версии базовых библиотек Compose ( Ie5fba ).

Изменения API

  • Больше значений по умолчанию ModalDrawer и BottomDrawer перемещено в объект DrawerDefaults . ( Ib5b2e )

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

20 марта 2024 г.

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

Изменения API

  • Флаг ScaffoldSubcomposeInMeasureFix был удален. ( I67363 )

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

6 марта 2024 г.

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

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

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

21 февраля 2024 г.

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

Изменения API

  • BottomDrawer переведен из экспериментального уровня в стабильный. BottomDrawerState теперь отображает прогресс как функцию, позволяющую запрашивать прогресс между конкретными целями. BottomDrawerState теперь позволяет настраивать спецификацию анимации, а confirmStateChange больше не является завершающей лямбдой. ( I9c029 , б / 261423850 )
  • BackdropScaffold стал стабильным из экспериментального уровня. Спецификация анимации теперь является спецификацией tween в соответствии с рекомендациями. Параметр snackbarHost BackdropScaffold больше не является последним параметром, чтобы избежать путаницы с конечными лямбда-выражениями. BackdropScaffoldState предоставляет API progress(from, to) для запроса прогресса между привязками. ( I73f48 , б/261423218 )
  • Стандартные нижние листы были повышены из экспериментальных до стабильных. Устаревшие конструкторы были удалены. Спецификация анимации теперь является спецификацией анимации в соответствии с рекомендациями. ( I3c1a8 , б/278692145 , б/261409034 )
  • Модальные нижние листы были повышены из экспериментальных до стабильных. Устаревшие конструкторы были удалены. Спецификация анимации теперь является спецификацией tween в соответствии с рекомендациями. ( Ic53f4 , б/278692145 , б/266780235 , б/261409034 )

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

  • Исправлена ​​проблема, из-за которой BackdropScaffold мог аварийно завершить работу в определенных сценариях в сочетании с LookaheadScope . ( I51396 )
  • Удалена подкомпозиция внутри BottomSheetScaffold для повышения производительности. Исправлена ​​проблема, из-за которой BottomSheetScaffold аварийно завершал работу в определенных сценариях в сочетании с LookaheadScope . ( I2f90c )
  • Удалена подкомпозиция внутри ModalBottomSheetLayout , что повышает производительность. ( I7a025 )

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

7 февраля 2024 г.

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

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

24 января 2024 г.

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

Изменения поведения

  • Компоненты материалов были перенесены для использования новых API-интерфейсов Ripple и больше не запрашивают RippleTheme .

Изменения API

  • rememberRipple и RippleTheme устарели из Material-Ripple, а в библиотеки материалов и других систем проектирования добавлены новые API-интерфейсы Ripple и RippleConfiguration .

  • Компоненты материала, которые ранее принимали MutableInteractionSource и по умолчанию запоминали { MutableInteractionSource() } теперь принимают MutableInteractionSource допускающий значение NULL, и вместо этого по умолчанию принимают значение NULL. Если вы не поднимаете и не используете MutableInteractionSource , вам следует передать значение null. Это позволяет некоторым компонентам лениво создавать экземпляры только при необходимости, что повышает производительность. Также рекомендуется внести аналогичные изменения в ваши собственные компоненты.

Версия 1.6

Версия 1.6.8

12 июня 2024 г.

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

Версия 1.6.7

1 мая 2024 г.

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

Версия 1.6.6

17 апреля 2024 г.

Выпущен androidx.compose.material:material-*:1.6.6 . Никаких изменений с момента последнего релиза.

Версия 1.6.5

3 апреля 2024 г.

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

Версия 1.6.4

20 марта 2024 г.

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

Версия 1.6.3

6 марта 2024 г.

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

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

  • Исправьте регрессию в ExposedDropdownMenu чтобы снова сделать его фокусируемым. ( c0e0ed , б/323694447 )

Версия 1.6.2

21 февраля 2024 г.

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

Версия 1.6.1

7 февраля 2024 г.

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

Версия 1.6.0

24 января 2024 г.

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

Версия 1.6.0-rc01

10 января 2024 г.

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

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

13 декабря 2023 г.

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

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

29 ноября 2023 г.

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

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

15 ноября 2023 г.

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

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

18 октября 2023 г.

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

Изменения API

  • Устареть функции materialIcon в пользу ее перегрузки, которая принимает параметр autoMirror . ( Ia338d )

Исправления ошибок — автоматическое увеличение высоты элемента навигации для большого контента. ( 0c4ecc , б/272336962 )

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

4 октября 2023 г.

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

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

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

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

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

Изменение поведения

  • Удалена функциональность, связанная с ящиками, из BottomSheetScaffold . Оберните BottomSheetScaffold в составной ящик, чтобы добиться прежней функциональности. Пример см. в BottomSheetScaffoldWithDrawerSample . ( I1dcc8 )

Изменения API

  • Введен временный флаг, позволяющий контролировать, должен ли Scaffold измерять дочерние элементы во время измерения или во время размещения. По умолчанию это будет измерение. Если у вас возникли проблемы с новым поведением, сообщите о проблеме. ( If6e3b )

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

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

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

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

  • Добавлена ​​поддержка автоматического зеркального отображения значков при отображении справа налево. Значки в модулях Material-icons-core и Material-icons-extended теперь предоставляют дополнительные наборы значков для поддержки автоматического зеркалирования, если значок это позволяет. Новые наборы имеют префикс Icons.AutoMirrored.Filled... и т. д. и содержат значки, которые будут автоматически зеркально отображаться в макетах RTL. См . список значков материалов , чтобы узнать список значков, которые могут (и должны) автоматически отражаться.

Изменения API

  • Добавлена ​​поддержка автоматического зеркального отображения значков при отображении справа налево. Значки в модулях Material-icons-core и Material-icons-extended теперь предоставляют дополнительные наборы значков для поддержки автоматического зеркалирования, если значок это позволяет. Новые наборы имеют префикс Icons.AutoMirrored.Filled... и т. д. и содержат значки, которые будут автоматически зеркально отображаться в макетах RTL. См . список значков материалов , чтобы узнать список значков, которые могут (и должны) автоматически отражаться. Ранее предоставленные свойства значков для этих значков теперь помечены как устаревшие, и для облегчения миграции предлагается вариант замены блока. Если у вас нет специальной обработки зеркального отображения значков в RTL, мы рекомендуем перейти на новый набор значков. Например, Icons.Filled.ArrowBack следует преобразовать в Icons.AutoMirrored.Filled.ArrowBack . ( I4b511 )

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

23 августа 2023 г.

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

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

  • Исправлена ​​проблема, из-за которой некоторые компоненты, использующие Subcomposition (например, BottomSheetScaffold ) внутри Scaffold внутри LookaheadScope пытались прочитать свой размер слишком рано. ( Если2c5d )
  • Исправлен расчет offset DropdownMenu , поэтому смещения по оси x зависят исключительно от направления локального макета, а смещения по оси y больше не будут меняться на противоположные, когда меню находится в нижней части экрана. ( Iccc74 , б/294103942 )
  • Оптимизированы внутренние компоненты макета BottomSheetScaffold и исправлена ​​потенциальная проблема с BottomSheetScaffold внутри LookaheadLayout . ( Ic0afa )

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

9 августа 2023 г.

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

Изменения API

  • Компоненты Material2 теперь имеют отдельный API для передачи windowInsets для поддержки сквозной функциональности в Android. В отличие от компонентов Material3, компоненты Material2 по умолчанию не поддерживают вставки, и значение следует передавать вручную. Обратитесь к соответствующим образцам для получения инструкций. ( I655e8 )

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

26 июля 2023 г.

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

Изменения API

  • Мы переносим зависимость плотности на уровень компонентов. Это относится к следующим компонентам: SwipeToDismiss и компонентам на основе Sheet. Пожалуйста, используйте новую перегрузку, если плотность является параметром. ( I1846e )
  • Дополнительные аннотации для указания разрешенных входных данных для компонуемых объектов ( I51109 )
  • Обновлены файлы API для подавления аннотаций совместимости ( I8e87a , b/287516207 ).
  • Добавлено новое выравнивание начала для FabPosition ( Ib7aea , b/170592777 ).
  • TextFieldColorsWithIcons в Материале 2 устарел в пользу TextFieldColors . При переопределении leadingIconColor или trailingIconColor также переопределяйте перегрузку с помощью interactionSource . ( Id57ed , р/199377790 )

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

21 июня 2023 г.

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

Изменения поведения

  • includeFontPadding теперь по умолчанию имеет false в типографике Material 2. Стиль высоты строки по умолчанию также был изменен на Trim.None и Alignment.Center , а к TextStyle из Typography добавлен явный lineHeight (в sp). Если вы хотите настроить эти значения, обратитесь к документации API , а также прочтите сообщение в блоге , где содержится подробное объяснение этих изменений. ( Icabc3 , I3f801 , I04c03 )

Изменения API

  • API-интерфейсы Swipeable Material устарели. Пожалуйста, обратитесь к API-интерфейсам AnchoredDraggable от Foundation, которые оптимизированы как для простых, так и для сложных случаев использования. ( I732e0 )

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

  • BottomSheetState , ModalBottomSheetState и BottomDrawerState теперь предоставляют свойство прогресса, указывающее прогресс между текущей (установленной) привязкой и ближайшей привязкой в ​​направлении пролистывания. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )

Версия 1.5

Версия 1.5.4

18 октября 2023 г.

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

Версия 1.5.3

4 октября 2023 г.

Выпущен androidx.compose.material:material-*:1.5.3 . В этой версии нет изменений

Версия 1.5.2

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

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

Версия 1.5.1

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

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

Версия 1.5.0

9 августа 2023 г.

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

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

Изменения API

  • Внесены изменения в API Swipeable1 в BottomSheetScaffold . Параметр confirmStateChange BottomSheetState был переименован в confirmValueChange . progress теперь отображается как значение с плавающей запятой. animateTo и snapTo являются внутренними. Вместо этого используйтеexpand expand() collapse() . direction и overflow были удалены. offset заменен на requireOffset() . I323b4
  • Отметьте функцию snapTo в Drawer как неэкспериментальный API. ( Ib9c18 , б/261425368 )
  • Добавлен параметр цвета дорожки для круговых индикаторов прогресса и параметр ограничения хода как для круговых, так и для линейных индикаторов прогресса. ( Ie668c , б/216325962 , б/222964817 )
  • Переименован ModalBottomSheetState , ModalBottomSheetState.Saver и rememberModalBottomSheetState confirmStateChange ModalBottomSheetState на confirmValueChange . ( Ib48d1 )
  • Добавьте Modifier.minimumInteractiveComponentSize . Его можно использовать для резервирования размера не менее 48.dp, чтобы устранить неоднозначность сенсорного взаимодействия, если размер элемента будет меньше. ( I33f58 , б/258495559 )
  • Внесены изменения в API-интерфейсы Swipeable в ModalBottomSheetLayout . AnimateTo ModalBottomSheetState больше не принимает параметр animationSpec , а выставленное смещение теперь имеет значение NULL. Используйте requireOffset чтобы потребовать смещение. ( Ia2e79 )
  • Добавление аннотации @JvmDefaultWithCompatibility ( I8f206 )
  • Внесены изменения в API Swipeable в ModalDrawer. DrawerState animateTo ModalDrawer. DrawerState был заменен методами open и close, а смещение теперь имеет значение NULL. Используйте requireOffset чтобы потребовать смещение. ( I3de9e )
  • Обновлены ящики и листы для правильной задержки нажатия на случай, если жесты могут стать событиями прокрутки.
  • Добавлен параметр minLines в Material и Material3 Text, TextField и OutlinedTextField , который позволяет установить минимальную высоту компонента с точки зрения количества строк ( I4af1d ).

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

  • Устранена проблема, из-за которой pullRefresh не потреблял скорость, из-за чего отображалась избыточная прокрутка. Также изменена подпись API лямбды onRelease в Modifier.pullRefresh , чтобы возвращать Float для потребляемой скорости ( I7db65 , b/266874741 ).
  • BottomSheetState , ModalBottomSheetState и BottomDrawerState теперь предоставляют свойство прогресса, указывающее прогресс между текущей (установленной) привязкой и ближайшей привязкой в ​​направлении пролистывания. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )
  • Исправлено действие закрытия AlertDialog , которое отображалось под действием подтверждения, когда действия накладывались друг на друга, чтобы соответствовать ширине диалогового окна. Это исправление приводит реализацию в соответствие со спецификацией Material Design. ( I029de , б/235454277 )
  • BottomSheetScaffold больше не будет участвовать во вложенной прокрутке, если gesturesEnabled установлено значение false. ( I634f3 , б/215403277 )
  • Исправлена ​​ошибка, из-за которой BottomSheetScaffold аварийно завершал работу при предоставлении пустого содержимого для слотов. ( Ib24a5 , b/235588730 )
  • Исправляет PullRefreshIndicator перехватывающий события кликов/указателя. ( 2494256 , б/271777421 )
  • Исправлена ​​проблема, из-за которой ModalBottomSheetLayout аварийно завершал работу в крайнем случае при изменении ориентации. Анимация макета (например, Modifier.animateContentSize ) внутри/на содержимом листа теперь работает плавно. ( I2f981 , б / 266780234 )

Версия 1.5.0-rc01

26 июля 2023 г.

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

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

28 июня 2023 г.

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

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

  • BottomSheetState , ModalBottomSheetState и BottomDrawerState теперь предоставляют свойство прогресса, указывающее прогресс между текущей (установленной) привязкой и ближайшей привязкой в ​​направлении пролистывания. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )

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

7 июня 2023 г.

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

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

24 мая 2023 г.

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

Изменения API

  • Смещение DrawerState и BottomDrawerState больше не обнуляется. Вместо этого они возвращают Float.NaN чтобы указать на отсутствие смещения. ( Ie9855 )
  • Добавлена ​​возможность передать ScrollState при создании DropdownMenu или ExposedDropdownMenu для управления состоянием вертикальной прокрутки отображаемых пунктов меню. ( Idb009 , б/185304441 )
  • Добавьте поддержку включения/отключения жеста ModalBottomSheetLayout , чтобы пользователь мог настроить его для более функционального нижнего листа ( I40af0 ).
  • В BasicText добавлен параметр цвета, позволяющий эффективно анимировать или устанавливать цвет текста. ( Ifffd88 , б / 246961787 )
  • Переименование свойства семантики isContainer в isTraversalGroup ( I121f6 ).

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

  • Исправлено действие закрытия AlertDialog , которое отображалось под действием подтверждения, когда действия накладывались друг на друга, чтобы соответствовать ширине диалогового окна. Это исправление приводит реализацию в соответствие со спецификацией Material Design. ( I029de , б/235454277 )

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

10 мая 2023 г.

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

Изменения API

  • Мы переносим зависимость плотности на уровень компонентов. Это относится к следующим компонентам: BottomDrawer , ModalBottomSheetLayout , BottomSheetScaffold , Switch , ModalDrawer . Пожалуйста, используйте новую перегрузку, если плотность является параметром. ( I8fbd8 )

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

19 апреля 2023 г.

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

Изменения API

  • Обновите внутренние компоненты BottomDrawer , чтобы использовать новые API SwipeableV2 . Из-за этого BottomDrawerState теперь будет иметь APIS, определенный только на уровне класса, он не будет наследовать методы/свойства от SwipeableState . Мы используем композицию с внутренним SwipeableV2State . Offset теперь является свойством с плавающей запятой, допускающим значение NULL, а доступ к текущему значению и целевому значению пролистывания по-прежнему можно получить через свойства currentValue и targetValue. Предыдущие методы уровня класса, такие как open/expand/close, и такие свойства, как isOpen/isClosed продолжают поддерживаться. ( Iad40c , б / 178529942 , б / 220676296 )

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

  • Обновлены внутренние компоненты компонента Switch. Переключатель теперь будет просматривать ближайшее (целевое состояние) при перетаскивании. ( Ид90d4 )
  • Анимированное содержимое листа (например, Modifier.animateContentSize в содержимом листа) в BottomSheetScaffold было оптимизировано и теперь работает без сбоев. ( Ia913c , б/270518202 , б/254446195 )
  • BottomSheetScaffold больше не будет участвовать во вложенной прокрутке, если gesturesEnabled установлено значение false . ( I634f3 , б/215403277 )

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

5 апреля 2023 г.

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

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

  • Исправлена ​​ошибка, из-за которой BottomSheetScaffold аварийно завершал работу при предоставлении пустого содержимого для слотов. ( Ib24a5 , b/235588730 )
  • Исправлены события перехвата кликов/указателя PullRefreshIndicator ( 2494256 , b/271777421 ).

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

22 марта 2023 г.

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

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

  • Добавьте образец перекомпоновки группы микросхем. Обновите горизонтальное заполнение между дочерними чипами в образце однострочной группы чипов, чтобы оно соответствовало спецификации. ( I3b155 )
  • Исправлена ​​проблема, из-за которой ModalBottomSheetLayout аварийно завершал работу в крайнем случае при изменении ориентации. Анимация макета (например, Modifier.animateContentSize ) внутри/на содержимом листа теперь работает плавно. ( I2f981 , б / 266780234 )

Версия 1.4

Версия 1.4.3

3 мая 2023 г.

androidx.compose.material:material-*:1.4.3 выпущен без изменений (только обновление версии).

Версия 1.4.2

19 апреля 2023 г.

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

Версия 1.4.1

5 апреля 2023 г.

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

Версия 1.4.0

22 марта 2023 г.

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

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

Изменения API

  • Добавьте Modifier.minimumInteractiveComponentSize . Его можно использовать для резервирования размера не менее 48.dp, чтобы устранить неоднозначность сенсорного взаимодействия, если размер элемента будет меньше. ( I33f58 , б/258495559 )
  • Внесены изменения в API-интерфейсы Swipeable в ModalDrawer . animateTo DrawerState был заменен методами open и close, а смещение теперь имеет значение NULL. Используйте requireOffset чтобы потребовать смещение. ( I3de9e )
  • Добавлен параметр minLines в Material и Material3 Text, TextField и OutlinedTextField , который позволяет установить минимальную высоту компонента с точки зрения количества строк ( I4af1d ).
  • Добавлен параметр minLines в BasicText и BasicTextField . Это позволяет установить минимальную высоту этих составных элементов с точки зрения количества строк ( I24294 , b/122476634 ).

Версия 1.4.0-rc01

8 марта 2023 г.

androidx.compose.material:material-*:1.4.0-rc01 выпущен без изменений. Версия 1.4.0-rc01 содержит эти коммиты.

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

22 февраля 2023 г.

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

Изменения API

  • Внесены изменения в API-интерфейсы Swipeable в BottomSheetScaffold . Параметр confirmStateChange BottomSheetState был переименован в confirmValueChange . progress теперь отображается как значение с плавающей запятой. animateTo и snapTo являются внутренними. Вместо этого используйтеexpand expand() collapse() . direction и overflow были удалены. offset заменен на requireOffset() . ( I323b4 )

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

  • Удалены семантические роли из кликабельных и выбираемых поверхностей, обновлены компоненты, которые использовали их для задания ролей с помощью modifier.semantics ( Ibb4ba ).
  • Небольшое обновление расширенных значков материалов, которое настраивает заполненные значки desktop_mac , directions и kitchen . ( I65f5e )

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

8 февраля 2023 г.

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

Изменения API

  • Устранена проблема, из-за которой pullRefresh не потреблял скорость, из-за чего отображалась избыточная прокрутка. Также изменена подпись API лямбды onRelease в Modifier.pullRefresh , чтобы возвращать Float для потребляемой скорости ( I7db65 , b/266874741 ).
  • Восстановлен метод получения свойства LocalMinimuTouchTargetEnforcement , помечен как устаревший и перенаправлен на LocalMinimumInteractiveComponentEnforcement . ( I60dd5 )

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

25 января 2023 г.

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

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

  • Исправлена ​​проблема, из-за которой состояние ModalBottomSheetLayout's HalfExpanded рассчитывалось неправильно, и лист казался плавающим. ( I8c615 , б / 265610459 )
  • Исправлена ​​ошибка в ModalBottomSheetLayout , из-за которой лист в некоторых случаях аварийно завершал работу при переходе из скрытого состояния в видимое. ( Я9265 , б/265444789 )

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

11 января 2023 г.

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

Изменения API

  • Добавлено свойство семантики IsContainer на Surfaces. Это свойство будет использоваться в последующих изменениях, определяющих порядок обхода на основе семантического значения таких элементов, как поверхности. ( I63379 )
  • Отметьте функцию snapTo в Drawer как неэкспериментальный API. ( Ib9c18 , б/261425368 )
  • Добавлен параметр цвета дорожки для круговых индикаторов прогресса и параметр ограничения хода как для круговых, так и для линейных индикаторов прогресса. ( Ie668c , б/216325962 , б/222964817 )
  • Переименован ModalBottomSheetState , ModalBottomSheetState.Saver и rememberModalBottomSheetState confirmStateChange ModalBottomSheetState на confirmValueChange . ( Ib48d1 )
  • Больше обнуляемых типов возвращаемых устаревших скрытых функций ( Ibf7b0 ).
  • Добавьте Modifier.minimumInteractiveComponentSize . Его можно использовать для резервирования размера не менее 48.dp, чтобы устранить неоднозначность сенсорного взаимодействия, если размер элемента будет меньше. ( I33f58 , б/258495559 )
  • Внесены изменения в API-интерфейсы Swipeable в ModalBottomSheetLayout . animateTo ModalBottomSheetState больше не принимает параметр animationSpec , а offset теперь имеет значение NULL. Используйте requireOffset чтобы потребовать offset . ( Ia2e79 )

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

  • Лист ModalBottomSheetLayout теперь имеет максимальную ширину 640 dp. ( I71a4f , б / 234927577 )
  • Устранена проблема, из-за которой rememberPullRefreshState не обновляла refreshThreshold и refreshingOffset с течением времени. ( Ифед10 , б/263159832 )
  • Прогресс индикаторов прогресса теперь правильно ограничен ожидаемым диапазоном. ( I8a7eb , б / 262262727 )
  • Если ModalBottomSheetState еще не получил никаких привязок, он обновит currentValue без анимации при вызове snapTo или animateTo вместо выдачи исключения. ( I2c91b )
  • Исправлено включенное состояние в реализации FilterChip Материала 2. ( Id326a , б/261329817 )
  • Исправлена ​​ошибка, из-за которой ModalBottomSheetLayout аварийно завершал работу, если он был HalfExpanded при повороте из книжной ориентации в альбомную. Убедитесь, что вы передаете правильное initialValue , например, проверив конфигурацию. ( Ie8df7 , б/182882364 )
  • Исправлена ​​проблема, из-за которой ModalBottomSheetLayout аварийно завершал работу, если содержимое листа было пустым. ModalBottomSheetLayout теперь допускает пустое содержимое листа. Если содержимое листа пусто, оно будет иметь только скрытое состояние. ( Ic2288 , б/200980998 , б/216693030 )

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

  • При обновлении с androidx.compose.foundation:1.4.0-alpha03 до androidx.compose.foundation:1.4.0-alpha04 может возникнуть ошибка java.lang.NoSuchFieldError . Здесь изначально сообщалось о проблеме. Исправление отправлено и будет доступно в следующем обновлении Compose. В качестве обходного пути обновите библиотеки androidx.compose.material и androidx.compose.material3 до последней версии (1.1.0-alpha04) или понизьте версию androidx.compose.foundation до 1.4.0-alpha03.

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

7 декабря 2022 г.

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

Изменения API

  • Добавление аннотации @JvmDefaultWithCompatibility ( I8f206 )
  • Внесены изменения в API Swipeable в ModalDrawer . animateTo DrawerState был заменен методами open и close , а смещение теперь имеет значение NULL. Используйте requireOffset чтобы потребовать смещение. ( I3de9e )
  • Добавлен API-модификатор для запроса информации о прокрутке предков. ( I2ba9d , б/203141462 )
  • Используется в Clickable для правильной задержки взаимодействия с нажатием, когда жесты могут стать событиями прокрутки.
  • Исправлены Clickables , которые неправильно задерживали пульсацию при использовании внутри Scrollable ViewGroup .
  • Обновлены ящики и листы для правильной задержки нажатия на случай, если жесты могут стать событиями прокрутки.

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

  • Исправлена ​​проблема, в которой PullRefreshIndicator мог застрять после того, как вызывает onRefresh , если освежающее состояние не было изменено на True. ( IE2416 , B/248274004 )

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

  • Составьте пользовательский интерфейс и составление материала теперь зависят от жизненного цикла 2.5.1. ( I05ab0 , b/258038814 )

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

9 ноября 2022 г.

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

Изменения API

  • awaitFirstDown и waitForUpOrCancellation теперь принимают PointerEventPass для большей гибкости. ( I7579a , b/212091796 )
  • Добавлен параметр minLines в текст материала и материала3, TextField и OutlinedTextField , что позволяет установить минимальную высоту компонента в терминах количества строк ( i4af1d )
  • Добавлен параметр minLines в BasicTex T и BasicTextField . Это позволяет устанавливать минимальную высоту этих композиционных товаров с точки зрения количества строк ( i24294 , b/122476634 )

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

24 октября 2022 года

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

Изменения API

  • Был добавлен новый метод, awaitEachGesture() , для детекторов жестов. Он работает аналогично forEachGesture() , но петля над жестами полностью работает в пределах AwaitPointerEventScope , поэтому события не могут быть потеряны между итерациями.
  • forEachGesture() был устарел в пользу awaitEachGesture() потому что он позволяет терять события между жестами. ( Iffc3f , b/251260206 )

Версия 1.3

Версия 1.3.1

9 ноября 2022 г.

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

Версия 1.3.0

24 октября 2022 года

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

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

Поведение нарушение изменения

  • Максимальная поддерживаемая высота в диалогах и всплывающих окнах была уменьшена до 8DP.

Изменения API

  • Добавьте компонент на вытягивании для сочинения ( I29168 ).
  • Изменить имя параметра с значений на значение в Rangeslider ( i3b79a ).

Версия 1.3.0-rc01

5 октября 2022 г.

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

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

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

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

Изменения API

  • Добавить компонент по вытаскиванию в рефреш для составления ( i29168 )

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

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

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

Без изменений с 1.3.0-бета01

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

24 августа 2022 г.

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

Поведение нарушение изменения

Максимальная поддерживаемая высота в диалогах и всплывающих окнах была уменьшена до 8DP.

Максимальная поддерживаемая высота для композиционных диалогов и всплывающих окнов была уменьшена с 30dp до 8dp. Это изменение влияет как на материалы, так и пользовательские диалоги и всплывающие окна. Это изменение сделано для смягчения ошибки доступности в версиях Android ниже S, а также для обеспечения того, чтобы службы доступности в этих окнах могли взаимодействовать с контентом внутри диалога или всплывающего окна.

На вас повлияют это изменение только в том случае, если вы создаете пользовательский диалог или всплывающую реализацию с повышением уровня, выше 8DP. Подумайте о том, чтобы снизить высоту диалога или всплывающего окна. Если вам нужно отказаться от этого нового поведения, рассмотрите возможность поднять свой собственный диалог или всплывающее окно с желаемым набором высоты. Это не рекомендуется, так как доступность может быть негативно повлияла, и он находится на разработчике, чтобы обеспечить нижнюю часть диалога или всплывающего окна взаимодействовать и читаемой с помощью служб доступности.

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

10 августа 2022 г.

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

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

27 июля 2022 г.

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

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

  • Исправлена ​​проблема AnimatedVisibility с FloatingActionButton в каркасе ( i3a0ae , b/224005027 )

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

29 июня 2022 г.

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

Изменения API

  • Изменить имя параметра от значений на значение в RangeSlider ( i3b79a )

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

  • Обновите образец значка, чтобы предоставить более значимое описание контента. ( I10b9d )

Версия 1.2

Версия 1.2.1

10 августа 2022 г.

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

Версия 1.2.0

27 июля 2022 г.

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

Версия 1.2.0-RC03

29 июня 2022 г.

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

  • Нет изменений с 1.2.0-RC02.

Версия 1.2.0-RC02

22 июня 2022 года

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

Версия 1.2.0-rc01

15 июня 2022 года

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

Изменения API

  • Интерфейсы в библиотеках Compose теперь созданы с использованием методов интерфейса JDK8 по умолчанию ( I5BCF1 )

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

  • Обновляет значок с вкладкой ведущего значка, чтобы прикрепить значок на метке вместо значка. ( I90993 )

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

1 июня 2022 г.

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

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

  • Исправлена ​​ошибка, в которой BottomSheetScaffold пробил верхнюю тень панели приложений. BottomSheetScaffold теперь также учитывает состояние листа при размещении закусочных: в разрушенном состоянии закуски расположены над листом и тканью; В расширенном состоянии закусочные привязаны к дне листа. ( IA80B5 , B/1877771422 )

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

18 мая 2022 г.

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

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

11 мая 2022 г.

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

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

  • Это первая бета -версия 1.2!

Изменения API

  • Переименованные в TextFieldDefaults.BorderStroke Composable, который привлекает пограничный ход в OutlinedTextField to TextFieldDefaults.BorderBox . ( I5f295 )

Версия 1.2.0-Alpha08

20 апреля 2022 года

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

Изменения API

  • Частичное потребление (вниз или положение) было устарело в PointerInputChange . Вы можете использовать consume() для полного потребления изменения. Вы можете использовать isConsumed , чтобы определить, использовал ли кто -то еще ранее изменение.
  • PointerInputChange::copy() теперь всегда делает мелкую копию. Это означает, что копии PointerInputChange будут потребляться после использования одной из копий. Если вы хотите создать несвязанный PointerInputChange , вместо этого используйте конструктор. ( IE6BE4 , B/225669674 )

Версия 1.2.0-Alpha07

6 апреля 2022 г.

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

Версия 1.2.0-Alpha06

23 марта 2022 г.

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

Изменения API

  • Обновления API Clicable Card, чтобы следовать изменениям на поверхности API ( i56bcb )
  • Обновления для Material 2 Surface API, который добавляет дополнительные перегруженные функции для выбираемых и перегруженных поверхностей. ( Ifcca5 )

Версия 1.2.0-Alpha05

9 марта 2022 года

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

Изменения API

  • LazyVerticalGrid и LazyHorizontalGrid теперь стабильны. ( I307c0 )
  • LazyVerticalGrid/LazyHorizontalGrid и все связанные API были перемещены в. Грид. Пожалуйста, обновите свой импорт с Androidx.compose.foundation.lazy до androidx.compose.foundation.lazy.grid. ( I2d446 , b/219942574 )
  • Обратное предыдущее изменение полагаться исключительно на вид для WindowInsetsControllerCompat и снова требуется окно, которое требуется для управления некоторыми окнами. Устаревший ViewCompat.getWindowInsetsController в пользу WindowCompat.getInsetsController , чтобы убедиться, что используется правильное окно (например, если представление находится в диалоге). ( I660ae , b/219572936 )
  • Текст: includeFontPadding теперь отключается по умолчанию. Проблемы с отсечением в результате includeFontPadding=false обрабатывается, и для высоких сценариев не должно происходить обрезка. ( I31C84 , B/171394808 )
  • Добавлен новый API LazyVerticalGrid для определения размеров поперечной оси ( I17723 )

Версия 1.2.0-Alpha04

23 февраля 2022 г.

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

Изменения API

  • Add support for filter chips ( i39a6e , b/192585545 )
  • Добавлен TextFieldDecorationBox и OutlinedTextFieldDecorationBox . Использование их вместе с BasicTextField поможет вам создать пользовательское текстовое поле на основе текстовых полей дизайна материала, но с большими параметрами для настройки.
  • Предоставил способ отрегулировать горизонтальные и вертикальные прокладки в текстовых полках. ( I8c9f1 , b/203764564 , b/191543915 , b/189971673 , b/183136600 , b/179882597 , b/168003617 )
  • Добавлен ComposableTarget , ComposableTargetMarker и ComposableOpenTarget , которые позволяют отчетность по времени компиляции, когда композиционная функция называется нацеленным на приложение, которое он не предназначен для использования.

    В большинстве случаев аннотации могут быть выведены с помощью плагина компилятора Compose, поэтому использование этих аннотаций непосредственно должно быть редким. Случаи, которые нельзя вывести, включают создание и использование пользовательских прикладных, абстрактных композиционных функций (таких как методы интерфейса), поля или глобальные переменные, которые являются композиционными лямбдами (выводится локальные переменные и параметры), или при использовании ComposeNode или связанных композиционных функций .

    Для пользовательских приложений композиционные функции, которые вызывает ComposeNode или ReusableComposeNode необходимо добавить аннотацию CompoableTarget для функции и любые типы параметров композиции Lambda. Однако рекомендуется создать аннотацию, которая аннотирована с помощью ComposableTargetMarker , а затем отмеченная аннотация вместо ComposableTarget напрямую. Компонируемая аннотация, помеченная ComposableTargetMarker , эквивалентна ComposbleTarget с полностью квалифицированным именем класса атрибутов в качестве параметра приложения. Для примера использования ComposableTargetMarker см. anroidx.compose.ui.UiComposable . ( I38f11 )

Версия 1.2.0-Alpha03

9 февраля 2022 года

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

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

Версия 1.2.0-Alpha02

26 января 2022 г.

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

Изменения API

  • Добавлено NonRestartableComposable к методам, которые являются перегрузкой существующих методов без сложной логики. Это уменьшает сгенерированные компиляторы проверок (равных) для всех параметров, которые повторяются во внутренней функции, которая называется. ( I90490 )
  • Добавьте поддержку чипа действия ( I07100 , B/1925855545 )

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

12 января 2022 года

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

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

  • Теперь зависит от Kotlin 1.6.10 .

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

  • ModalBottomSheetState теперь имеет флаг isSkipHalfExpanded . Он может быть либо установлен через конструктор, либо позже, установив свойство ModalBottomSheetState для isSkipHalfExpanded для true . Обновление значения isSkipHalfExpanded вызывает переоборудование листа. ( I18B86 , B/186669820 )

Версия 1.1

Версия 1.1.1

23 февраля 2022 г.

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

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

  • Исправить NullPointerException на androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList ( AOSP/1947059 , b/206677462 )
  • Исправьте сбой, вызванный контентом буфера обмена во время чтения из буфера обмена на Android. ( I06020 , B/197769306 )
  • Фиксированный RTL в LazyVerticalGrid ( AOSP/1931080 , B/207510535 )

Версия 1.1.0

9 февраля 2022 года

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

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

  • Стабильная поддержка эффекта перепроверчика Android 12
  • Улучшения по поводу достижения целевого размера
  • Обратите внимание, что в отношении сочинения 1.0 компоненты материала будут расширять место для макета, чтобы соответствовать рекомендациям доступности материала для прикосновения целевого размера . Например, Target Button Touch будет расширяться до минимального размера 48x48DP, даже если вы установите размер кнопки меньше. Это выравнивает материал с тем же поведением компонентов дизайна материала, обеспечивая постоянное поведение, если вы смешиваете виды и сочиняете. Это изменение также гарантирует, что при создании вашего пользовательского интерфейса используется компоненты Compose Material, будут выполнены минимальные требования к доступающей целевой доступности.
  • Стабильная поддержка навигационной железной дороги
  • Выпускники ряда ранее экспериментальных API до стабильных
  • Поддержка новых версий Kotlin

Версия 1.1.0-RC03

26 января 2022 г.

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

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

Обратите внимание, что в отношении сочинения 1.0 компоненты материала будут расширять место для макета в соответствии с руководящими принципами доступа к материалам, касающимся целевого размера. Например, Target Button Touch будет расширяться до минимального размера 48x48DP, даже если вы установите размер кнопки меньше. Это выравнивает материал с тем же поведением компонентов дизайна материала, обеспечивая постоянное поведение, если вы смешиваете виды и сочиняете. Это изменение также гарантирует, что при создании вашего пользовательского интерфейса используется компоненты Compose Material, будут выполнены минимальные требования к доступающей целевой доступности.

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

  • Добавлено некоторую лучшую информацию отладки для инспектора макета при осмотре минимальных модификаторов Touch Target. ( AOSP/1955036 )

Версия 1.1.0-rc01

15 декабря 2021 г.

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

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

  • Исправьте радиус углового, который применяется для Checkbox ES ( I38B03 , B/175198975 , B/2023094440 )

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

1 декабря 2021 г.

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

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

  • Обновлено, чтобы быть совместимым с Kotlin 1.6.0

Версия 1.1.0-BETA03

17 ноября 2021 г.

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

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

3 ноября 2021 года

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

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

  • Рибплы и другие показания теперь будут отложены только в том случае, если они находятся в контейнере модификатора. ( Ibefe0 , b/203141462 )

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

27 октября 2021 г.

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

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

  • Рибплы теперь поддерживают состояния зависания и фокусировки, поэтому зависание / фокусировка компонента, такого как кнопка, теперь покажет правильное наложение состояния.

Версия 1.1.0-Alpha06

13 октября 2021 г.

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

Изменения API

  • Была добавлена ​​перегрузка без ребенка для макета, с повышенной эффективностью ( IB0D9A )
  • Внедрение ExposedDropdownMenu на основе ExposedDropdownMenuBox с TextField и DropdownMenu внутри ( IF60B2 )
  • dismissOnOutsideClick был добавлен в PopupProperties , заменив dismissOnClickOutside которая была устарела. Новое свойство получает позицию Click и границы якоря, обеспечивая более тонкий контроль над тем, следует ли вызывать OndismissRequest или нет. Например, это может быть полезно, чтобы предотвратить увольнение якоря для прикосновений на якоре.
    • updateAndroidWindowManagerFlags был добавлен в PopupProperties , предлагая низкоуровневый контроль над флагами, передаваемыми всплывающим окном для Android Windowmanager. Параметр Lambda будут флаги, рассчитанные по значениям PopuppRoperties, которые приводят к флагам Windowmanager: например, фокусируются. Результатом Lambda станут финальные флаги, которые будут переданы Android Windowmanager. По умолчанию UpdateAndroidewindowmanagerflags оставит флаги, рассчитанные по параметрам без изменений. Этот API следует использовать с осторожностью, только в тех случаях, когда всплывающее окно имеет очень конкретные требования к поведению. ( I6e9f9 )

Версия 1.1.0-Alpha05

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

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

Изменения API

  • Добавляет минимальный сенсорный размер целевого размера для компонентов материала, которые не имеют доступной цели. Поскольку это добавляет дополнительное расстояние вокруг компонентов, чтобы убедиться, что они имеют достаточно большую сенсорную цель, это может изменить существующие пользовательские интерфейсы, которые предполагают, что размер этих компонентов является их визуальным размером и не учитывает размер прикосновения. Вы можете использовать экспериментальный локальный состав LocalMinimumTouchTargetEnforcement Local, чтобы отключить такое поведение по всей иерархии, но это предназначено только для того, чтобы быть временным выбором побега при обновлении существующих пользовательских интерфейсов для учета нового минимального размера. ( I9B966 , B/149691127 , B/171509422 )
  • Добавлен экспериментальный интерфейс TextfieldColorsWithicons, расширяя TextfieldColors, чтобы обеспечить взаимодействие для ведущей и TrailingColor. Это позволяет изменять внешний вид Textfield в соответствии с состоянием фокуса. ( I66923 , B/198402662 )

Версия 1.1.0-Alpha04

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

androidx.compose.material:material-*:1.1.0-alpha04 . Версия 1.1.0-Alpha04 содержит эти коммиты.

Изменения API

  • Устаревшие performGesture и GestureScope , которые были заменены на performTouchInput и TouchInjectionScope . ( IA5F3F , B/190493367 )
  • Добавлено touchBoundsInRoot в SemanticsNode , который включает в себя минимальный целевой размер сенсорной цели, чтобы разработчики могли убедиться, что целевые показатели соприкосновения соответствуют минимумам доступности. ( I2e14b , b/197751214 )

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

  • Позвольте CLIP расширить границы с сенсорными целями за пределы области зажима для минимальных целей Touch Target. ( I43e10 , b/171509422 )
  • Обновленные Divider , композируемый для уважения Dp.Hairline для параметра толщины для поддержки рисования одно пиксельные разделители независимо от плотности отображения. ( I16ffb , B/196840810 )

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

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

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

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

  • Обновленная композа 1.1.0-alpha03 чтобы зависеть от Kotlin 1.5.30 . ( I74545 )

Изменения API

  • Добавлен метод испытаний, чтобы получить обрезанные границы. ( I6b28e )
  • Добавлен минимальный сенсорный целевой размер для ViewConfiguration для использования в семантике и вводах указателя для обеспечения доступности. ( IE861C )

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

18 августа 2021 г.

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

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

  • Исправьте поведение SwipeBlestate в случае, когда смещение промахи находится в пределах ошибки закругления якоря. ( I03D39 , B/191993377 )

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

4 августа 2021 г.

androidx.compose.material:material-*:1.1.0-alpha01 . Версия 1.1.0-Alpha01 содержит эти коммиты.

Изменения API

  • Обновленный метод DrawScope#drawImage , который потребляет исходные и назначенные прямы для употребления дополнительного параметра фильтры. Это полезно для пиксельного искусства, которое предназначено для пикселя при масштабировании для пиксельного искусства. Обновлено Bitmappainter + Image Composable, чтобы также употреблять дополнительный параметр фильтры ( IE4FB0 , B/180311607 )
  • Переименовано в Badgebox на Badgedbox, изменили параметры, чтобы принять состав значков. Добавлен компонент значка, который является типичным содержанием значка для бад -бокса. ( I639c6 )
  • Добавлен компонент NavigationRail, см. Документы и образцы для информации об использовании ( i8de77 )

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

  • Добавлены выровненная нижняя образец навигации и демонстрацию приложения каталога. ( I3cffc )
  • Диалоги теперь следуют поведению размеров платформы. Установите использование Pplatformdefaultwidth на false, чтобы переопределить это поведение. ( Iffaed , B/192682388 )
  • Добавлена ​​демонстрация навигационного приложения в приложение каталога. ( I04960 )
  • Добавлен Демо -значок в приложение каталога. ( If285d )

Версия 1.0

Версия 1.0.5

3 ноября 2021 года

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

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

  • Исправлена ​​экземпляры отслеживания аварии. ( AOSP/1792247 )

Версия 1.0.4

13 октября 2021 г.

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

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

  • Обновлено, чтобы зависеть от Kotlin 1.5.31

Версия 1.0.3

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

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

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

  • Обновлено, чтобы зависеть от Kotlin 1.5.30

Версия 1.0.2

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

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

Обновлено, чтобы поддержать выпуск Compose 1.0.2 . Compose 1.0.2 по -прежнему совместим с Kotlin 1.5.21 .

Версия 1.0.1

4 августа 2021 г.

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

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

  • Обновлено, чтобы зависеть от Kotlin 1.5.21 .

Версия 1.0.0

28 июля 2021 г.

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

Основные особенности 1.0.0

Это первый стабильный выпуск Compose. Пожалуйста, смотрите официальный блог Compose Release для получения более подробной информации!

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

  • Если вы используете Android Studio Bumblebee Canary 4 или AGP 7.1.0-alpha04 / 7.1.0-alpha05 , вы можете нанести следующий сбой:

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

    Чтобы исправить, временно увеличивайте свой minsdkversion до 24+ в вашем файле build.gradle . Эта проблема будет исправлена ​​в следующей версии Android Studio Bumblebee и AGP 7.1 . ( б/194289155 )

Версия 1.0.0-RC02

14 июля 2021 г.

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

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

  • Диалоги теперь следуют поведению размеров платформы. Установите usePlatformDefaultWidth на false, чтобы переопределить это поведение. ( Iffaed , B/192682388 )

Версия 1.0.0-RC01

1 июля 2021 года

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

Изменения API

  • Добавлен компонент BadgeBox , см. Документы и образцы для информации об использовании ( I5E284 )
  • useDefaultMaxWidth в PopupProperties был переименован в usePlatformDefaultWidth . ( I05710 )
  • Диалоги теперь могут использовать всю ширину экрана. ( 183929 , б/190810877 )
  • Добавлена ​​внедрение экспериментального диапазона слайдера ( I2F4B3 )

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

  • Чтобы соответствовать спецификациям конструкции материала, изложенные текстовые телефона с недопустимым входом, остановился, используя цвет ошибки для метки, когда метка используется в качестве заполнителя. Последнее верно, когда в текстовом поле нет входного текста, а текстовое поле не в фокусе. С этим изменением значение error:Boolean параметр в функции TextFieldColors.labelColor() также изменился: теперь он вернет false даже если вход недействителен, если этикетка используется в качестве заполнителя. ( I45f78 )

Версия 1.0.0-бета09

16 июня 2021 г.

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

Изменения API

  • Добавлен параметр формы в OutlideTextField, чтобы иметь возможность настроить форму границы ( I8F39E , B/181322957 )
  • TextOverflow изменяется на встроенный класс. ( I433af )

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

  • Scrim in BottomDrawer, FackRopScaffald и ModalbottomSheetlayout исчезнет , ​​затем цвет .

Добавлены правила профиля

Этот релиз добавляет правила профиля к следующим модулям Compose ( i14ed6 ):

  • Androidx.compose.animation
  • Androidx.compect.animation-Core
  • Androidx.compose.foundation
  • Androidx.compose.foundation-layout
  • Androidx.compes.material
  • Androidx.compes.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

Что такое правила профиля?

  • Правила профиля для библиотеки указываются в текстовом файле baseline-prof.txt расположенном в каталоге src/main или эквивалент. Файл указывает правило на строку, где правило в этом случае является шаблоном для сопоставления методов или классов в библиотеке. Синтаксис для этих правил является суперсетом формата профиля искусства, читаемого на человеку, который используется при использовании adb shell profman --dump-classes-and-methods ... Эти правила принимают одну из двух форм для нацеливания на методы или классы.

  • Правило метода будет иметь следующую шаблон:

    <FLAGS><CLASS_DESCRIPTOR>-><METHOD_SIGNATURE>
    
  • И правило класса будет иметь следующий шаблон:

    <CLASS_DESCRIPTOR>
    
  • Здесь <FLAGS> это один или несколько символов H , S и P , чтобы указать, следует ли пометить этот метод как «горячий», «стартап» или «Post Startup».

  • <CLASS_DESCRIPTOR> является дескриптором для класса, которому принадлежит целевой метод. Например, класс androidx.compose.runtime.SlotTable будет иметь дескриптор Landroidx/compose/runtime/SlotTable; .

  • <METHOD_SIGNATURE> является подписью метода и включает имя, типы параметров и типы возврата метода. Например, метод fun isPlaced(): Boolean на LayoutNode имеет подпись isPlaced()Z .

  • Эти шаблоны могут иметь подстановочные знаки ( ** , * и ? ), Чтобы иметь единое правило, охватывать несколько методов или классов.

Что делают правила?

  • Метод, который имеет флаг H указывает, что этот метод является «горячим» методом и должен быть скомпилирован заранее.

  • Метод, который имеет флаг S указывает на то, что это метод, который вызывается при запуске, и должен быть скомпилирован заранее, чтобы избежать стоимости компиляции и интерпретации метода во время запуска.

  • Метод, который имеет флаг P указывает, что это метод, который называется после запуска.

  • Класс, который присутствует в этом файле, указывает на то, что он используется во время запуска и должен быть предварительно выделен в куче, чтобы избежать стоимости загрузки класса.

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

  • Библиотеки могут определить эти правила, которые будут упакованы в артефакты AAR. Когда затем построен APK, который включает в себя эти артефакты, эти правила объединяются вместе, и объединенные правила используются для создания компактного профиля бинарного искусства, характерного для APK. Затем искусство может использовать этот профиль, когда APK установлен на устройствах, чтобы заранее собрать конкретное подмножество приложения для повышения производительности приложения, особенно первого запуска. Обратите внимание, что это не повлияет на отказываемые приложения.

Версия 1.0.0-бета08

2 июня 2021 года

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

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

Изменение API поведения

  • Behriate Breaking: Card теперь потребляет клики, делая клики, добавленные через Card(Modifier.clickable) чтобы быть не-операционным. Пожалуйста, используйте новую экспериментальную перегрузку карты, которая принимает OnClick. ( IA8744 , B/183775620 )
    • Добавлена ​​новая перегрузка карты, которая обрабатывает клики, а также другие функциональные возможности: Индикация, взаимодействие, включено/отключено. Невозможно использовать обычную неплюсируемую карту с Modifier.clickable , потому что карта не будет обрезать индикацию волны в этих случаях.
  • Разрушение поведения: Surface теперь потребляет клики, делая клики, добавляемые через Surface(Modifier.clickable) чтобы быть не-операционным. Пожалуйста, используйте новую экспериментальную перегрузку поверхности, которая принимает OnClick. ( I73e6c , b/183775620 )
    • Добавлена ​​новая перегрузка поверхности, которая обрабатывает клики, а также другие функциональные возможности: Индикация, взаимодействие, включено/отключено. Невозможно использовать обычную неплюсируемую поверхность с Modifier.clickable , потому что в этих случаях поверхность не будет обрезать индикацию пульсации.

Изменения API

  • FabPosition была преобразована в встроенный класс из Enum, чтобы поддержать потенциальное расширение в будущем ( I030FB )
  • Рефакторированные использование перечисления в входные классы, чтобы избежать проблем с исчерпывающими, когда добавляются новые значения перечисления. ( I2b5eb )
  • Добавляет тайм -аут нажатия в Clickable / Toggleable, чтобы предотвратить отображение пульсации во время прокрутки / перетаскивания ( IA2704 , B / 168524931 )
  • Свойства ContentDescription и Text Semantics больше не являются отдельными значениями, а списками. Это позволяет объединять их, как и в случае сознания. Также предоставили API лучшего тестирования для использования этих изменений ( ICA6BF , B/184825850 )
  • Modifier.focusModifier() устарел и заменяется Modifier.focusTarget() ( I6C860 )
  • Заменил Enum FocusState Enum с интерфейсом FocusState ( ICCC1A , B/187055290 )
  • Удален LocalRippleNativeRendering теперь, когда реализация Ripple, поддерживаемая видом, стабильна ( i7fab3 , b/188569367 )

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

  • Modifier.onGloballyPositioned() был изменен, чтобы сообщить о координатах этого модификатора в цепочке модификатора, а не координаты макета после применения всех модификаторов. Это означает, что теперь упорядочение модификаторов влияет на то, что будут сообщать о координатах. ( IEB67D , B/177926591 )
  • Добавлены Readme для существующего каталога материалов Compose. ( If9191 )

Версия 1.0.0-бета07

18 мая 2021 г.

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

Изменения API

  • Вам больше не нужно использовать методы расширения для поддержки маршрута в навигационном комплексе. ( I22beb , b/172823546 )

Версия 1.0.0-бета06

5 мая 2021 г.

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

Изменения API

  • Ripple был мигрирован, чтобы использовать RippleDrawable внутри Android -устройства. Это означает, что анимация Ripple произойдет на renderThread, и поэтому будет гладко, даже если поток пользовательского интерфейса находится под нагрузкой, например, когда навигация между экранами. Это не изменяет поверхность API Ripple, но в результате этого изменения могут быть введены изменения поведения. Чтобы помочь миграции, было добавлено LocalRippleNativeRendering , что было добавлено false значение для этого композиции, чтобы вернуться к предыдущей реализации Ripple внутри CompositionLocalProvider. Этот API будет временным и будет удален в будущем, поэтому, если вы столкнетесь с проблемами, которые заставляют вас использовать этот API, пожалуйста, подайте ошибку . ( I902f8 , b/168777351 , b/183019123 )
  • Добавлены API -интерфейсы CollectionInfo и CollectionIteminfo, которые позволяют отмечать коллекцию и его элементы для служб доступности ( ID54EF , B/180479017 )
  • Добавлена error API доступности, которая позволяет отметить узел, который содержит недопустимый вход ( I12997 , B/180584804 , B/182142737 )

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

  • Обновленная композитная внедрение каталога материалов внедрение из: https://github.com/google/accompanist/pull/365. ( I25dc3 )
  • Дети по ряду и столбцам с весом (Fill = false) больше не заставляют родителя заполнять все доступное пространство основной оси. ( IED94D , B/186012444 , B/184355105 )

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

21 апреля 2021 г.

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

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

  • Добавлены компонентные изображения плитки, сборщик темы и более конкретные URL -адреса меню для существующего каталога материалов Compose. ( I9b58e )

Версия 1.0.0-бета04

7 апреля 2021 года

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

Изменения API

  • Изменение API: состояние DrawerState больше не распространяется на экспериментальный Swipeablestate.
    • Изменение API: BottomDrawerState теперь помечен как экспериментальный, чтобы соответствовать уже экспериментальному компоненту BottomDrawer ( I81114 , B/181656094 )
  • RENAME hideSoftwareKeyboard и showSoftwareKeyboard на SoftwareKeyboardController чтобы hide() и show() соответственно.
    • Предоставьте полный композиционный интерфейс для LocalSoftwarekeyBoardController, позволяя его установить (особенно полезно в тестах) ( i579a6 )
  • Доступен API доступности Liveregion. Если узел помечен как живой регион, службы доступности автоматически уведомит пользователя о его изменениях ( idcf6f , b/172590946 )

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

  • Добавлена ​​внедрение каталога материалов для существующего модуля. В настоящее время отсутствует: компонентные плитки изображения, выбор темы (для добавления в последующих изменениях). ( IE7A94 )

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

24 марта 2021 г.

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

Изменения API

  • DefaultMonotonicFrameClock устарел. Призыв withFrameNanos или Recomposer.runRecomposeAndApplyChanges без MonotonicFrameClock теперь будет выбросить IllegalStateException . ( I4eb0d )
  • Добавлен новый API LeadingIconTab , чтобы поддержать отображение значка и встроенного текста на вкладке. ( I23267 )

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

  • [Jossi Wolf] BottomDrawer теперь завершает содержание слота ящика. BottomDrawer не бросает IllegalStateException , когда родитель имеет бесконечную высоту. Нижний ящик теперь откроется для расширенного состояния, если он меньше 50% своего родителя. Документы вокруг BottomDrawerState и ModalBottomSheetLayoutState были обновлены. BottomDrawerState#isOpen возвращает True сейчас, если он находится в открытом или расширенном состоянии. ( I87241 )

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

10 марта 2021 г.

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

Изменения API

  • Добавлен новый локальный API LocalSoftwareKeyboardController , чтобы заменить предыдущий интерфейс SoftwareKeyboardController на TextField. ( I5951E , B/168778053 )

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

  • Применение ограничений на публичное использование экспериментальных API ( i6aa29 , b/174531520 )
  • Изменил горизонтальный выравнивание по умолчанию для начала Topappbar и BottonAppbar, в соответствии с ROW ( IB2DC7 )
  • Added a new module and placeholder UI for a Compose Material catalog, currently nested in existing integration test demos. ( Idfcb3 )
  • androidx.compose.ui:ui no longer depends on AppCompat or Fragment. If you are using a ComposeView in your application, and you are using Fragment and/or AppCompat, make sure that you are using AppCompat 1.3+ / Fragment 1.3+ - these versions are needed to correctly set lifecycle and saved state owners required for ComposeView. ( I1d6fa , b/161814404 )

Version 1.0.0-beta01

February 24, 2021

androidx.compose.material:material-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

This is the first release of Compose 1.0.0 Beta.

Изменения API

  • 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 )
  • imageResource and vectorResource are now extension functions on ImageBitmap and ImageVector companions respectively. load{Image,Vector,Font}Resource functions have been deleted. ( I89130 )
  • 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 )
  • Switch, Checkbox and RadioButton action lambdas are now nullable. Checkbox-in-clickable-row samples updated to use this feature. ( If601b , b/171819073 )
  • 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 )
  • Add AccessibilityMananger interface and LocalAccessibilityMananger in CompositionLocals ( I53520 )
  • Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
  • Slider now supports enabled/disabled state ( I6d56b , b/179793072 )
  • Created new TextInputSession for input sessions from low level text components such as CoreTextField. ( I8817f , b/177662148 )
  • AnimationEndReason.Interrupted is removed. CancellationException will be throws if animation is interrupted. ( I2cbbc , b/179695417 )
  • Removed @ExperimentalRippleApi and changed RippleAlpha to be a class with properties instead of an interface. ( I6df7c )
  • Added TextFieldColors interface to represent different colors used in TextField and OutlinedTextField in different states. For defaut implementation see TextFieldDefaults.textFieldColors and TextFieldDefaults.outlinedTextFieldColors.
  • 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 )

  • Any composables marked with @ReadOnlyComposable are now compile-time validated to ensure that they only make calls to other @ReadOnlyComposables ( I58961 )

  • TargetAnimation API has been removed. ( If47d1 , b/177457083 )

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

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

  • 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. It is no longer necessary.
    • keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
    • Composer.collectKeySourceInformation has been removed. It is no longer necessary.
    • isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
    • Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
    • ( I99b7d , b/177245490 )
  • Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )

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

  • ZoomableController.smoothScaleBy and ZoomableController.stopAnimation are now suspend functions. ( I7f970 , b/177457083 )

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

  • Made the following Material API changes:

    • Added contentPadding parameter to Top/BottomAppBar to allow customizing the default padding.
    • Reordered parameters in BackdropScaffold to follow API guidelines for required parameters being before optional parameters.
    • Moved icon parameter in BottomNavigationItem to be after selected and onClick .
    • Renamed alwaysShowLabels parameter in BottomNavigationItem to alwaysShowLabel .
    • Renamed bodyContent parameters in a few components to just content .
    • Reordered parameters in ButtonDefaults.buttonColors() . Please note that because the type of the parameters have not changed, this will not cause an error in your code - please ensure you are either using named parameters or update the ordering manually, otherwise your code will not work the same as previously.
    • Added secondaryVariant parameter to darkColors() . This color is typically the same as secondary in dark theme, but adding for consistency and further customization.
    • Removed ElevationDefaults and animateElevation() from the public API surface since they were not commonly used / useful.
    • Renamed onValueChangeEnd in Slider to onValueChangeFinished and made it nullable.
    • Renamed text parameter in Snackbar to content for consistency.
    • Added contentPadding parameter to DropdownMenuItem to allow customizing the default padding and made content be an extension on RowScope .
    • Renamed ModalDrawerLayout to ModalDrawer .
    • Renamed BottomDrawerLayout to BottomDrawer .
    • ( I1cc66 )
  • BasicTextField now accepts Brush instead of Color for better customization ( I83a36 )

  • imageResource and vectorResource are now extension functions on ImageBitmap and ImageVector companions respectively. load{Image,Vector,Font}Resource functions have been deleted. ( I89130 )

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

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

  • 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.material:material-*:1.0.0-alpha12 is 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 )
  • BottomDrawerLayout and ListItem have been marked as @ExperimentalMaterialApi ( Id766e )
  • 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 )
  • 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 )
  • Make halfExpand() and expand() in ModalBottomSheetState internal ( Ic914e )
  • Changed Indication#createInstance to be @Composable, and changed LocalIndication to contain an Indication, not () -> Indication. ( I5eeea , b/157150564 )
  • Moved AlertDialog and DropdownMenu to be Android only for now. Added PopupProperties parameter to DropdownMenu for further configuration of the underlying Popup. ( I9c443 )
  • loadFontResource is deprecated. Use fontResource instead. imageResource, loadImageResource, vectorResource, and loadVectorResource are deprecated. Use painterResource instead. ( I6b809 )
  • Removed toggle and toggleModifier parameter from DropdownMenu, and renamed dropdownModifier , dropdownOffset and dropdownContent to modifier , offset and content respectively. DropdownMenu now behaves consistently to Popup , where the parent layout is used for the position of the menu. In most cases you can move toggle to be a sibling of DropdownMenu and wrap both in a Box . See the updated sample in the documentation for more information on usage of this API. ( I884fb )
  • toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )
  • IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )
  • Added expand and collapse semantics actions. Added expand and halfExpand in ModalBottomSheetState ( Ib5064 )
  • Modifier.dragGestureFilter has been deprecated. Use Modifier.pointerInput { detectDragGestures (...)} instead. Alternatively, use Modifier.draggable for one axis drags ( I0ba93 , b/175294473 )
  • Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )
  • 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 stateSaver parameter. The usage will look like this: val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) } ( Ib4c26 , b/177338004 )
  • Added ProgressBarRangeInfo.Indeterminate to mark indeterminate progress bars for accessibility ( I6fe05 )
  • @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 )

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

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

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

  • Changed Tab's text and icon parameters, and BottomNavigationItem's label parameter to be nullable, to better convey the behavior of the component when these parameters are / are not provided, since it affects the size and layout of the component. If you are currently passing emptyContent() to represent no text / icon / label, you should use null instead. ( I57ed4 )

  • Renamed contentColorFor color parameter to backgroundColor ( I5bb67 )

  • Deprecated TabDefaults and replaced it with TabRowDefaults. ( I0f189 )

  • Introduced ColorMatrix API used to modify rgb values of source content Refactored ColorFilter API to be an interface and match the implementation of PathEffect. ( Ica1e8 )

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

  • Add SemanticsProperties.PaneTitle API. ( I20d5a )

  • Added enabled parameters to Tab and BottomNavigationItem, to prevent them from being clickable. Changed BottomNavigationItem to be RowScope.BottomNavigationItem to better express its layout requirements in its API. ( Id683d )

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

  • Add layoutDirection param to Shape's createOutline. This allows to create layout direction aware shapes. ( I57c20 , b/152756983 )

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

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

  • Icon will now scale up to fit its size, respecting size modifiers applied to it. For example Icon(.., modifier = Modifier.size(50.dp) will now draw in a 50x50dp space. ( Ib2ba9 , b/178796190 )

Version 1.0.0-alpha11

January 28, 2021

androidx.compose.material:material-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.

Изменения API

  • Promotes some Material APIs to no longer be @Experimental ( I5d20e )
  • Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )
  • Changes Material stateful parameter interfaces to have @Composable functions that return State<T> . Adds Animatable.asState() to make it easier to convert an Animatable to a State. Also changes animateElevation to be a suspend extension on Animatable. ( If613c )
  • Snackbar, SnackbarHost, SnackbarHostState are not @ExperimentalMaterialAPI anymore ( Id1fb5 )
  • Changes Typography, Shapes, and TabPosition to no longer be data classes. Adds copy function for Typography and Shapes to replace the generated ones. ( I40037 )
  • Deleted some previously deprecated Material APIs ( Ifaa25 )

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

  • onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
  • TransitionDefinition-based Transition has been deprecated ( I0ac57 )
  • Initial State in updateTransition is now supported ( Ifd51d )
  • WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
  • 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 )

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

  • The ripple used in Button and FloatingActionButton can no longer be customized by providing a new Indication through AmbientIndication - this was never intended to be a way to customize these components and this now makes these components consistent with other Material components. To customize ripples across an application, see RippleTheme. ( I546c5 )

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

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

  • Fix for a bug which made it not possible to set the width of the material text field be less than 280.dp ( I78373 )

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

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

  • Surface can now have multiple layout children. ( I66a92 , b/144488459 )

  • invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )

  • Changes PopupPositionProvider to use window-relative coordinates, not global coordinates. Renames parentGlobalBounds to anchorBounds, and changes windowGlobalBounds to be windowSize: IntSize ( I2994a )

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

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

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

  • Easing has been changed to a functional interface ( Ib14e5 )

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

  • Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )

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

  • Added Modifier.toolingGraphicsLayer which adds a graphics layer modifier when inspection is turned on. ( I315df )

  • FocusRequester.createRefs is now marked as experimental as it might change. ( I2d898 , b/177000821 )

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

  • Leverage TestCoroutineDispatcher in testing ( I532b6 )

  • Updated vector graphics API to support parsing of tinting applied to root of vector graphics. ( Id9d53 , b/177210509 )

Version 1.0.0-alpha10

13 января 2021 г.

androidx.compose.material:material-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.

Изменения API

  • 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 )
  • Renamed Position to DpOffset and removed getDistance() ( Ib2dfd )
  • Ranamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
  • Add Toggle to foundation Strings.kt ( I4a5b7 , b/172366489 )
  • 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 )
  • Moved nativeClass to ui module and made it internal. Updated usages of nativeClass in equals implementations to use 'is MyClass' instead. ( I4f734 )

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

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

Version 1.0.0-alpha09

16 декабря 2020 г.

androidx.compose.material:material-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.

Изменения API

  • added API to manually trigger settle animation and drag in Modifier.swipeable ( Iaa17a , b/162408885 )
  • Renamed *Constants objects such as ButtonConstants to end with Defaults instead, such as ButtonDefaults. Also removes unnecessary default prefixes from properties in these new objects. ( Ibb915 , b/159982740 )
  • Compose supports property getters that can make composable invocations. Support for this is not going away, but the syntax for declaring a property getter as being @Composable is changing.

    The now-deprecated syntax for doing this was by annotating the property itself:

        @Composable val someProperty: Int get() = ...
    

    The now-correct syntax for doing this is by annotating the getter of the property:

       val someProperty: Int @Composable get() = ...
    

    Both syntaxes will work for some time, but the former deprecated syntax will eventually become a compile error. ( Id9197 )

  • Added androidx.compose.material:material-ripple library containing ripple APIs to allow building interactive components without needing the rest of the Material library. rememberRippleIndication has been deprecated and replaced with rememberRipple. ( Ibdf11 )

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

  • Lambdas in offset modifiers now return IntOffset rather than Float. ( Ic9ee5 , b/174137212 , b/174146755 )
  • 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 )

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

  • Moved Dp.VectorConverter, Position.VectorConverter, etc to animation-core, and deprecated the old VectorConveters ( If0c4b )

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

  • New infiniteRepeatable function for creating an InfiniteRepeatableSpec ( I668e5 )

  • The positioning behaviour of DropdownMenus was slightly changed according to the Material spec. ( I34c72 , b/168594123 )

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

  • Added Modifier.clearAndSetSemantics to clear descendants' semantics and set new ones. ( I277ca )

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

Version 1.0.0-alpha08

2 декабря 2020 г.

androidx.compose.material:material:1.0.0-alpha08 , androidx.compose.material:material-icons-core:1.0.0-alpha08 , and androidx.compose.material:material-icons-extended:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.

Изменения API

  • MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection. ( I1e6f4 , b/139320372 , b/139320907 )
  • Added 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 )
  • 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 )
  • fun RippleIndication() has been deprecated and replaced with rememberRippleIndication() for consistency with other APIs. ( Id8e2c )
  • 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 )

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

  • Add semantics action Dismiss ( I2b706 )
  • Moved DrawModifier APIs from the androidx.compose.ui package to the androidx.compose.ui.draw package. Created DrawModifierDeprecated.kt file to include typealiases/helper methods to assist with the migration from the deprecated to the current APIs. ( Id6044 , b/173834241 )
  • Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API feedback. ( I0bd29 , b/173834241 )
  • <T> was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 )
  • Added Modifier.scale/rotate APIs as conveniences for drawLayer.
    • Renamed Modifier.drawOpacity to Modifier.alpha
    • Renamed Modifier.drawShadow to Modifier.shadow ( I264ca , b/173208140 )
  • 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 )
  • Introduced SweepGradientShader and SweepGradientBrush APIs. ( Ia22c1 )
  • Added lint check for Modifier parameters in Composable functions. This lint check checks the naming, return type, default value, and order of the parameter for consistency with Compose guidelines. ( If493b )
  • Updated TextFieldValue API
    • made TextFieldValue.composition readonly
    • removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
  • Added a new Modifier.drawLayer() overload. It takes a lambda block on a new GraphicsLayerScope where you define the layer parameters in a way which allows to skip recomposition and relayout when the state change happens. DrawLayerModifier is now internal in preparation to migrating its logic into placeable.placeWithLayer() method of LayoutModifier ( I15e9f , b/173030831 )
  • Deprecated Ambients named with Ambient as their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 )
  • Added lint check to check that Modifier factories use androidx.compose.ui.composed {} internally, instead of being marked as @Composable . ( I3c4bc )
  • 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 for consistency with other units. ( Ifce19 )
  • The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
  • id was renamed to layoutId for LayoutIdParentData. Measurable.id was renamed to Measurable.layoutId. ( Iadbcb , b/172449643 )

Version 1.0.0-alpha07

November 11, 2020

androidx.compose.material:material:1.0.0-alpha07 , androidx.compose.material:material-icons-core:1.0.0-alpha07 , and androidx.compose.material:material-icons-extended:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.

Изменения API

  • Emphasis has been deprecated and replaced with AmbientContentAlpha. AmbientContentAlpha is a simpler abstraction that represents the preferred content alpha for part of the hierarchy, similar to how AmbientContentColor represents the preferred content color. Text and Icon now consume the current value from AmbientContentAlpha by default, and you can manually do: color.copy(alpha = AmbientContentAlpha.current) to have the same effect in your components. Instead of using ProvideEmphasis, you can just directly provide a value through AmbientContentAlpha, and use the new default levels in ContentAlpha to replace the old EmphasisLevels. ( Idf03e , b/159017896 )
  • Adds androidx.compose.material.AmbientContentColor to replace androidx.compose.foundation.AmbientContentColor ( I84f7b , b/172067770 )
  • Adds androidx.compose.material.Text to replace androidx.compose.foundation.Text as a high level, themeable Text component. For a basic text component that does not consume color / text style from the theme, use BasicText. ( Ie6ae0 )
  • Added maxLines to TextFields ( Ib2a5b )
  • Update TextFields to accept KeyboardOptions ( Ida7f3 )
  • Surface now uses the absolute (total) elevation when calculating elevation overlays, so a Surface nested in another Surface will use the combined elevation to draw the overlay. ( I7bd2b , b/171031040 )

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

  • captureToBitmap moved to captureToImage . ( I86385 )
  • 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 )
  • Rename KeyboardOptions as ImeOptions ( I82f36 )
  • Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
  • BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
  • ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
  • FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
  • 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 )
  • relativePaddingFrom was renamed to paddingFrom. The paddingFromBaseline modifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 )
  • LaunchedTask was renamed to LaunchedEffect for consistency with the SideEffect and DisposableEffect APIs. LaunchedEffect with no subject params is not permitted in order to encourage best practices. ( Ifd3d4 )
  • 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 )

Version 1.0.0-alpha06

28 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha06 , androidx.compose.material:material-icons-core:1.0.0-alpha06 , and androidx.compose.material:material-icons-extended: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 )
  • Adds FloatingActionButtonElevation to represent elevation used by FABs in different states. See FloatingActionButtonConstants.defaultElevation() for the default implementation ( I2d4f5 )
  • Adds SwitchColors interface to represent colors used by a Switch in different states. See SwitchConstants.defaultColors to customize these colors. ( I93805 )
  • Adds ButtonElevation and ButtonColors interfaces to represent elevation and colors used by buttons in different states. See the default functions in ButtonConstants to customize these parameters. ( Ic5b7b )
  • Adds RadioButtonColors interface to represent colors used by a RadioButton in different states. See RadioButtonConstants.defaultColors() to customize the colors used in different states. ( I74130 )
  • Adds CheckboxColors interface to represent colors used by a checkbox in different states. See CheckboxConstants.defaultColors() to customize the colors used in different states. ( I7dbdb )

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

  • Material components do not set the elevation as zIndex anymore. Which means that within the same parent the child with larger shadow size will not be drawn on top of the child with the smaller one automatically. If you still need such behavior please set Modifier.zIndex() manually where needed ( I70417 , b/170623932 )
  • 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 )
  • Refactored DrawScope and ContentDrawScope to be interfaces instead of abstract classes
    • Created CanvasDrawScope implementation of DrawScope
    • Refactored implementations of DrawScope to use CanvasScope instead
    • Created DrawContext to wrap dependencies for DrawScope
    • Removed deprecated methods on DrawScope ( I56f5e )
  • Box was made an inline function. ( Ibce0c , b/155056091 )

Version 1.0.0-alpha05

14 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha05 , androidx.compose.material:material-icons-core:1.0.0-alpha05 , and androidx.compose.material:material-icons-extended:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.

Изменения API

  • Popups and dialogs now inherit FLAG_SECURE from parent Window. Also added option to configure this explicitly ( I64966 , b/143778148 , b/143778149 )
  • Modifier.swipeable has 56.dp thresholds for states by default now ( Iab825 , b/168610267 )
  • all scaffold states marked as @Stable. drawerGesturesEnabled in ScaffoldState moved to Scaffold itself. ( I36645 , b/168297016 )
  • Removes nullable type from Scaffold lambda parameters, you can use emptyContent() to represent no content for a given parameter. ( I2b318 , b/157633857 , b/158551084 )
  • 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 )
  • Adds AmbientElevationOverlay, allowing customizing / disabling the default elevation overlay applied to Surfaces in dark theme. ( I5b74d )

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

  • As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes ( I97611 , b/169797763 )
  • TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. ( I175c9 , b/158830170 )
  • launchInComposition renamed to LaunchedTask to match Compose API guidelines ( I99a8e )
  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )

Version 1.0.0-alpha04

1 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha04 , androidx.compose.material:material-icons-core:1.0.0-alpha04 , and androidx.compose.material:material-icons-extended:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

Изменения API

  • Exposes InteractionState parameters in stateful Material components, to allow hoisting the state and reading / controlling the state. ( Iaca5f , b/168025711 , b/167164434 )
  • Changes the *color parameters on RadioButton and TriStateCheckbox to allow fully customizing the colors used in each state, as well as changing how the colors animate between states if desired. See the new animateDefault* color functions in CheckboxConstants and RadioButtonConstants for more information. ( I1c532 )
  • Renamed rememberBackdropState to rememberBackdropScaffoldState and added an additional param for the animation clock. Renamed the param backdropScaffoldState of BackdropScaffold to just scaffoldState. Renamed BackdropConstants to BackdropScaffoldConstants. ( Ib644d )
  • Added experimental BottomSheetScaffold component. ( Ie02f0 , b/148996320 )
  • Added experimental ModalBottomSheetLayout component. ( Ic209e , b/148996320 )
  • Renames ButtonConstants/FloatingActionButtonConstants.defaultAnimatedElevation to defaultElevation, and now returns a Dp value instead of an AnimatedValue. ( I5f3ed )

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

  • Updated many Graphics APIs
    • Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
    • Removed Rect.expandToInclude and Rect.join methods
    • Updated Radius documentation to say oval in addition to elliptical
    • Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
    • Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
    • Deprecated Rect.shift in favor of Rect.translate
    • Removed RoundRect.grow and Rect.shrink APIs
    • Renamed RoundRect.outerRect to Rect.boundingRect
    • Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
    • Renamed RoundRect.longestSide to RoundRect.maxDimension
    • Renamed RoundRect.shortestSide to RoundRect.minDimension
    • Changed RoundRect.center to be a property instead of a function
    • Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
    • Removed Size APIs that assumed it was a Rectangle with origin at 0,0
    • Added a destructing API to Radius
    • Migrated various RoundRect extension functions to be properties instead
    • ( I8f5c7 , b/168762961 )
  • foundation.Box was deprecated. Please use foundation.layout.Box instead. ( Ie5950 , b/167680279 )
  • Stack was renamed to Box. The previously existing Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. ( I94893 , b/167680279 )
  • Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) ( Ibae92 , b/167680279 )
  • Updated many Graphics APIs
    • Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
    • Updated clipPath documentation to refer to Path instead of rounded rectangle
    • Fixed spacing in documentation for right parameter in clipPath
    • Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
    • Renamed dx/dy parameters in inset method to horizontal and vertical
    • Added inset overload that provides the same inset value to all 4 bounds
    • Removed documentation on inset method indicating that inset would be applied to all 4 sides
    • Updated documentation for Rect class
    • Updated comments on Rect parameters to match kdoc style
    • Removed Rect.join and Rect.expandToInclude
    • Created overload for Rect.translate(offset) and deprecated Rect.shift
    • ( If086a , b/167737376 )
  • 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 )

Version 1.0.0-alpha03

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

androidx.compose.material:material:1.0.0-alpha03 , androidx.compose.material:material-icons-core:1.0.0-alpha03 , and androidx.compose.material:material-icons-extended:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.

Изменения API

  • Renames BottomNavigationItem 's onSelect parameter to onClick ( I91925 , b/161809324 )
  • Adds InteractionState parameter to BottomNavigationItem and Tab, allowing hoisting this state and adjusting how the component appears in different states. ( Ia3e9e , b/168025711 )
  • Removes disabledBackgroundColor and disabledContentColor parameters from buttons. You should instead use the new default color functions inside ButtonConstants. If you are already setting contentColor / backgroundColor explicitly, you should instead use these default functions and customize some / all of the parameters to avoid overwriting the color for both enabled / disabled states. ( If9b52 )
  • Textfield's background color does not implicitly apply transparency alpha anymore. Instead, any color provided through the backgroundColor parameter will be applied directly. ( Iecee9 , b/167951441 )
  • InnerPadding was renamed to PaddingValues. ( I195f1 , b/167389171 )
  • The params resistanceFactorAtMin and resistanceFactorAtMax in Modifier.swipeable were replaced with a single resistance param. A new defaultResistanceConfig method was added in SwipeableConstants . ( I54238 )
  • Adds animated stateful elevation support for Button and FloatingActionButton. The elevation now animates between default and pressed states. To customize the elevation between states, please use ButtonConstants.defaultAnimatedElevation() and FloatingActionButtonConstants.defaultAnimatedElevation() instead of setting a flat Dp value in all cases. ( I37925 )
  • Label became an optional parameter inside TextField and OutlinedTextField ( I267f6 , b/162234081 )

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

  • Global testing functions such as onNode or waitForIdle are now deprecated, please migrate to their new counterparts that are defined on ComposeTestRule ( I7f45a )
  • 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 )
  • Remove scroll forward/backward semantics actions. Added steps in AccessibilityRangeInfo. ( Ia47b0 )
  • Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
  • Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
  • 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.material:material:1.0.0-alpha02 , androidx.compose.material:material-icons-core:1.0.0-alpha02 , and androidx.compose.material:material-icons-extended:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

Изменения API

  • Added an experimental BackdropScaffold component. ( Iad908 )

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

  • Matrix4 was replaced with Matrix. All other parts of vectormath package have been removed. ( Ibd665 , b/160140398 )

Version 1.0.0-alpha01

26 августа 2020 г.

androidx.compose.material:material:1.0.0-alpha01 , androidx.compose.material:material-icons-core:1.0.0-alpha01 , and androidx.compose.material:material-icons-extended:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

Known Issue

= The first character in a material TextField cannot be removed using a backspace ( b/165956313 )

Version 0.1.0-dev

Version 0.1.0-dev17

August 19, 2020

androidx.compose.material:material:0.1.0-dev17 , androidx.compose.material:material-icons-core:0.1.0-dev17 , and androidx.compose.material:material-icons-extended:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.

Изменения API

  • Previously deprecated RadioGroup and RadioGroupItems have been removed. Use Row and RadioBotton instead ( I381b7 , b/163806637 )
  • 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 )
  • Renamed some properties in SwipeableState: swipeTarget -> targetValue, swipeProgress -> progress, swipeDirection -> direction. Added a rememberSwipeableState function for creating SwipeableStates. ( I2fc9c , b/163129614 , b/163132293 )
  • Snackbar support with positioning and proper queueing has been added. Access it via SnackbarHostState.showSnackbar suspend function. Кроме того:
    • SnackbarHost components has been added. It hosts Snackbars based on the state and is responsible for transition between snackbars.
    • SnackbarHostState has been added to allow for control over snackbars, snackbars hosts and to decouple it from the ScaffoldState. you can access this state via scaffoldState.snackbarHostState as well.
    • Snackbar overload has been added to support common interface between snackbarHostState and snackbars itself. ( I79aaa )
  • Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton ( I0a941 , b/161809385 , b/161807956 )
  • ListItem version with String-based API has been removed. Use slot version instead. ( Ib8f57 , b/161804681 )
  • Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. ( I5e889 )
  • AlertDialog now uses FlowRow for buttons ( I00ec1 , b/161809319 , b/143682374 )
  • Added params in Modifier.swipeable for changing the amount of resistance when swiping past the bounds. Removed [min/max]Value params. ( I93d98 )
  • 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 )
  • Optional param velocityThreshold added to Modifier.swipeable. ( I698ba )
  • bottomBarSize, fabSize and others and not available anymore in ScaffoldState. Use Modifier.onPosition instead on the component you'd like to know the size of. contentColor and Modifier pamateres have been added to Scaffold ( Ic6f7b , b/161811485 , b/157174382 )
  • Renames and reorders some parameters in Tab for consistency with other APIs ( Ia2d12 , b/161807532 )
  • Splits TabRow into TabRow and ScrollableTabRow, removing isScrollable from TabRow. Also exposes edgePadding in ScrollableTabRow, which allows controlling the free space before / after the tabs. ( I583e8 , b/161809544 )
  • The TabRow object has been removed, replacing it with TabConstants. TabRow.TabPosition has moved to be top level (TabPosition), and indicatorContainer has been renamed to indicator . See the samples and documentation for detailed information on how to use the updated API, and defaults. ( I54d45 , b/161809544 )
  • The thresholds param in Modifier.swipeable was tweaked; it now takes a pair of states (of type T) and returns the threshold between them in the form of a ThresholdConfig. A param dismissThresholds was added to SwipeToDismiss, which is a lambda (DismissDirection) -> ThresholdConfig. ( Ie1080 )
  • Slider has more colors for granular customization ( I73e64 , b/161810475 )
  • Card's color param was renamed to backgroundColor ( I01fc1 , b/161809546 )
  • Snackbar has customizable background and content colors now ( I238f2 , b/161804381 )
  • modifier, backgroundColor, contentColor and scrimColor customization params has been added to Drawers ( I23655 , b/161804378 )
  • 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 )
  • Button's padding param was renamed to contentPadding ( Id252e , b/161809394 )
  • Add an experimental material component SwipeToDismiss. ( I129e5 )

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

  • Removed onChildPositioned and OnChildPositionedModifier . Developers should use onPositioned and OnPositionedModifier on the child layout instead. ( I4522e , b/162109766 )
  • 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 )
  • IntSize is now an inline class ( I2bf42 )
  • 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 )
  • Deprecated PxBounds in favor of Rect. Updated all usages of PxBounds with rect and added proper deprecate/replace with annotations to assist with the migration. ( I37038 , b/162627058 )
  • Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors ( I5d325 )

Version 0.1.0-dev16

5 августа 2020 г.

androidx.compose.material:material:0.1.0-dev16 , androidx.compose.material:material-icons-core:0.1.0-dev16 , and androidx.compose.material:material-icons-extended:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.

Изменения API

  • Colors is now a final class instead of an interface. Instead of extending and providing a custom implementation, you should create a new ambient for your custom theme object, and access the theme object through the new ambient in your components, similar to how MaterialTheme works internally. ( Ibae84 )
  • Renamed ColorPalette to Colors, to better map to the Material color system and remove confusion over ColorPalette being a 'generic' theming object, as opposed to being a specific implementation of the Material color system. Additionally renames lightColorPalette and darkColorPalette to lightColors and darkColors respectively. ( I9e976 , b/161812111 )
  • Renames BottomNavigationItem's text parameter to label , onSelected to onSelect , activeColor to selectedContentColor , inactiveColor to unselectedContentColor and updates parameter ordering to match guidelines. ( Icb605 , b/161809324 )
  • Modifier.stateDraggable was completely reworked and renamed to Modifier.swipeable. A new SwipeableState class was introduced, and DrawerState and BottomDrawerState were refactored to inherit from it. [Modal/Bottom]DrawerLayout no longer takes an onStateChange parameter. ( I72332 , b/148023068 )
  • foundation.shape.corner package were flatten to foundation.share ( I46491 , b/161887429 )
  • Added ExperimentalMaterialApi annotation. RippleTheme marked as Experimental ( Ic5fa0 , b/161784800 )
  • 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 )

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

  • OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )
  • 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
  • Move dialog to ui ( I47fa6 )
  • 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.deternimateProgress has been renamed to Modifier.progressSemantics ( I9c0b4 )
  • Updates material-icons-extended with the latest icons added to Material.io/icons ( I4b1d3 )
  • Require type T to be explicitly specified for transitionDefinition. ( I1aded )
  • 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 )
  • Renamed AndroidComposeTestRule to createAndroidComposeRule. ( I70aaf )
  • Add isFocused() and isNotFocused() SemanticsMatcher. ( I0b760 )
  • Removed BaseGestureScope.globalBounds , which shouldn't be used from tests. Use coordinates local to the node with which you're interacting instead. ( Ie9b08 )
  • Fixed popup position on cut-out displays. ( Idd7dd )
  • Modifier.drawBackground has been renamed to Modifier.background ( I13677 )

Version 0.1.0-dev15

22 июля 2020 г.

androidx.compose.material:material:0.1.0-dev15 , androidx.compose.material:material-icons-core:0.1.0-dev15 , and androidx.compose.material:material-icons-extended:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.

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

  • @Model annotation is now deprecated. Use state and mutableStateOf as alternatives. This deprecation decision was reached after much careful discussion.

    Обоснование

    Rationale includes but is not limited to:

    • Reduces API surface area and concepts we need to teach
    • More closely aligns with other comparable toolkits (Swift UI, React, Flutter)
    • Reversible decision. We can always bring @Model back later.
    • Removes corner-case usage and difficult to answer questions about configuring @Model as things we need to handle
    • @Model data classes, equals, hashcode, etc.
    • How do I have some properties “observed” and others not?
    • How do I specify structural vs. referential equality to be used in observation?
    • Reduces “magic” in the system. Would reduce the likelihood of someone assuming system was smarter than it is (ie, it knowing how to diff a list)
    • Makes the granularity of observation more intuitive.
    • Improves refactorability from variable -> property on class
    • Potentially opens up possibilities to do hand-crafted State-specific optimizations
    • More closely aligns with the rest of the ecosystem and reduces ambiguity towards immutable or us “embracing mutable state”

    Migration Notes

    Almost all existing usages of @Model are fairly trivially transformed in one of two ways. The example below has a @Model class with two properties just for the sake of example, and has it being used in a composable.

    @Model class Position(
     var x: Int,
     var y: Int
    )
    
    @Composable fun Example() {
     var p = remember { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p.x = it }
       onYChange={ p.y = it }
     )
    }
    

    Alternative 1: Use State<OriginalClass> and create copies.

    This approach is made easier with Kotlin's data classes. Essentially, make all previously var properties into val properties of a data class, and then use state instead of remember , and assign the state value to cloned copies of the original using the data class copy(...) convenience method.

    It's important to note that this approach only works when the only mutations to that class were done in the same scope that the State instance is created. If the class is internally mutating itself outside of the scope of usage, and you are relying on the observation of that, then the next approach is the one you will want to use.

    data class Position(
     val x: Int,
     val y: Int
    )
    
    @Composable fun Example() {
     var p by state { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p = p.copy(x=it) }
       onYChange={ p = p.copy(y=it) }
     )
    }
    

    Alternative 2: Use mutableStateOf and property delegates

    This approach is made easier with Kotlin's property delegates and the mutableStateOf API which allows you to create MutableState instances outside of composition. Essentially, replace all var properties of the original class with var properties with mutableStateOf as their property delegate. This has the advantage that the usage of the class will not change at all, only the internal implementation of it. The behavior is not completely identical to the original example though, as each property is now observed/subscribed to individually, so the recompositions you see after this refactor could be more narrow (a good thing).

    class Position(x: Int, y: Int) {
     var x by mutableStateOf(x)
     var y by mutableStateOf(y)
    }
    
    // source of Example is identical to original
    @Composable fun Example() {
     var p = remember { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p.x = it }
       onYChange={ p.y = it }
     )
    }
    

    ( I409e8 , b/152050010 , b/146362815 , b/146342522 , b/143413369 , b/135715219 , b/143263925 , b/139653744 )

  • onFocusChange callback in text fields renamed to onFocusChanged ( Ida4a1 )

  • Added thresholds param in stateDraggable to specify thresholds between anchors. This was used to set a 56dp threshold in bottom drawer. Also BottomDrawerLayout now uses a separate BottomDrawerState enum. ( I533fa )

  • 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 deprecated override of FilledTextField composable ( I7f8f8 )

  • Rename Button object (containing the defaults used by Button function) to ButtonConstants ( I7c5f7 , b/159687878 )

  • Button's content slot now behaves as Row (useful when you need to have an icon with a text, see samples on Button how to write it) ( I0ff10 , b/158677863 )

  • RadioGroup and RadioGroupItem have been deprecated. Use Box with Modifier.selectable, Row and Column to make proper set of radioButton choices by your design ( I7f5cf , b/149528535 )

  • Added Material Outlined Textfield ( I1a518 )

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

  • TabRow.TabPosition not contains position in Dp, not in IntPx ( I34a07 , b/158577776 )

  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )

  • In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. ( Ic0191 )

  • Deprecates 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. ( I101cd , b/155375067 )

  • Scaffold API has been reworked: few parameters changed their name, added new parameters for better customization. Added getter to query sizes of Fab, TopBar and BottomBar ( I0e7ce )

  • Added the DropdownMenu component in ui-material, a Material Design menu implementation. ( I9bb3d )

  • Allow to show/hide software keyboard manually using SoftwareKeyboardController ( Ifb9d6 , b/155427736 )

  • Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements ( I8425f , b/155287131 )

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

  • Renames Emphasis.emphasize() to Emphasis.applyEmphasis() ( Iceebe )

  • Disabled buttons now visually follows the Material Design specification ( I47dcb , b/155076924 )

  • FilledTextField gets ime action, visual transformation and keyboard type support ( I1f9cf , b/155075201 )

  • Adds strokeWidth parameter to CircularProgressIndicator to customize the stroke size. To change the stroke size (height) of a LinearProgressIndicator, you can use Modifier.preferredHeight() or another size modifier. ( Icea16 , b/154919081 )

  • Adds strokeWidth parameter to CircularProgressIndicator to customize the stroke size. To change the stroke size (height) of a LinearProgressIndicator, you can use Modifier.preferredHeight() or another size modifier. ( Icea16 , b/154919081 )

  • Added slot API for trailing and leading icons in the FilledTextField and handling of the error state ( Ic12e0 )

  • FAB's and Extended FAB's default color has been changed to MaterialTheme.colors.secondary. ( I3b9b9 , b/154118816 )

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

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

  • Slider is now stateless. Users will need to pass and update state by themselves, just like in any other control. ( Ia00aa )

  • StaticDrawer was removed. If you need it, use Box with material-spec'ed width instead ( I244a7 )

  • Added Material Design implementation of Filled Text Field ( Ic75cd )

  • Added modifier param to ListItem and reordered params to promote trailing lambda body ( I66e21 )

  • Adds defaultFontFamily constructor parameter to Typography, allowing specifying the default font family that will be used for any provided TextStyles that do not have a family set. ( I89d07 )

  • Temporarily removed Material Data Tables from the API surface. ( Iaea61 )

  • Renamed paramaters in Divider composable ( Ic4373 )

  • children ( Ia6d19 )

  • Removes MaterialTheme.emphasisLevels, instead use EmphasisAmbient.current to retrieve the emphasis levels ( Ib5e40 )

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

  • Changed MaterialTheme APIs such as MaterialTheme.colors(), MaterialTheme.typography() to be properties instead of functions. Remove parentheses from existing calls, no behavioral change is expected. ( I3565a )

  • Refactored FloatingActionButton APIs to accept composable lambdas instead of primitives. See updated samples for usage information. ( I00622 )

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

  • Surface and Card were moved from androidx.ui.material.surface to androidx.ui.material ( I88a6d , b/150863888 )

  • 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. _Body:Created extension method on android.graphics.Bitmap, Bitmap.asImageAsset(), to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework ( Id5bbd )

  • Removed Snackbar API with String parameters in favour of using the overload that accepts composable lambdas. See updated samples for usage information ( I55f80 )

  • Refactored Tab APIs to accept text and icon lambdas, ( Ia057e )

  • Added BottomNavigation component, see the docs and samples for usage information ( I731a0 )

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

  • Replaced ButtonStyle with distinct functions and removed text (string) overload. See updated samples for usage information. ( If63ab , b/146478620 , b/146482131 )

  • rename Border modifier to DrawBorder ( I8ffcc )

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

  • Breaking changes to the ambients API. See log and Ambient<T> documentation for details ( I4c7ee , b/143769776 )

  • Scaffold material component has been added. Scaffold implements ( I7731b )

  • Replaced DrawBorder in favor of Border Modifier ( Id335a )

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

  • 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 )
  • 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 )
  • runOnIdleCompose renamed to runOnIdle ( I83607 )
  • 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 )
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. ( I7f164 )
  • Transition API has been changed to return a TransitionState instead of passing the TransitionState to children. This makes the API more consistent with animate() APIs. ( I24e38 )
  • An IntBounds unit class has been added, representing integer pixel bounds from layout. The API of PopupPositionProvider has been updated to use it. ( I0d8d0 , b/159596546 )
  • A new optional flag useUnmergedTree was added to test finders. ( I2ce48 )
  • Removed obsolete size testing APIs. ( Iba0a0 )
  • Removed Shader inline class that wrapped the NativeShader expect class Renamed NativeShader to Shader. The wrapped Shader inline class did not add anything valuable to the API surface and was an inline class, so use the NativeShader class directly. ( I25e4d )
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
  • Material DropdownMenu are now scrollable. ( Ide699 )
  • 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 )
  • 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 )
  • Switch now appears in a disabled state when enabled is set to false ( If4624 , b/155941869 , b/159331694 )
  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )
  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. ( I896c5 , b/158134875 )
  • 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 )

  • In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. ( I3ad98 )

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

  • Toggleable component has been deprecated. Use Modifier.toggleable instead ( I35220 , b/157642842 )

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

  • Fixed onClick not being invoked for DropdonMenuItems. ( I3998b , b/157673259 )

  • MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. ( I02b47 , b/157642842 )

  • TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )

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

  • 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.semantics has been undeprecated to allow usages for high level components. ( I4cfdc )

  • DrawLayer modifiers api has been changed: outlineShape renamed to shape and has the RectangleShape default value and now non-nullable; clipToOutline renamed to clip; clipToBounds removed as it is the same as clip == true with RectangleShape ( I7ef11 , b/155075735 )

  • Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )

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

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

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

  • FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. ( Ic4826 )

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

  • Add cursor color customisation to the TextField ( I6e33f )

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

  • Renamed LayoutModifier2 to LayoutModifier. ( Id29f3 )

  • Removed deprecated LayoutModifier interface. ( I2a9d6 )

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

  • Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )

  • New Modifier.zIndex() is added to control the drawing order of the children within the same parent layout. elevation property on DrawLayerModifier is renamed to shadowElevation and doesn't control the drawing order anymore. The params order fo DrawShadow is changed: elevation is now the first one and the shape is the second one with a RectangleShape default. ( I20150 , b/152417501 )

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

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

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

  • Created PixelMap API to support querying pixel information from an ImageAsset. ( I69ad6 )

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

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

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

  • Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )

  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. ( I499fa , b/152753731 )

  • Renamed LayoutResult to MeasureResult. ( Id8c68 )

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

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

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

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

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

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

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

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

  • Removed RepaintBoundary in favor of DrawLayerModifier ( I00aa4 )

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

  • The Opacity composable function has been replaced with the drawOpacity modifier. ( I5fb62 )

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

  • Added LayerModifier, a modifier that allows adding a RenderNode for a Layout. It allows setting clipping, opacity, rotation, scaling, and shadows. This will replace RepaintBoundary. ( I7100d , b/150774014 )

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

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

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

  • WithConstraints got LayoutDirection parameter ( I6d6f7 )

  • Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )

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

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

  • Support right-to-left direction in LayoutPadding modifier ( I9e8da )

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

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

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

  • Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) ( I11cb1 )

  • Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. ( I0245a )

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

  • Improvements to the API surface of Constraints ( I0fd15 )

,

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.
Последнее обновление Стабильный выпуск Кандидат на выпуск Бета-версия Альфа-релиз
2 октября 2024 г. 1.7.3 - - 1.8.0-alpha03

Структура

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.material:material:1.7.3"
}

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

Котлин

dependencies {
    implementation("androidx.compose.material:material:1.7.3")
}

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-alpha02

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

androidx.compose.material:material-*:1.8.0-alpha02 is released. Version 1.8.0-alpha02 contains these commits .

Version 1.8.0-alpha01

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

androidx.compose.material:material-*:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits .

Изменения API

  • Added new NavGraphBuilder.bottomSheet builder to create a bottomSheet with safe args (( I28589 , I777db , b/351858980 ))

Version 1.7

Version 1.7.2

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

androidx.compose.material:material-*:1.7.2 is released. Version 1.7.2 contains these commits .

Version 1.7.1

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.material:material-*:1.7.0 is released. Version 1.7.0 contains these commits .

Important changes since 1.6.0

  • Material components have been migrated to use the new ripple APIs, and no longer query RippleTheme .
  • Material components that previously accepted a MutableInteractionSource and defaulted to remember { MutableInteractionSource() } now accept a nullable MutableInteractionSource and default to null instead. If you are not hoisting and using the MutableInteractionSource , you should pass null. This allows for some components to lazily create an instance only when needed, improving performance. It is also recommended that you make similar changes in your own components.
  • BottomDrawer , ModalBottomSheet , BackdropScaffold and standard Bottomsheet have been promoted to stable API.

Version 1.7.0-rc01

21 августа 2024 г.

androidx.compose.material:material-*:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits .

Version 1.7.0-beta07

7 августа 2024 г.

androidx.compose.material:material-*:1.7.0-beta07 is released. Version 1.7.0-beta07 contains these commits .

Version 1.7.0-beta06

24 июля 2024 г.

androidx.compose.material:material-*:1.7.0-beta06 is released. Version 1.7.0-beta06 contains these commits .

Version 1.7.0-beta05

July 10, 2024

androidx.compose.material:material-*:1.7.0-beta05 is released. Version 1.7.0-beta05 contains these commits .

Version 1.7.0-beta04

26 июня 2024 г.

androidx.compose.material:material-*:1.7.0-beta04 is released. Version 1.7.0-beta04 contains these commits .

Version 1.7.0-beta03

12 июня 2024 г.

androidx.compose.material:material-*:1.7.0-beta03 is released. Version 1.7.0-beta03 contains these commits .

Version 1.7.0-beta02

29 мая 2024 г.

androidx.compose.material:material-*:1.7.0-beta02 is released. Version 1.7.0-beta02 contains these commits .

Изменения API

  • Update API for styling the links: moved the TextLinkStyles to the TextStyle and removed the TextDefaults from material ( I5477b )

Version 1.7.0-beta01

14 мая 2024 г.

androidx.compose.material:material-*:1.7.0-beta01 is released. Version 1.7.0-beta01 contains these commits .

Изменения API

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

Version 1.7.0-alpha08

1 мая 2024 г.

androidx.compose.material:material-*:1.7.0-alpha08 is released. Version 1.7.0-alpha08 contains these commits .

Изменения API

  • Fix backgroundColor not applying to TextFieldDecorationBox and OutlinedTextFieldDecorationBox . Decoration boxes now accept a shape parameter. ( I371c2 , b/307694651 )
  • RippleConfiguration#isEnabled has been removed, and LocalRippleConfiguration has been made nullable. To disable a ripple, instead of providing a RippleConfiguration with isEnabled = false , provide null to LocalRippleConfiguration . ( I22725 )
  • Text links have a pressed state styling option in addition to normal styling, hovered and focused. TextDefaults methods each have a pressedStyle argument to support that. ( Ic473f , b/139312671 )

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

  • OutlinedTextField top padding for label now accounts for system font size. ( Idc781 )

Version 1.7.0-alpha07

17 апреля 2024 г.

androidx.compose.material:material-*:1.7.0-alpha07 is released. Version 1.7.0-alpha07 contains these commits .

Изменения API

  • Text links got pressed state styling option in addition to normal styling, hovered and focused. ( I5f864 , b/139312671 )
  • 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 )

Version 1.7.0-alpha06

3 апреля 2024 г.

androidx.compose.material:material-*:1.7.0-alpha06 is released. Version 1.7.0-alpha06 contains these commits .

Объявление

  • androidx.compose.material no longer requires using the same version of every artifact is this maven group. Users can mix and match versions of Compose foundation libraries ( Ie5fba )

Изменения API

  • Moved more ModalDrawer and BottomDrawer defaults into DrawerDefaults object. ( Ib5b2e )

Version 1.7.0-alpha05

20 марта 2024 г.

androidx.compose.material:material-*:1.7.0-alpha05 is released. Version 1.7.0-alpha05 contains these commits .

Изменения API

  • The ScaffoldSubcomposeInMeasureFix flag has been removed. ( I67363 )

Version 1.7.0-alpha04

6 марта 2024 г.

androidx.compose.material:material-*:1.7.0-alpha04 is released. Version 1.7.0-alpha04 contains these commits .

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

Version 1.7.0-alpha03

21 февраля 2024 г.

androidx.compose.material:material-*:1.7.0-alpha03 is released. Version 1.7.0-alpha03 contains these commits.

Изменения API

  • BottomDrawer has been promoted from experimental to stable. BottomDrawerState now exposes the progress as a function, allowing to query progress between specific targets. BottomDrawerState now allows customizing the animation spec, and confirmStateChange is not a trailing lambda anymore. ( I9c029 , b/261423850 )
  • BackdropScaffold has been promoted from experimental to stable. The animation spec is now a tween spec in accordance with guidelines. The snackbarHost parameter of BackdropScaffold is no longer the last parameter to avoid confusion with trailing lambdas. BackdropScaffoldState exposes a progress(from, to) API to query progress between anchors. ( I73f48 , b/261423218 )
  • Standard bottom sheets have been promoted from experimental to stable. Deprecated constructors have been removed. The animation spec is now a tween spec in accordance with guidelines. ( I3c1a8 , b/278692145 , b/261409034 )
  • Modal bottom sheets have been promoted from experimental to stable. Deprecated constructors have been removed. The animation spec is now a tween spec in accordance with guidelines. ( Ic53f4 , b/278692145 , b/266780235 , b/261409034 )

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

  • Fixed an issue where BackdropScaffold could crash in specific scenarios in combination with LookaheadScope . ( I51396 )
  • Removed subcomposition inside BottomSheetScaffold to improve performance. Fixed an issue where BottomSheetScaffold would crash in specific scenarios in combination with LookaheadScope . ( I2f90c )
  • Removed subcomposition inside ModalBottomSheetLayout , improving performance. ( I7a025 )

Version 1.7.0-alpha02

7 февраля 2024 г.

androidx.compose.material:material-*:1.7.0-alpha02 is released. Version 1.7.0-alpha02 contains these commits.

Version 1.7.0-alpha01

24 января 2024 г.

androidx.compose.material:material-*:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.

Behavior Changes

  • Material components have been migrated to use the new ripple APIs, and no longer query RippleTheme .

Изменения API

  • rememberRipple and RippleTheme have been deprecated from material-ripple, with new ripple and RippleConfiguration APIs added to material and other design system libraries.

  • Material components that previously accepted a MutableInteractionSource and defaulted to remember { MutableInteractionSource() } now accept a nullable MutableInteractionSource and default to null instead. If you are not hoisting and using the MutableInteractionSource , you should pass null. This allows for some components to lazily create an instance only when needed, improving performance. It is also recommended that you make similar changes in your own components.

Version 1.6

Version 1.6.8

12 июня 2024 г.

androidx.compose.material:material-*:1.6.8 is released. Version 1.6.8 contains these commits .

Version 1.6.7

1 мая 2024 г.

androidx.compose.material:material-*:1.6.7 is released. Version 1.6.7 contains these commits .

Version 1.6.6

17 апреля 2024 г.

androidx.compose.material:material-*:1.6.6 is released. No changes since the last release.

Version 1.6.5

3 апреля 2024 г.

androidx.compose.material:material-*:1.6.5 is released. Version 1.6.5 contains these commits .

Version 1.6.4

20 марта 2024 г.

androidx.compose.material:material-*:1.6.4 is released. Version 1.6.4 contains these commits .

Version 1.6.3

6 марта 2024 г.

androidx.compose.material:material-*:1.6.3 is released. Version 1.6.3 contains these commits .

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

  • Fix regression in ExposedDropdownMenu to make it focusable again. ( c0e0ed , b/323694447 )

Version 1.6.2

21 февраля 2024 г.

androidx.compose.material:material-*:1.6.2 is released. Version 1.6.2 contains these commits.

Version 1.6.1

7 февраля 2024 г.

androidx.compose.material:material-*:1.6.1 is released. Version 1.6.1 contains these commits.

Version 1.6.0

24 января 2024 г.

androidx.compose.material:material-*:1.6.0 is released. Version 1.6.0 contains these commits.

Version 1.6.0-rc01

10 января 2024 г.

androidx.compose.material:material-*:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.

Version 1.6.0-beta03

13 декабря 2023 г.

androidx.compose.material:material-*:1.6.0-beta03 is released. Version 1.6.0-beta03 contains these commits.

Version 1.6.0-beta02

29 ноября 2023 г.

androidx.compose.material:material-*:1.6.0-beta02 is released. Version 1.6.0-beta02 contains these commits.

Version 1.6.0-beta01

15 ноября 2023 г.

androidx.compose.material:material-*:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.

Version 1.6.0-alpha08

18 октября 2023 г.

androidx.compose.material:material-*:1.6.0-alpha08 is released. Version 1.6.0-alpha08 contains these commits.

Изменения API

  • Deprecate a materialIcon function in favor of its overload that takes an autoMirror parameter. ( Ia338d )

Bug Fixes - Auto-increase height of nav item for large content. ( 0c4ecc , b/272336962 )

Version 1.6.0-alpha07

4 октября 2023 г.

androidx.compose.material:material-*:1.6.0-alpha07 is released. Version 1.6.0-alpha07 contains these commits.

  • Dependency updates

Version 1.6.0-alpha06

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

androidx.compose.material:material-*:1.6.0-alpha06 is released. Version 1.6.0-alpha06 contains these commits.

Behavior Breaking Change

  • Removed drawer-related functionality from BottomSheetScaffold . Wrap your BottomSheetScaffold in a Drawer composable to achieve the previous functionality. See BottomSheetScaffoldWithDrawerSample for an example. ( I1dcc8 )

Изменения API

  • Introduced a temporary flag to control whether Scaffold should measure its children during measurement or during placement. By default, this will measure in measurement. If you are facing issues with the new behavior, please file an issue. ( If6e3b )

Version 1.6.0-alpha05

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

androidx.compose.material:material-*:1.6.0-alpha05 is released. Version 1.6.0-alpha05 contains these commits.

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

  • Added support for auto-mirrored icons when rendered in right-to-left layouts. Icons in the material-icons-core and material-icons-extended modules are now providing additional icon sets for supporting auto-mirroring when the icon allows it. The new sets are prefixed with Icons.AutoMirrored.Filled... etc., and hold icons that will auto-mirror on RTL layouts. See the list of Material icons for the list of icons that can (and should) be auto-mirrored.

Изменения API

  • Added support for auto-mirrored icons when rendered in right-to-left layouts. Icons in the material-icons-core and material-icons-extended modules are now providing additional icon sets for supporting auto-mirroring when the icon allows it. The new sets are prefixed with Icons.AutoMirrored.Filled... etc., and hold icons that will auto-mirror on RTL layouts. See the list of Material icons for the list of icons that can (and should) be auto-mirrored. The previously provided icon properties for those icons are now marked as deprecated, and provides a replacement-block suggestion to help with the migration. In case you don't have any special handling for mirroring icons on RTL, we recommend migrating to the new set of icons. For example, Icons.Filled.ArrowBack should be refactored to Icons.AutoMirrored.Filled.ArrowBack . ( I4b511 )

Version 1.6.0-alpha04

23 августа 2023 г.

androidx.compose.material:material-*:1.6.0-alpha04 is released. Version 1.6.0-alpha04 contains these commits.

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

  • Fixed an issue where some components using Subcomposition (eg BottomSheetScaffold ) inside a Scaffold inside a LookaheadScope were attempting to read their size too early. ( If2c5d )
  • Fixed DropdownMenu 's offset calculation so x offsets depend solely on the local layout direction, and y offsets will no longer be reversed when the menu is near the bottom of the screen. ( Iccc74 , b/294103942 )
  • Optimized BottomSheetScaffold 's layout internals and fixed a potential issue with BottomSheetScaffold inside a LookaheadLayout . ( Ic0afa )

Version 1.6.0-alpha03

9 августа 2023 г.

androidx.compose.material:material-*:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.

Изменения API

  • Material2 components now have a separate API to pass windowInsets to support edge-to-edge functionality in android. Unlike material3 components, material2 components do not support insets by default and the value should be passed manually. Refer to the corresponding samples for guidance. ( I655e8 )

Version 1.6.0-alpha02

July 26, 2023

androidx.compose.material:material-*:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.

Изменения API

  • We are moving the density dependency to the component level. This applies to the following components: SwipeToDismiss and Sheet based components. Please use the new overload provided where density is a parameter. ( I1846e )
  • Additional annotations to specify allowed inputs to composables ( I51109 )
  • Updated API files to annotate compatibility suppression ( I8e87a , b/287516207 )
  • Added new Start alignment for FabPosition ( Ib7aea , b/170592777 )
  • TextFieldColorsWithIcons in Material 2 has been deprecated in favor of TextFieldColors . When overriding leadingIconColor or trailingIconColor , also override the overload with interactionSource . ( Id57ed , b/199377790 )

Version 1.6.0-alpha01

21 июня 2023 г.

androidx.compose.material:material-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.

Behavior Changes

  • includeFontPadding is now false by default in Material 2 typography. The default line height style has also been changed to Trim.None and Alignment.Center , and explicit lineHeight (in sp) have been added to the TextStyle s of Typography . Consult the API docs if you want to customize these values, and see the blog post for an in-depth explainer of these changes. ( Icabc3 , I3f801 , I04c03 )

Изменения API

  • Material's Swipeable APIs have been deprecated. Please refer to Foundation's AnchoredDraggable APIs which are optimized for both simple and complex use cases. ( I732e0 )

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

  • BottomSheetState , ModalBottomSheetState and BottomDrawerState now expose a progress property indicating the progress between the current (settled) anchor and the closest anchor in the swipe direction. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )

Версия 1.5

Версия 1.5.4

18 октября 2023 г.

androidx.compose.material:material-*:1.5.4 is released. Version 1.5.4 contains these commits.

Version 1.5.3

4 октября 2023 г.

androidx.compose.material:material-*:1.5.3 is released. This version does not have any changes

Версия 1.5.2

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

androidx.compose.material:material-*:1.5.2 is released. Version 1.5.2 contains these commits.

Version 1.5.1

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

androidx.compose.material:material-*:1.5.1 is released with no changes. Version 1.5.1 contains these commits.

Версия 1.5.0

9 августа 2023 г.

androidx.compose.material:material-*:1.5.0 is released. Version 1.5.0 contains these commits.

Important changes since 1.4.0

Изменения API

  • Incorporated changes in the Swipeable1 APIs in BottomSheetScaffold . BottomSheetState 's confirmStateChange param has been renamed to confirmValueChange . progress is now exposed as a float value. animateTo and snapTo are internal. Use expand() and collapse() instead. direction and overflow have been removed. offset has been replaced with requireOffset() . I323b4
  • Mark the snapTo function in Drawer as non-experimental API. ( Ib9c18 , b/261425368 )
  • Added a track color parameter for circular progress indicators, and a stroke cap parameter for both circular and linear progress indicators. ( Ie668c , b/216325962 , b/222964817 )
  • Renamed ModalBottomSheetState , ModalBottomSheetState.Saver and rememberModalBottomSheetState 's confirmStateChange to confirmValueChange . ( Ib48d1 )
  • Add Modifier.minimumInteractiveComponentSize . It can be used to reserve at least 48.dp in size to disambiguate touch interactions if the element would measure smaller. ( I33f58 , b/258495559 )
  • Incorporated changes in the Swipeable APIs in ModalBottomSheetLayout . ModalBottomSheetState 's animateTo does not take an animationSpec parameter anymore and the offset exposed is now nullable. Use requireOffset to require the offset. ( Ia2e79 )
  • Adding @JvmDefaultWithCompatibility annotation ( I8f206 )
  • Incorporated changes in the Swipeable APIs in ModalDrawer. DrawerState 's animateTo has been replaced by the open and close methods and the offset is now nullable. Use requireOffset to require the offset. ( I3de9e )
  • Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events.
  • Added minLines parameter into material and material3 Text, TextField and OutlinedTextField which allows setting the minimum height of the component in terms of number of lines ( I4af1d )

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

  • Fixes an issue where pullRefresh was not consuming velocity, causing overscroll to show. Also changed the API signature of the onRelease lambda in Modifier.pullRefresh to return a Float for consumed velocity ( I7db65 , b/266874741 )
  • BottomSheetState , ModalBottomSheetState and BottomDrawerState now expose a progress property indicating the progress between the current (settled) anchor and the closest anchor in the swipe direction. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )
  • Fixed the AlertDialog dismiss action to appear below the confirm action when the actions stacked over each other to fit into the dialog's width. This fix aligns the implementation with the Material Design spec. ( I029de , b/235454277 )
  • BottomSheetScaffold will not participate in nested scroll anymore when gesturesEnabled is set to false. ( I634f3 , b/215403277 )
  • Fixed a bug where BottomSheetScaffold would crash when provided with empty content for slots. ( Ib24a5 , b/235588730 )
  • Fixes PullRefreshIndicator intercepting clicks/pointer events. ( 2494256 , b/271777421 )
  • Fixed an issue where ModalBottomSheetLayout would crash in an edge case on orientation change. Layout animations (eg Modifier.animateContentSize ) in/on the sheet content now work smoothly. ( I2f981 , b/266780234 )

Version 1.5.0-rc01

July 26, 2023

androidx.compose.material:material-*:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.

Version 1.5.0-beta03

28 июня 2023 г.

androidx.compose.material:material-*:1.5.0-beta03 is released. Version 1.5.0-beta03 contains these commits.

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

  • BottomSheetState , ModalBottomSheetState and BottomDrawerState now expose a progress property indicating the progress between the current (settled) anchor and the closest anchor in the swipe direction. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )

Version 1.5.0-beta02

7 июня 2023 г.

androidx.compose.material:material-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.

Version 1.5.0-beta01

May 24, 2023

androidx.compose.material:material-*:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.

Изменения API

  • DrawerState 's and BottomDrawerState 's offset are not nullable anymore. They instead return Float.NaN to indicate the absence of the offset. ( Ie9855 )
  • Added an option to pass in a ScrollState when constructing a DropdownMenu or an ExposedDropdownMenu for controlling the vertical scroll state of the displayed menu items. ( Idb009 , b/185304441 )
  • Add the support for enabling/disabling the gesture of ModalBottomSheetLayout so that user could configure this for more featured bottomsheet ( I40af0 )
  • Added a color parameter to BasicText to allow efficiently animating or setting text color. ( Iffd88 , b/246961787 )
  • Renaming the Semantics property isContainer to isTraversalGroup ( I121f6 )

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

  • Fixed the AlertDialog dismiss action to appear below the confirm action when the actions stacked over each other to fit into the dialog's width. This fix align the implementation with the Material Design spec. ( I029de , b/235454277 )

Version 1.5.0-alpha04

10 мая 2023 г.

androidx.compose.material:material-*:1.5.0-alpha04 is released. Version 1.5.0-alpha04 contains these commits.

Изменения API

  • We are moving the density dependency to the component level. This applies to the following components: BottomDrawer , ModalBottomSheetLayout , BottomSheetScaffold , Switch , ModalDrawer . Please use the new overload provided where density is a parameter. ( I8fbd8 )

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

19 апреля 2023 г.

androidx.compose.material:material-*:1.5.0-alpha03 is released. Version 1.5.0-alpha03 contains these commits.

Изменения API

  • Update BottomDrawer internals to use the new SwipeableV2 APIs. Because of this BottomDrawerState will now only have APIS defined at the class level, it won't inherit methods/properties from SwipeableState . We're using composition with an internal SwipeableV2State . Offset is now a nullable floating point property, the current value and a swipe target value can still be accessed through currentValue and targetValue properties. The previous class level methods such as open/expand/close and properties such as isOpen/isClosed continue to be supported. ( Iad40c , b/178529942 , b/220676296 )

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

  • Updated internals of the Switch component. The switch will now preview the closest (target state) when dragging. ( Id90d4 )
  • Animated sheet content (eg Modifier.animateContentSize on sheet content) in BottomSheetScaffold has been optimized and now works smoothly. ( Ia913c , b/270518202 , b/254446195 )
  • BottomSheetScaffold will not participate in nested scroll anymore when gesturesEnabled is set to false . ( I634f3 , b/215403277 )

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

5 апреля 2023 г.

androidx.compose.material:material-*:1.5.0-alpha02 is released. Version 1.5.0-alpha02 contains these commits.

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

  • Fixed a bug where BottomSheetScaffold would crash when provided with empty content for slots. ( Ib24a5 , b/235588730 )
  • Fixes PullRefreshIndicator intercepting clicks / pointer events ( 2494256 , b/271777421 )

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

22 марта 2023 г.

androidx.compose.material:material-*:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.

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

  • Add a chipgroup reflow sample. Update the horizontal padding in between child chips in the single line chipgroup sample to match spec. ( I3b155 )
  • Fixed an issue where ModalBottomSheetLayout would crash in an edge case on orientation change. Layout animations (eg Modifier.animateContentSize ) in/on the sheet content now work smoothly. ( I2f981 , b/266780234 )

Версия 1.4

Версия 1.4.3

3 мая 2023 г.

androidx.compose.material:material-*:1.4.3 is released with no changes (only a version bump).

Версия 1.4.2

19 апреля 2023 г.

androidx.compose.material:material-*:1.4.2 is released. Version 1.4.2 contains these commits.

Версия 1.4.1

5 апреля 2023 г.

androidx.compose.material:material-*:1.4.1 is released. Version 1.4.1 contains these commits.

Версия 1.4.0

22 марта 2023 г.

androidx.compose.material:material-*:1.4.0 is released. Версия 1.4.0 содержит эти коммиты.

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

Изменения API

  • Add Modifier.minimumInteractiveComponentSize . It can be used to reserve at least 48.dp in size to disambiguate touch interactions if the element would measure smaller. ( I33f58 , b/258495559 )
  • Incorporated changes in the Swipeable APIs in ModalDrawer . DrawerState 's animateTo has been replaced by the open and close methods and the offset is now nullable. Use requireOffset to require the offset. ( I3de9e )
  • Added minLines parameter into material and material3 Text, TextField and OutlinedTextField which allows setting the minimum height of the component in terms of number of lines ( I4af1d )
  • 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-rc01

8 марта 2023 г.

androidx.compose.material:material-*:1.4.0-rc01 is released with no changes. Версия 1.4.0-rc01 содержит эти коммиты.

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

22 февраля 2023 г.

androidx.compose.material:material-*:1.4.0-beta02 is released. Версия 1.4.0-beta02 содержит эти коммиты.

Изменения API

  • Incorporated changes in the Swipeable APIs in BottomSheetScaffold . BottomSheetState 's confirmStateChange param has been renamed to confirmValueChange . progress is now exposed as a float value. animateTo and snapTo are internal. Use expand() and collapse() instead. direction and overflow have been removed. offset has been replaced with requireOffset() . ( I323b4 )

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

  • Removed semantic roles from clickable and selectable surfaces, updated components that used them to set roles using modifier.semantics ( Ibb4ba )
  • Minor update to the extended Material icons that tweaks the filled desktop_mac , directions , and kitchen icons. ( I65f5e )

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

February 8, 2023

androidx.compose.material:material-*:1.4.0-beta01 is released. Версия 1.4.0-beta01 содержит эти коммиты.

Изменения API

  • Fixes an issue where pullRefresh was not consuming velocity, causing overscroll to show. Also changed the API signature of the onRelease lambda in Modifier.pullRefresh to return a Float for consumed velocity ( I7db65 , b/266874741 )
  • Restored property getter LocalMinimuTouchTargetEnforcement and mark it as deprecated and redirect to LocalMinimumInteractiveComponentEnforcement . ( I60dd5 )

Version 1.4.0-alpha05

25 января 2023 г.

androidx.compose.material:material-*:1.4.0-alpha05 is released. Version 1.4.0-alpha05 contains these commits.

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

  • Fixed an issue where ModalBottomSheetLayout's HalfExpanded state was calculated incorrectly and the sheet would appear to be floating. ( I8c615 , b/265610459 )
  • Fixed a bug in ModalBottomSheetLayout where the sheet would crash when going from the hidden to a visible state in some circumstances. ( Ia9265 , b/265444789 )

Version 1.4.0-alpha04

11 января 2023 г.

androidx.compose.material:material-*:1.4.0-alpha04 is released. Version 1.4.0-alpha04 contains these commits.

Изменения API

  • Added in IsContainer semantics property on Surfaces. This property will be used in a later change that determines traversal order based on the semantic meaning of elements such as surfaces. ( I63379 )
  • Mark the snapTo function in Drawer as non-experimental API. ( Ib9c18 , b/261425368 )
  • Added a track color parameter for circular progress indicators, and a stroke cap parameter for both circular and linear progress indicators. ( Ie668c , b/216325962 , b/222964817 )
  • Renamed ModalBottomSheetState , ModalBottomSheetState.Saver and rememberModalBottomSheetState 's confirmStateChange to confirmValueChange . ( Ib48d1 )
  • More return type nullability of deprecated-hidden functions ( Ibf7b0 )
  • Add Modifier.minimumInteractiveComponentSize . It can be used to reserve at least 48.dp in size to disambiguate touch interactions if the element would measure smaller. ( I33f58 , b/258495559 )
  • Incorporated changes in the Swipeable APIs in ModalBottomSheetLayout . ModalBottomSheetState 's animateTo does not take an animationSpec parameter anymore and the offset exposed is now nullable. Use requireOffset to require the offset . ( Ia2e79 )

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

  • A ModalBottomSheetLayout 's sheet now has a maximum width of 640 dp. ( I71a4f , b/234927577 )
  • Fixes an issue where rememberPullRefreshState was not updating refreshThreshold and refreshingOffset over time. ( Ifed10 , b/263159832 )
  • Progress for progress indicators is now properly bounded to its expected range. ( I8a7eb , b/262262727 )
  • When ModalBottomSheetState has not received any anchors yet, it will update the currentValue without an animation when snapTo or animateTo are called instead of throwing an exception. ( I2c91b )
  • Fixed the enabled state at the Material 2 FilterChip implementation. ( Id326a , b/261329817 )
  • Fixed a bug where ModalBottomSheetLayout would crash if it was HalfExpanded when rotating from portrait to landscape. Please ensure you are passing in the correct initialValue , for example by checking the configuration. ( Ie8df7 , b/182882364 )
  • Fixed an issue where ModalBottomSheetLayout would crash if the sheet content was empty. ModalBottomSheetLayout now allows empty sheet content. If the sheet content is empty, it will only have a Hidden state. ( Ic2288 , b/200980998 , b/216693030 )

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

December 7, 2022

androidx.compose.material:material-*:1.4.0-alpha03 is released. Version 1.4.0-alpha03 contains these commits.

Изменения API

  • Adding @JvmDefaultWithCompatibility annotation ( I8f206 )
  • Incorporated changes in the Swipeable APIs in ModalDrawer . DrawerState 's animateTo has been replaced by the open and close methods and the offset is now nullable. Use requireOffset to require the offset. ( I3de9e )
  • 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.

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

  • Fixed an issue where PullRefreshIndicator could get stuck after onRefresh is called, if the refreshing state was not changed to true. ( Ie2416 , b/248274004 )

Dependency Updates

  • Compose UI and Compose Material now depend on Lifecycle 2.5.1. ( I05ab0 , b/258038814 )

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

9 ноября 2022 г.

androidx.compose.material:material-*:1.4.0-alpha02 is released. Версия 1.4.0-alpha02 содержит эти коммиты.

Изменения API

  • awaitFirstDown and waitForUpOrCancellation now accept a PointerEventPass for greater flexibility. ( I7579a , b/212091796 )
  • Added minLines parameter into material and material3 Text, TextField and OutlinedTextField which allows setting the minimum height of the component in terms of number of lines ( I4af1d )
  • Added minLines parameter to the BasicTex t 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

October 24, 2022

androidx.compose.material:material-*:1.4.0-alpha01 is 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 )

Версия 1.3

Version 1.3.1

9 ноября 2022 г.

androidx.compose.material:material-*:1.3.1 is released. Version 1.3.1 contains these commits.

Версия 1.3.0

October 24, 2022

androidx.compose.material:material-*:1.3.0 is released. Версия 1.3.0 содержит эти коммиты.

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

Behavior breaking change

  • Maximum supported elevation in dialogs and popups has been reduced to 8dp.

Изменения API

  • Add a Pull-To-Refresh component to Compose ( I29168 ).
  • Change parameter name from values to value in RangeSlider ( I3b79a ).

Версия 1.3.0-rc01

5 октября 2022 г.

androidx.compose.material:material-*:1.3.0-rc01 is released. Версия 1.3.0-rc01 содержит эти коммиты.

Version 1.3.0-beta03

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

androidx.compose.material:material-*:1.3.0-beta03 is released. Version 1.3.0-beta03 contains these commits.

Изменения API

  • Add a Pull-To-Refresh component to Compose ( I29168 )

Version 1.3.0-beta02

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

androidx.compose.material:material-*:1.3.0-beta02 is released. Version 1.3.0-beta02 contains these commits.

No changes since 1.3.0-beta01

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

24 августа 2022 г.

androidx.compose.material:material-*:1.3.0-beta01 is released. Версия 1.3.0-beta01 содержит эти коммиты.

Behavior breaking change

Maximum supported elevation in dialogs and popups has been reduced to 8dp.

The maximum supported elevation for Compose dialogs and popups has been reduced from 30dp to 8dp. This change affects both material and ui custom dialogs and popups. This change is made to mitigate an accessibility bug on Android versions below S, and to ensure that accessibility services within those windows are able to interact with the content inside the dialog or popup.

You will only be impacted by this change if you are creating a custom dialog or popup implementation with an elevation set to levels higher than 8dp. Consider lowering the elevation of your dialog or popup. If you need to opt-out from this new behavior, consider forking your own dialog or popup with the desired elevation set. This is not recommended, as accessibility might be negatively impacted and it is on the developer to ensure the bottom part of the dialog or popup is interactable and readable by accessibility services.

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

10 августа 2022 г.

androidx.compose.material:material-*:1.3.0-alpha03 is released. Версия 1.3.0-alpha03 содержит эти коммиты.

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

27 июля 2022 г.

androidx.compose.material:material-*:1.3.0-alpha02 is released. Версия 1.3.0-alpha02 содержит эти коммиты.

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

  • Fix AnimatedVisibility issue with FloatingActionButton in Scaffold ( I3a0ae , b/224005027 )

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

29 июня 2022 г.

androidx.compose.material:material-*:1.3.0-alpha01 is released. Версия 1.3.0-alpha01 содержит эти коммиты.

Изменения API

  • Change parameter name from values to value in RangeSlider ( I3b79a )

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

  • Update badge sample to provide more meaningful content description. ( I10b9d )

Version 1.2

Version 1.2.1

10 августа 2022 г.

androidx.compose.material:material-*:1.2.1 is released. Version 1.2.1 contains these commits.

Версия 1.2.0

27 июля 2022 г.

androidx.compose.material:material-*:1.2.0 is released. Версия 1.2.0 содержит эти коммиты.

Version 1.2.0-rc03

29 июня 2022 г.

androidx.compose.material:material-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.

  • No changes since 1.2.0-rc02.

Version 1.2.0-rc02

June 22, 2022

androidx.compose.material:material-*:1.2.0-rc02 is released. Version 1.2.0-rc02 contains these commits.

Версия 1.2.0-rc01

June 15, 2022

androidx.compose.material:material-*:1.2.0-rc01 is released. Версия 1.2.0-rc01 содержит эти коммиты.

Изменения API

  • Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )

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

  • Updates badge with leading icon tab to affix badge to the label instead of the icon. ( I90993 )

Version 1.2.0-beta03

1 июня 2022 г.

androidx.compose.material:material-*:1.2.0-beta03 is released. Version 1.2.0-beta03 contains these commits.

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

  • Fixed a bug where BottomSheetScaffold was drawing over the top app bar's shadow. BottomSheetScaffold now also takes the sheet's state into account when placing Snackbars: in the collapsed state, Snackbars are placed above the sheet and FAB; in the expanded state, Snackbars are anchored to the sheet's bottom. ( Ia80b5 , b/187771422 )

Version 1.2.0-beta02

18 мая 2022 г.

androidx.compose.material:material-*:1.2.0-beta02 is released. Version 1.2.0-beta02 contains these commits.

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

11 мая 2022 г.

androidx.compose.material:material-*:1.2.0-beta01 is released. Версия 1.2.0-beta01 содержит эти коммиты.

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

  • This is the first beta release of 1.2!

Изменения API

  • Renamed TextFieldDefaults.BorderStroke composable that draws a border stroke in OutlinedTextField to TextFieldDefaults.BorderBox . ( I5f295 )

Version 1.2.0-alpha08

April 20, 2022

androidx.compose.material:material-*:1.2.0-alpha08 is released. Version 1.2.0-alpha08 contains these commits.

Изменения API

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

Version 1.2.0-alpha07

6 апреля 2022 г.

androidx.compose.material:material-*:1.2.0-alpha07 is released. Version 1.2.0-alpha07 contains these commits.

Version 1.2.0-alpha06

23 марта 2022 г.

androidx.compose.material:material-*:1.2.0-alpha06 is released. Version 1.2.0-alpha06 contains these commits.

Изменения API

  • Updates to the clickable Card API to follow changes at the Surface API ( I56bcb )
  • Updates to Material 2 Surface API that adds additional overloaded functions for selectable and toggleable Surfaces. ( Ifcca5 )

Version 1.2.0-alpha05

March 9, 2022

androidx.compose.material:material-*:1.2.0-alpha05 is released. Version 1.2.0-alpha05 contains these commits.

Изменения API

  • LazyVerticalGrid and LazyHorizontalGrid are now stable. ( I307c0 )
  • 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 )
  • Reverted previous change of relying solely on a View for WindowInsetsControllerCompat , and again require a Window which is required for managing some window flags. Deprecated ViewCompat.getWindowInsetsController in favor of WindowCompat.getInsetsController to ensure that the correct Window is used (such as if the View is in a dialog). ( I660ae , b/219572936 )
  • 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 )
  • Added a new LazyVerticalGrid API to define cross axis sizes ( I17723 )

Version 1.2.0-alpha04

23 февраля 2022 г.

androidx.compose.material:material-*:1.2.0-alpha04 is released. Version 1.2.0-alpha04 contains these commits.

Изменения API

  • Add support for filter chips ( I39a6e , b/192585545 )
  • Added TextFieldDecorationBox and OutlinedTextFieldDecorationBox . Using them together with BasicTextField will help you build custom text field based on Material Design text fields but with more options for customisation.
  • Provided a way to adjust horizontal and vertical paddings in text fields. ( I8c9f1 , b/203764564 , b/191543915 , b/189971673 , b/183136600 , b/179882597 , b/168003617 )
  • 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 )

Version 1.2.0-alpha03

February 9, 2022

androidx.compose.material:material-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.

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

Version 1.2.0-alpha02

26 января 2022 г.

androidx.compose.material:material-*:1.2.0-alpha02 is 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 )
  • Add support for action chip ( I07100 , b/192585545 )

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

January 12, 2022

androidx.compose.material:material-*:1.2.0-alpha01 is released. Версия 1.2.0-alpha01 содержит эти коммиты.

Dependency Updates

  • Now depends on Kotlin 1.6.10 .

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

  • ModalBottomSheetState now has a isSkipHalfExpanded flag. It can be either set through the constructor or updated later on by setting ModalBottomSheetState 's isSkipHalfExpanded property to true . Updating isSkipHalfExpanded 's value causes a recomposition of the sheet. ( I18b86 , b/186669820 )

Версия 1.1

Version 1.1.1

23 февраля 2022 г.

androidx.compose.material:material-*:1.1.1 is released. Version 1.1.1 contains these commits.

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

Версия 1.1.0

February 9, 2022

androidx.compose.material:material-*:1.1.0 is released. Version 1.1.0 contains these commits.

Important changes since 1.0.0

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

Version 1.1.0-rc03

26 января 2022 г.

androidx.compose.material:material-*:1.1.0-rc03 is released. Version 1.1.0-rc03 contains these commits.

Behaviour Changes

Note that, with respect to Compose 1.0, Material components will expand their layout space to meet Material accessibility guidelines 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.

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

  • Added some better debug information for the layout inspector when inspecting minimum touch target modifiers. ( aosp/1955036 )

Версия 1.1.0-rc01

15 декабря 2021 г.

androidx.compose.material:material-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

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

Version 1.1.0-beta04

1 декабря 2021 г.

androidx.compose.material:material-*:1.1.0-beta04 is released. Version 1.1.0-beta04 contains these commits.

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

  • Updated to be compatible with Kotlin 1.6.0

Version 1.1.0-beta03

17 ноября 2021 г.

androidx.compose.material:material-*:1.1.0-beta03 is released. Version 1.1.0-beta03 contains these commits.

Version 1.1.0-beta02

November 3, 2021

androidx.compose.material:material-*:1.1.0-beta02 is 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 )

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

27 октября 2021 г.

androidx.compose.material:material-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.

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

  • Ripples now support hover and focus states, so hovering / focusing a component such as Button will now show the correct state overlay.

Version 1.1.0-alpha06

13 октября 2021 г.

androidx.compose.material:material-*:1.1.0-alpha06 is released. Version 1.1.0-alpha06 contains these commits.

Изменения API

  • A child-less overload for Layout was added, with improved efficiency ( Ib0d9a )
  • Implementation of ExposedDropdownMenu based on ExposedDropdownMenuBox with TextField and DropdownMenu inside ( If60b2 )
  • dismissOnOutsideClick was added to PopupProperties , replacing dismissOnClickOutside which was deprecated. The new property receives the click position and the anchor bounds, providing finer control over whether onDismissRequest should be invoked or not. For example, this can be useful to prevent anchor dismissal for touches on the anchor.
    • updateAndroidWindowManagerFlags was added to PopupProperties , offering low-level control over the flags passed by the popup to the Android WindowManager. The parameter of the lambda will be the flags calculated from the PopupProperties values that result in WindowManager flags: eg focusable. The result of the lambda will be the final flags which will be passed to the Android WindowManager. By default, updateAndroidWindowManagerFlags will leave the flags calculated from parameters unchanged. This API should be used with caution, only in cases where the popup has very specific behavior requirements. ( I6e9f9 )

Version 1.1.0-alpha05

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

androidx.compose.material:material-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.

Изменения API

  • Adds minimum touch target sizing for Material components that do not have an accessible touch target. As this adds extra spacing around components to make sure they have a large enough touch target, this may change existing UIs that assume the size of these components is their visual size, and doesn't account for touch target size. You can use the experimental LocalMinimumTouchTargetEnforcement composition local to disable this behavior across a hierarchy, but this is intended only to be a temporary escape hatch while updating existing UIs to account for the new minimum size. ( I9b966 , b/149691127 , b/171509422 )
  • Added experimental TextFieldColorsWithIcons interface, extending TextFieldColors to provide InteractionSource to the leadingColor and trailingColor. This enables modifying the appearance of TextField according to the focus state. ( I66923 , b/198402662 )

Version 1.1.0-alpha04

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

androidx.compose.material:material-*:1.1.0-alpha04 is 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 )

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

  • Allow clip to extend touch target bounds beyond the clip region for minimum touch target purposes. ( I43e10 , b/171509422 )
  • Updated Divider composable to respect Dp.Hairline for the thickness parameter to support drawing single pixel dividers regardless of display density. ( I16ffb , b/196840810 )

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

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

androidx.compose.material:material-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.

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

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

Изменения API

  • 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.material:material-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.

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

  • Fix the behavior of SwipeableState in the case where the swipe offset is within a rounding error of an anchor. ( I03d39 , b/191993377 )

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

4 августа 2021 г.

androidx.compose.material:material-*:1.1.0-alpha01 is 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 )
  • Renamed BadgeBox to BadgedBox, changed parameters to accept Badge composable. Added Badge component that is the typical badge content for a BadgedBox. ( I639c6 )
  • Added NavigationRail component, see the docs and samples for usage information ( I8de77 )

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

  • Added a bottom-aligned NavigationRail sample and Catalog app demo. ( I3cffc )
  • Dialogs now follow the platform sizing behaviour. Set usePlatformDefaultWidth to false to override this behaviour. ( Iffaed , b/192682388 )
  • Added navigation-rail demo to the catalog app. ( I04960 )
  • Added badge demo to the catalog app. ( If285d )

Version 1.0

Version 1.0.5

November 3, 2021

androidx.compose.material:material-*:1.0.5 is released. Version 1.0.5 contains these commits.

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

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

Version 1.0.4

13 октября 2021 г.

androidx.compose.material:material-*:1.0.4 is 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.material:material-*:1.0.3 is 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.material:material-*:1.0.2 is released. Version 1.0.2 contains these commits.

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

Version 1.0.1

4 августа 2021 г.

androidx.compose.material:material-*:1.0.1 is released. Version 1.0.1 contains these commits.

Dependency Updates

  • Updated to depend on Kotlin 1.5.21 .

Версия 1.0.0

28 июля 2021 г.

androidx.compose.material:material-*:1.0.0 is released. Version 1.0.0 contains these commits.

Major features of 1.0.0

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

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

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

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

    To fix, temporarily increase your minSdkVersion to 24+ in your build.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

14 июля 2021 г.

androidx.compose.material:material-*:1.0.0-rc02 is released. Version 1.0.0-rc02 contains these commits.

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

  • Dialogs now follow the platform sizing behaviour. Set usePlatformDefaultWidth to false to override this behaviour. ( Iffaed , b/192682388 )

Version 1.0.0-rc01

July 1, 2021

androidx.compose.material:material-*:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.

Изменения API

  • Added BadgeBox component, see the docs and samples for usage information ( I5e284 )
  • useDefaultMaxWidth in PopupProperties was renamed to usePlatformDefaultWidth . ( I05710 )
  • Dialogs are now able to use the entire screen width. ( I83929 , b/190810877 )
  • Added Experimental Range Slider implementation ( I2f4b3 )

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

  • To align with Material Design specs OutlinedTextField with invalid input stopped using error color for label when label is being used as a placeholder. The latter is true when there is no input text in the text field and the text field is not in focus. With that change the meaning of the error:Boolean parameter in TextFieldColors.labelColor() function also changed: it will now return false even when the input is invalid if the label is being used as a placeholder. ( I45f78 )

Version 1.0.0-beta09

16 июня 2021 г.

androidx.compose.material:material-*:1.0.0-beta09 is released. Version 1.0.0-beta09 contains these commits.

Изменения API

  • Added Shape parameter to OutlinedTextField to be able to customize the shape of the border ( I8f39e , b/181322957 )
  • TextOverflow is changed to an inline class. ( I433af )

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

  • Scrim in BottomDrawer, BackdropScaffold and ModalBottomSheetLayout will disappear then the Color.Unspecified is passed ( I2d899 , b/182063309 )

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 APK 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 APK. ART can then leverage this profile when the APK 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

June 2, 2021

androidx.compose.material:material-*:1.0.0-beta08 is released. Version 1.0.0-beta08 contains these commits.

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

Behavior Breaking API Change

  • BEHAVIOUR-BREAKING: Card now consumes clicks, making clicks added via Card(Modifier.clickable) to be a no-op. Please, use new experimental overload of a Card that accepts onClick. ( Ia8744 , b/183775620 )
    • Added a new Card overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Card with the Modifier.clickable because the Card will not clip the ripple indication in those cases.
  • BEHAVIOUR-BREAKING: Surface now consumes clicks, making clicks added via Surface(Modifier.clickable) to be a no-op. Please, use new experimental overload of Surface that accepts onClick. ( I73e6c , b/183775620 )
    • Added a new Surface overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Surface with the Modifier.clickable because the Surface will not clip the ripple indication in those cases.

Изменения API

  • FabPosition was converted to inline class from enum to support potential expansion in the future ( I030fb )
  • 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 )
  • Replaced FocusState enum with a FocusState interface ( Iccc1a , b/187055290 )
  • Removed LocalRippleNativeRendering now that the View-backed ripple implementation is stable ( I7fab3 , b/188569367 )

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

  • 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 )
  • Added a README for the existing Compose Material catalog. ( If9191 )

Version 1.0.0-beta07

18 мая 2021 г.

androidx.compose.material:material-*:1.0.0-beta07 is released. Version 1.0.0-beta07 contains these commits.

Изменения API

  • You no longer need to use extension methods for route support in Navigation Compose. ( I22beb , b/172823546 )

Version 1.0.0-beta06

5 мая 2021 г.

androidx.compose.material:material-*:1.0.0-beta06 is released. Version 1.0.0-beta06 contains these commits.

Изменения API

  • Ripple has been migrated to use RippleDrawable internally on Android devices. This means that ripple animations will happen on the RenderThread, and so will be smooth even when the UI thread is under load, such as when navigating between screens. This does not change the API surface of ripple, but there may be behavior changes introduced as a result of this change. To aid the migration, LocalRippleNativeRendering has been added - provide a value of false to this CompositionLocal to fall back to the previous ripple implementation inside the CompositionLocalProvider. This API is temporary and will be removed in the future, so if you run into issues that cause you to use this API, please file a bug . ( I902f8 , b/168777351 , b/183019123 )
  • Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services ( Id54ef , b/180479017 )
  • Added accessibility API error that allows to mark a node that contains invalid input ( I12997 , b/180584804 , b/182142737 )

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

  • Updated Compose Material catalog insets implementation from: https://github.com/google/accompanist/pull/365. ( I25dc3 )
  • 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.material:material-*:1.0.0-beta05 is released. Version 1.0.0-beta05 contains these commits.

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

  • Added component tile images, theme picker, and more specific menu URLs to existing Compose Material catalog. ( I9b58e )

Version 1.0.0-beta04

April 7, 2021

androidx.compose.material:material-*:1.0.0-beta04 is released. Version 1.0.0-beta04 contains these commits.

Изменения API

  • API CHANGE: DrawerState state is no longer extends experimental SwipeableState.
    • API CHANGE: BottomDrawerState is now marked as Experimental, to match already Experimental BottomDrawer component ( I81114 , b/181656094 )
  • 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 )
  • LiveRegion accessibility API is added. If node is marked as a live region, the accessibility services will automatically notify the user about its changes ( Idcf6f , b/172590946 )

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

  • Added implementation of Compose Material catalog to existing module. Currently missing: component tile images, theme picker (to be added in follow-up changes). ( Ie7a94 )

Version 1.0.0-beta03

24 марта 2021 г.

androidx.compose.material:material-*:1.0.0-beta03 is 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 )
  • Added a new API LeadingIconTab to support displaying an icon and inline text in a tab. ( I23267 )

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

  • [by Jossi Wolf] BottomDrawer now wraps the content of the drawer slot. BottomDrawer doesn't throw an IllegalStateException when the parent has infinite height. The bottom drawer will now open to an expanded state if it is smaller than 50% of its parent. Docs around BottomDrawerState and ModalBottomSheetLayoutState have been updated. BottomDrawerState#isOpen returns true now if it is in either open or expanded state. ( I87241 )

Version 1.0.0-beta02

10 марта 2021 г.

androidx.compose.material:material-*:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.

Изменения API

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

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

  • Enforce restrictions on public usage of experimental APIs ( I6aa29 , b/174531520 )
  • Changed the default horizontal alignment for TopAppBar and BottomAppBar to Start, consistent with Row ( Ib2dc7 )
  • Added a new module and placeholder UI for a Compose Material catalog, currently nested in existing integration test demos. ( Idfcb3 )
  • androidx.compose.ui:ui no longer depends on AppCompat or Fragment. If you are using a ComposeView in your application, and you are using Fragment and/or AppCompat, make sure that you are using AppCompat 1.3+ / Fragment 1.3+ - these versions are needed to correctly set lifecycle and saved state owners required for ComposeView. ( I1d6fa , b/161814404 )

Version 1.0.0-beta01

February 24, 2021

androidx.compose.material:material-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

This is the first release of Compose 1.0.0 Beta.

Изменения API

  • 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 )
  • imageResource and vectorResource are now extension functions on ImageBitmap and ImageVector companions respectively. load{Image,Vector,Font}Resource functions have been deleted. ( I89130 )
  • 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 )
  • Switch, Checkbox and RadioButton action lambdas are now nullable. Checkbox-in-clickable-row samples updated to use this feature. ( If601b , b/171819073 )
  • 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 )
  • Add AccessibilityMananger interface and LocalAccessibilityMananger in CompositionLocals ( I53520 )
  • Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
  • Slider now supports enabled/disabled state ( I6d56b , b/179793072 )
  • Created new TextInputSession for input sessions from low level text components such as CoreTextField. ( I8817f , b/177662148 )
  • AnimationEndReason.Interrupted is removed. CancellationException will be throws if animation is interrupted. ( I2cbbc , b/179695417 )
  • Removed @ExperimentalRippleApi and changed RippleAlpha to be a class with properties instead of an interface. ( I6df7c )
  • Added TextFieldColors interface to represent different colors used in TextField and OutlinedTextField in different states. For defaut implementation see TextFieldDefaults.textFieldColors and TextFieldDefaults.outlinedTextFieldColors.
  • 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 )

  • Any composables marked with @ReadOnlyComposable are now compile-time validated to ensure that they only make calls to other @ReadOnlyComposables ( I58961 )

  • TargetAnimation API has been removed. ( If47d1 , b/177457083 )

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

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

  • 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. It is no longer necessary.
    • keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
    • Composer.collectKeySourceInformation has been removed. It is no longer necessary.
    • isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
    • Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
    • ( I99b7d , b/177245490 )
  • Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )

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

  • ZoomableController.smoothScaleBy and ZoomableController.stopAnimation are now suspend functions. ( I7f970 , b/177457083 )

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

  • Made the following Material API changes:

    • Added contentPadding parameter to Top/BottomAppBar to allow customizing the default padding.
    • Reordered parameters in BackdropScaffold to follow API guidelines for required parameters being before optional parameters.
    • Moved icon parameter in BottomNavigationItem to be after selected and onClick .
    • Renamed alwaysShowLabels parameter in BottomNavigationItem to alwaysShowLabel .
    • Renamed bodyContent parameters in a few components to just content .
    • Reordered parameters in ButtonDefaults.buttonColors() . Please note that because the type of the parameters have not changed, this will not cause an error in your code - please ensure you are either using named parameters or update the ordering manually, otherwise your code will not work the same as previously.
    • Added secondaryVariant parameter to darkColors() . This color is typically the same as secondary in dark theme, but adding for consistency and further customization.
    • Removed ElevationDefaults and animateElevation() from the public API surface since they were not commonly used / useful.
    • Renamed onValueChangeEnd in Slider to onValueChangeFinished and made it nullable.
    • Renamed text parameter in Snackbar to content for consistency.
    • Added contentPadding parameter to DropdownMenuItem to allow customizing the default padding and made content be an extension on RowScope .
    • Renamed ModalDrawerLayout to ModalDrawer .
    • Renamed BottomDrawerLayout to BottomDrawer .
    • ( I1cc66 )
  • BasicTextField now accepts Brush instead of Color for better customization ( I83a36 )

  • imageResource and vectorResource are now extension functions on ImageBitmap and ImageVector companions respectively. load{Image,Vector,Font}Resource functions have been deleted. ( I89130 )

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

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

  • 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.material:material-*:1.0.0-alpha12 is 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 )
  • BottomDrawerLayout and ListItem have been marked as @ExperimentalMaterialApi ( Id766e )
  • 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 )
  • 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 )
  • Make halfExpand() and expand() in ModalBottomSheetState internal ( Ic914e )
  • Changed Indication#createInstance to be @Composable, and changed LocalIndication to contain an Indication, not () -> Indication. ( I5eeea , b/157150564 )
  • Moved AlertDialog and DropdownMenu to be Android only for now. Added PopupProperties parameter to DropdownMenu for further configuration of the underlying Popup. ( I9c443 )
  • loadFontResource is deprecated. Use fontResource instead. imageResource, loadImageResource, vectorResource, and loadVectorResource are deprecated. Use painterResource instead. ( I6b809 )
  • Removed toggle and toggleModifier parameter from DropdownMenu, and renamed dropdownModifier , dropdownOffset and dropdownContent to modifier , offset and content respectively. DropdownMenu now behaves consistently to Popup , where the parent layout is used for the position of the menu. In most cases you can move toggle to be a sibling of DropdownMenu and wrap both in a Box . See the updated sample in the documentation for more information on usage of this API. ( I884fb )
  • toIntPx() was renamed to roundToPx(). ( I9b7e4 , b/173502290 )
  • IntBounds was renamed to IntRect and the API was improved. ( I1f6ff )
  • Added expand and collapse semantics actions. Added expand and halfExpand in ModalBottomSheetState ( Ib5064 )
  • Modifier.dragGestureFilter has been deprecated. Use Modifier.pointerInput { detectDragGestures (...)} instead. Alternatively, use Modifier.draggable for one axis drags ( I0ba93 , b/175294473 )
  • Renamed Ambients to match the Ambient -> CompositionLocal rename. Ambients used to be named AmbientFoo, now CompositionLocals are named LocalFoo. ( I2d55d )
  • 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 stateSaver parameter. The usage will look like this: val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) } ( Ib4c26 , b/177338004 )
  • Added ProgressBarRangeInfo.Indeterminate to mark indeterminate progress bars for accessibility ( I6fe05 )
  • @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 )

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

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

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

  • Changed Tab's text and icon parameters, and BottomNavigationItem's label parameter to be nullable, to better convey the behavior of the component when these parameters are / are not provided, since it affects the size and layout of the component. If you are currently passing emptyContent() to represent no text / icon / label, you should use null instead. ( I57ed4 )

  • Renamed contentColorFor color parameter to backgroundColor ( I5bb67 )

  • Deprecated TabDefaults and replaced it with TabRowDefaults. ( I0f189 )

  • Introduced ColorMatrix API used to modify rgb values of source content Refactored ColorFilter API to be an interface and match the implementation of PathEffect. ( Ica1e8 )

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

  • Add SemanticsProperties.PaneTitle API. ( I20d5a )

  • Added enabled parameters to Tab and BottomNavigationItem, to prevent them from being clickable. Changed BottomNavigationItem to be RowScope.BottomNavigationItem to better express its layout requirements in its API. ( Id683d )

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

  • Add layoutDirection param to Shape's createOutline. This allows to create layout direction aware shapes. ( I57c20 , b/152756983 )

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

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

  • Icon will now scale up to fit its size, respecting size modifiers applied to it. For example Icon(.., modifier = Modifier.size(50.dp) will now draw in a 50x50dp space. ( Ib2ba9 , b/178796190 )

Version 1.0.0-alpha11

January 28, 2021

androidx.compose.material:material-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.

Изменения API

  • Promotes some Material APIs to no longer be @Experimental ( I5d20e )
  • Content description parameter has been added to the Image and Icon. It is used to provide description to the accessibility services ( I2ac4c )
  • Changes Material stateful parameter interfaces to have @Composable functions that return State<T> . Adds Animatable.asState() to make it easier to convert an Animatable to a State. Also changes animateElevation to be a suspend extension on Animatable. ( If613c )
  • Snackbar, SnackbarHost, SnackbarHostState are not @ExperimentalMaterialAPI anymore ( Id1fb5 )
  • Changes Typography, Shapes, and TabPosition to no longer be data classes. Adds copy function for Typography and Shapes to replace the generated ones. ( I40037 )
  • Deleted some previously deprecated Material APIs ( Ifaa25 )

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

  • onCommit, onDispose, and onActive have been deprecated in favor of SideEffect and DisposableEffect APIs ( If760e )
  • TransitionDefinition-based Transition has been deprecated ( I0ac57 )
  • Initial State in updateTransition is now supported ( Ifd51d )
  • WithConstraints was reworked as BoxWithConstraints and moved to foundation.layout. ( I9420b , b/173387208 )
  • 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 )

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

  • The ripple used in Button and FloatingActionButton can no longer be customized by providing a new Indication through AmbientIndication - this was never intended to be a way to customize these components and this now makes these components consistent with other Material components. To customize ripples across an application, see RippleTheme. ( I546c5 )

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

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

  • Fix for a bug which made it not possible to set the width of the material text field be less than 280.dp ( I78373 )

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

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

  • Surface can now have multiple layout children. ( I66a92 , b/144488459 )

  • invalidate and compositionReference() are now deprecated in favor of currentRecomposeScope and rememberCompositionReference respectively. ( I583a8 )

  • Changes PopupPositionProvider to use window-relative coordinates, not global coordinates. Renames parentGlobalBounds to anchorBounds, and changes windowGlobalBounds to be windowSize: IntSize ( I2994a )

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

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

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

  • Easing has been changed to a functional interface ( Ib14e5 )

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

  • Removed experimental monotonicFrameAnimationClockOf methods ( Ib753f , b/170708374 )

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

  • Added Modifier.toolingGraphicsLayer which adds a graphics layer modifier when inspection is turned on. ( I315df )

  • FocusRequester.createRefs is now marked as experimental as it might change. ( I2d898 , b/177000821 )

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

  • Leverage TestCoroutineDispatcher in testing ( I532b6 )

  • Updated vector graphics API to support parsing of tinting applied to root of vector graphics. ( Id9d53 , b/177210509 )

Version 1.0.0-alpha10

13 января 2021 г.

androidx.compose.material:material-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.

Изменения API

  • 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 )
  • Renamed Position to DpOffset and removed getDistance() ( Ib2dfd )
  • Ranamed Color.useOrElse() to Color.takeOrElse() ( Ifdcf5 )
  • Add Toggle to foundation Strings.kt ( I4a5b7 , b/172366489 )
  • 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 )
  • Moved nativeClass to ui module and made it internal. Updated usages of nativeClass in equals implementations to use 'is MyClass' instead. ( I4f734 )

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

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

Version 1.0.0-alpha09

16 декабря 2020 г.

androidx.compose.material:material-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.

Изменения API

  • added API to manually trigger settle animation and drag in Modifier.swipeable ( Iaa17a , b/162408885 )
  • Renamed *Constants objects such as ButtonConstants to end with Defaults instead, such as ButtonDefaults. Also removes unnecessary default prefixes from properties in these new objects. ( Ibb915 , b/159982740 )
  • Compose supports property getters that can make composable invocations. Support for this is not going away, but the syntax for declaring a property getter as being @Composable is changing.

    The now-deprecated syntax for doing this was by annotating the property itself:

        @Composable val someProperty: Int get() = ...
    

    The now-correct syntax for doing this is by annotating the getter of the property:

       val someProperty: Int @Composable get() = ...
    

    Both syntaxes will work for some time, but the former deprecated syntax will eventually become a compile error. ( Id9197 )

  • Added androidx.compose.material:material-ripple library containing ripple APIs to allow building interactive components without needing the rest of the Material library. rememberRippleIndication has been deprecated and replaced with rememberRipple. ( Ibdf11 )

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

  • Lambdas in offset modifiers now return IntOffset rather than Float. ( Ic9ee5 , b/174137212 , b/174146755 )
  • 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 )

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

  • Moved Dp.VectorConverter, Position.VectorConverter, etc to animation-core, and deprecated the old VectorConveters ( If0c4b )

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

  • New infiniteRepeatable function for creating an InfiniteRepeatableSpec ( I668e5 )

  • The positioning behaviour of DropdownMenus was slightly changed according to the Material spec. ( I34c72 , b/168594123 )

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

  • Added Modifier.clearAndSetSemantics to clear descendants' semantics and set new ones. ( I277ca )

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

Version 1.0.0-alpha08

2 декабря 2020 г.

androidx.compose.material:material:1.0.0-alpha08 , androidx.compose.material:material-icons-core:1.0.0-alpha08 , and androidx.compose.material:material-icons-extended:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.

Изменения API

  • MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection. ( I1e6f4 , b/139320372 , b/139320907 )
  • Added 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 )
  • 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 )
  • fun RippleIndication() has been deprecated and replaced with rememberRippleIndication() for consistency with other APIs. ( Id8e2c )
  • 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 )

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

  • Add semantics action Dismiss ( I2b706 )
  • Moved DrawModifier APIs from the androidx.compose.ui package to the androidx.compose.ui.draw package. Created DrawModifierDeprecated.kt file to include typealiases/helper methods to assist with the migration from the deprecated to the current APIs. ( Id6044 , b/173834241 )
  • Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API feedback. ( I0bd29 , b/173834241 )
  • <T> was removed from SubcomposeLayout declaration. You can use it without specifying a type now. ( Ib60c8 )
  • Added Modifier.scale/rotate APIs as conveniences for drawLayer.
    • Renamed Modifier.drawOpacity to Modifier.alpha
    • Renamed Modifier.drawShadow to Modifier.shadow ( I264ca , b/173208140 )
  • 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 )
  • Introduced SweepGradientShader and SweepGradientBrush APIs. ( Ia22c1 )
  • Added lint check for Modifier parameters in Composable functions. This lint check checks the naming, return type, default value, and order of the parameter for consistency with Compose guidelines. ( If493b )
  • Updated TextFieldValue API
    • made TextFieldValue.composition readonly
    • removed exception thrown for invalid selection range ( I4a675 , b/172239032 )
  • Added a new Modifier.drawLayer() overload. It takes a lambda block on a new GraphicsLayerScope where you define the layer parameters in a way which allows to skip recomposition and relayout when the state change happens. DrawLayerModifier is now internal in preparation to migrating its logic into placeable.placeWithLayer() method of LayoutModifier ( I15e9f , b/173030831 )
  • Deprecated Ambients named with Ambient as their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 )
  • Added lint check to check that Modifier factories use androidx.compose.ui.composed {} internally, instead of being marked as @Composable . ( I3c4bc )
  • 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 for consistency with other units. ( Ifce19 )
  • The Alignment interface was updated and made functional. ( I46a07 , b/172311734 )
  • id was renamed to layoutId for LayoutIdParentData. Measurable.id was renamed to Measurable.layoutId. ( Iadbcb , b/172449643 )

Version 1.0.0-alpha07

November 11, 2020

androidx.compose.material:material:1.0.0-alpha07 , androidx.compose.material:material-icons-core:1.0.0-alpha07 , and androidx.compose.material:material-icons-extended:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.

Изменения API

  • Emphasis has been deprecated and replaced with AmbientContentAlpha. AmbientContentAlpha is a simpler abstraction that represents the preferred content alpha for part of the hierarchy, similar to how AmbientContentColor represents the preferred content color. Text and Icon now consume the current value from AmbientContentAlpha by default, and you can manually do: color.copy(alpha = AmbientContentAlpha.current) to have the same effect in your components. Instead of using ProvideEmphasis, you can just directly provide a value through AmbientContentAlpha, and use the new default levels in ContentAlpha to replace the old EmphasisLevels. ( Idf03e , b/159017896 )
  • Adds androidx.compose.material.AmbientContentColor to replace androidx.compose.foundation.AmbientContentColor ( I84f7b , b/172067770 )
  • Adds androidx.compose.material.Text to replace androidx.compose.foundation.Text as a high level, themeable Text component. For a basic text component that does not consume color / text style from the theme, use BasicText. ( Ie6ae0 )
  • Added maxLines to TextFields ( Ib2a5b )
  • Update TextFields to accept KeyboardOptions ( Ida7f3 )
  • Surface now uses the absolute (total) elevation when calculating elevation overlays, so a Surface nested in another Surface will use the combined elevation to draw the overlay. ( I7bd2b , b/171031040 )

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

  • captureToBitmap moved to captureToImage . ( I86385 )
  • 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 )
  • Rename KeyboardOptions as ImeOptions ( I82f36 )
  • Moved KeyboardType and ImeAction into KeyboardOptions ( I910ce )
  • BaseTextField has been deprecated. Use BasicTextField instead. ( I896eb )
  • ExperimentalSubcomposeLayoutApi annotation was removed. SubcomposeLayout can now be used without adding @OptIn ( I708ad )
  • FirstBaseline and LastBaseline were moved to androidx.compose.ui.layout package ( Ied2e7 )
  • 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 )
  • relativePaddingFrom was renamed to paddingFrom. The paddingFromBaseline modifier was added, as convenience for specifying distances from layout bounds to text baselines. ( I0440a , b/170633813 )
  • LaunchedTask was renamed to LaunchedEffect for consistency with the SideEffect and DisposableEffect APIs. LaunchedEffect with no subject params is not permitted in order to encourage best practices. ( Ifd3d4 )
  • 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 )

Version 1.0.0-alpha06

28 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha06 , androidx.compose.material:material-icons-core:1.0.0-alpha06 , and androidx.compose.material:material-icons-extended: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 )
  • Adds FloatingActionButtonElevation to represent elevation used by FABs in different states. See FloatingActionButtonConstants.defaultElevation() for the default implementation ( I2d4f5 )
  • Adds SwitchColors interface to represent colors used by a Switch in different states. See SwitchConstants.defaultColors to customize these colors. ( I93805 )
  • Adds ButtonElevation and ButtonColors interfaces to represent elevation and colors used by buttons in different states. See the default functions in ButtonConstants to customize these parameters. ( Ic5b7b )
  • Adds RadioButtonColors interface to represent colors used by a RadioButton in different states. See RadioButtonConstants.defaultColors() to customize the colors used in different states. ( I74130 )
  • Adds CheckboxColors interface to represent colors used by a checkbox in different states. See CheckboxConstants.defaultColors() to customize the colors used in different states. ( I7dbdb )

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

  • Material components do not set the elevation as zIndex anymore. Which means that within the same parent the child with larger shadow size will not be drawn on top of the child with the smaller one automatically. If you still need such behavior please set Modifier.zIndex() manually where needed ( I70417 , b/170623932 )
  • 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 )
  • Refactored DrawScope and ContentDrawScope to be interfaces instead of abstract classes
    • Created CanvasDrawScope implementation of DrawScope
    • Refactored implementations of DrawScope to use CanvasScope instead
    • Created DrawContext to wrap dependencies for DrawScope
    • Removed deprecated methods on DrawScope ( I56f5e )
  • Box was made an inline function. ( Ibce0c , b/155056091 )

Version 1.0.0-alpha05

14 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha05 , androidx.compose.material:material-icons-core:1.0.0-alpha05 , and androidx.compose.material:material-icons-extended:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.

Изменения API

  • Popups and dialogs now inherit FLAG_SECURE from parent Window. Also added option to configure this explicitly ( I64966 , b/143778148 , b/143778149 )
  • Modifier.swipeable has 56.dp thresholds for states by default now ( Iab825 , b/168610267 )
  • all scaffold states marked as @Stable. drawerGesturesEnabled in ScaffoldState moved to Scaffold itself. ( I36645 , b/168297016 )
  • Removes nullable type from Scaffold lambda parameters, you can use emptyContent() to represent no content for a given parameter. ( I2b318 , b/157633857 , b/158551084 )
  • 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 )
  • Adds AmbientElevationOverlay, allowing customizing / disabling the default elevation overlay applied to Surfaces in dark theme. ( I5b74d )

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

  • As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes ( I97611 , b/169797763 )
  • TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. ( I175c9 , b/158830170 )
  • launchInComposition renamed to LaunchedTask to match Compose API guidelines ( I99a8e )
  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). ( I587e8 , b/169083903 )

Version 1.0.0-alpha04

1 октября 2020 г.

androidx.compose.material:material:1.0.0-alpha04 , androidx.compose.material:material-icons-core:1.0.0-alpha04 , and androidx.compose.material:material-icons-extended:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

Изменения API

  • Exposes InteractionState parameters in stateful Material components, to allow hoisting the state and reading / controlling the state. ( Iaca5f , b/168025711 , b/167164434 )
  • Changes the *color parameters on RadioButton and TriStateCheckbox to allow fully customizing the colors used in each state, as well as changing how the colors animate between states if desired. See the new animateDefault* color functions in CheckboxConstants and RadioButtonConstants for more information. ( I1c532 )
  • Renamed rememberBackdropState to rememberBackdropScaffoldState and added an additional param for the animation clock. Renamed the param backdropScaffoldState of BackdropScaffold to just scaffoldState. Renamed BackdropConstants to BackdropScaffoldConstants. ( Ib644d )
  • Added experimental BottomSheetScaffold component. ( Ie02f0 , b/148996320 )
  • Added experimental ModalBottomSheetLayout component. ( Ic209e , b/148996320 )
  • Renames ButtonConstants/FloatingActionButtonConstants.defaultAnimatedElevation to defaultElevation, and now returns a Dp value instead of an AnimatedValue. ( I5f3ed )

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

  • Updated many Graphics APIs
    • Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
    • Removed Rect.expandToInclude and Rect.join methods
    • Updated Radius documentation to say oval in addition to elliptical
    • Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
    • Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
    • Deprecated Rect.shift in favor of Rect.translate
    • Removed RoundRect.grow and Rect.shrink APIs
    • Renamed RoundRect.outerRect to Rect.boundingRect
    • Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
    • Renamed RoundRect.longestSide to RoundRect.maxDimension
    • Renamed RoundRect.shortestSide to RoundRect.minDimension
    • Changed RoundRect.center to be a property instead of a function
    • Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
    • Removed Size APIs that assumed it was a Rectangle with origin at 0,0
    • Added a destructing API to Radius
    • Migrated various RoundRect extension functions to be properties instead
    • ( I8f5c7 , b/168762961 )
  • foundation.Box was deprecated. Please use foundation.layout.Box instead. ( Ie5950 , b/167680279 )
  • Stack was renamed to Box. The previously existing Box will be deprecated in favor of the new Box in compose.foundation.layout. The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. ( I94893 , b/167680279 )
  • Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) ( Ibae92 , b/167680279 )
  • Updated many Graphics APIs
    • Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
    • Updated clipPath documentation to refer to Path instead of rounded rectangle
    • Fixed spacing in documentation for right parameter in clipPath
    • Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
    • Renamed dx/dy parameters in inset method to horizontal and vertical
    • Added inset overload that provides the same inset value to all 4 bounds
    • Removed documentation on inset method indicating that inset would be applied to all 4 sides
    • Updated documentation for Rect class
    • Updated comments on Rect parameters to match kdoc style
    • Removed Rect.join and Rect.expandToInclude
    • Created overload for Rect.translate(offset) and deprecated Rect.shift
    • ( If086a , b/167737376 )
  • 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 )

Version 1.0.0-alpha03

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

androidx.compose.material:material:1.0.0-alpha03 , androidx.compose.material:material-icons-core:1.0.0-alpha03 , and androidx.compose.material:material-icons-extended:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.

Изменения API

  • Renames BottomNavigationItem 's onSelect parameter to onClick ( I91925 , b/161809324 )
  • Adds InteractionState parameter to BottomNavigationItem and Tab, allowing hoisting this state and adjusting how the component appears in different states. ( Ia3e9e , b/168025711 )
  • Removes disabledBackgroundColor and disabledContentColor parameters from buttons. You should instead use the new default color functions inside ButtonConstants. If you are already setting contentColor / backgroundColor explicitly, you should instead use these default functions and customize some / all of the parameters to avoid overwriting the color for both enabled / disabled states. ( If9b52 )
  • Textfield's background color does not implicitly apply transparency alpha anymore. Instead, any color provided through the backgroundColor parameter will be applied directly. ( Iecee9 , b/167951441 )
  • InnerPadding was renamed to PaddingValues. ( I195f1 , b/167389171 )
  • The params resistanceFactorAtMin and resistanceFactorAtMax in Modifier.swipeable were replaced with a single resistance param. A new defaultResistanceConfig method was added in SwipeableConstants . ( I54238 )
  • Adds animated stateful elevation support for Button and FloatingActionButton. The elevation now animates between default and pressed states. To customize the elevation between states, please use ButtonConstants.defaultAnimatedElevation() and FloatingActionButtonConstants.defaultAnimatedElevation() instead of setting a flat Dp value in all cases. ( I37925 )
  • Label became an optional parameter inside TextField and OutlinedTextField ( I267f6 , b/162234081 )

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

  • Global testing functions such as onNode or waitForIdle are now deprecated, please migrate to their new counterparts that are defined on ComposeTestRule ( I7f45a )
  • 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 )
  • Remove scroll forward/backward semantics actions. Added steps in AccessibilityRangeInfo. ( Ia47b0 )
  • Usages of gravity were consistently renamed to align or alignment in layout APIs. ( I2421a , b/164077038 )
  • Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. ( Ieae36 )
  • 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.material:material:1.0.0-alpha02 , androidx.compose.material:material-icons-core:1.0.0-alpha02 , and androidx.compose.material:material-icons-extended:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

Изменения API

  • Added an experimental BackdropScaffold component. ( Iad908 )

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

  • Matrix4 was replaced with Matrix. All other parts of vectormath package have been removed. ( Ibd665 , b/160140398 )

Version 1.0.0-alpha01

26 августа 2020 г.

androidx.compose.material:material:1.0.0-alpha01 , androidx.compose.material:material-icons-core:1.0.0-alpha01 , and androidx.compose.material:material-icons-extended:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

Known Issue

= The first character in a material TextField cannot be removed using a backspace ( b/165956313 )

Version 0.1.0-dev

Version 0.1.0-dev17

August 19, 2020

androidx.compose.material:material:0.1.0-dev17 , androidx.compose.material:material-icons-core:0.1.0-dev17 , and androidx.compose.material:material-icons-extended:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.

Изменения API

  • Previously deprecated RadioGroup and RadioGroupItems have been removed. Use Row and RadioBotton instead ( I381b7 , b/163806637 )
  • 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 )
  • Renamed some properties in SwipeableState: swipeTarget -> targetValue, swipeProgress -> progress, swipeDirection -> direction. Added a rememberSwipeableState function for creating SwipeableStates. ( I2fc9c , b/163129614 , b/163132293 )
  • Snackbar support with positioning and proper queueing has been added. Access it via SnackbarHostState.showSnackbar suspend function. Кроме того:
    • SnackbarHost components has been added. It hosts Snackbars based on the state and is responsible for transition between snackbars.
    • SnackbarHostState has been added to allow for control over snackbars, snackbars hosts and to decouple it from the ScaffoldState. you can access this state via scaffoldState.snackbarHostState as well.
    • Snackbar overload has been added to support common interface between snackbarHostState and snackbars itself. ( I79aaa )
  • Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton ( I0a941 , b/161809385 , b/161807956 )
  • ListItem version with String-based API has been removed. Use slot version instead. ( Ib8f57 , b/161804681 )
  • Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. ( I5e889 )
  • AlertDialog now uses FlowRow for buttons ( I00ec1 , b/161809319 , b/143682374 )
  • Added params in Modifier.swipeable for changing the amount of resistance when swiping past the bounds. Removed [min/max]Value params. ( I93d98 )
  • 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 )
  • Optional param velocityThreshold added to Modifier.swipeable. ( I698ba )
  • bottomBarSize, fabSize and others and not available anymore in ScaffoldState. Use Modifier.onPosition instead on the component you'd like to know the size of. contentColor and Modifier pamateres have been added to Scaffold ( Ic6f7b , b/161811485 , b/157174382 )
  • Renames and reorders some parameters in Tab for consistency with other APIs ( Ia2d12 , b/161807532 )
  • Splits TabRow into TabRow and ScrollableTabRow, removing isScrollable from TabRow. Also exposes edgePadding in ScrollableTabRow, which allows controlling the free space before / after the tabs. ( I583e8 , b/161809544 )
  • The TabRow object has been removed, replacing it with TabConstants. TabRow.TabPosition has moved to be top level (TabPosition), and indicatorContainer has been renamed to indicator . See the samples and documentation for detailed information on how to use the updated API, and defaults. ( I54d45 , b/161809544 )
  • The thresholds param in Modifier.swipeable was tweaked; it now takes a pair of states (of type T) and returns the threshold between them in the form of a ThresholdConfig. A param dismissThresholds was added to SwipeToDismiss, which is a lambda (DismissDirection) -> ThresholdConfig. ( Ie1080 )
  • Slider has more colors for granular customization ( I73e64 , b/161810475 )
  • Card's color param was renamed to backgroundColor ( I01fc1 , b/161809546 )
  • Snackbar has customizable background and content colors now ( I238f2 , b/161804381 )
  • modifier, backgroundColor, contentColor and scrimColor customization params has been added to Drawers ( I23655 , b/161804378 )
  • 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 )
  • Button's padding param was renamed to contentPadding ( Id252e , b/161809394 )
  • Add an experimental material component SwipeToDismiss. ( I129e5 )

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

  • Removed onChildPositioned and OnChildPositionedModifier . Developers should use onPositioned and OnPositionedModifier on the child layout instead. ( I4522e , b/162109766 )
  • 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 )
  • IntSize is now an inline class ( I2bf42 )
  • 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 )
  • Deprecated PxBounds in favor of Rect. Updated all usages of PxBounds with rect and added proper deprecate/replace with annotations to assist with the migration. ( I37038 , b/162627058 )
  • Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors ( I5d325 )

Version 0.1.0-dev16

5 августа 2020 г.

androidx.compose.material:material:0.1.0-dev16 , androidx.compose.material:material-icons-core:0.1.0-dev16 , and androidx.compose.material:material-icons-extended:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.

Изменения API

  • Colors is now a final class instead of an interface. Instead of extending and providing a custom implementation, you should create a new ambient for your custom theme object, and access the theme object through the new ambient in your components, similar to how MaterialTheme works internally. ( Ibae84 )
  • Renamed ColorPalette to Colors, to better map to the Material color system and remove confusion over ColorPalette being a 'generic' theming object, as opposed to being a specific implementation of the Material color system. Additionally renames lightColorPalette and darkColorPalette to lightColors and darkColors respectively. ( I9e976 , b/161812111 )
  • Renames BottomNavigationItem's text parameter to label , onSelected to onSelect , activeColor to selectedContentColor , inactiveColor to unselectedContentColor and updates parameter ordering to match guidelines. ( Icb605 , b/161809324 )
  • Modifier.stateDraggable was completely reworked and renamed to Modifier.swipeable. A new SwipeableState class was introduced, and DrawerState and BottomDrawerState were refactored to inherit from it. [Modal/Bottom]DrawerLayout no longer takes an onStateChange parameter. ( I72332 , b/148023068 )
  • foundation.shape.corner package were flatten to foundation.share ( I46491 , b/161887429 )
  • Added ExperimentalMaterialApi annotation. RippleTheme marked as Experimental ( Ic5fa0 , b/161784800 )
  • 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 )

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

  • OnChildPositioned has been deprecated. Use OnPositioned on the child instead. ( I87f95 , b/162109766 )
  • 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
  • Move dialog to ui ( I47fa6 )
  • 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.deternimateProgress has been renamed to Modifier.progressSemantics ( I9c0b4 )
  • Updates material-icons-extended with the latest icons added to Material.io/icons ( I4b1d3 )
  • Require type T to be explicitly specified for transitionDefinition. ( I1aded )
  • 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 )
  • Renamed AndroidComposeTestRule to createAndroidComposeRule. ( I70aaf )
  • Add isFocused() and isNotFocused() SemanticsMatcher. ( I0b760 )
  • Removed BaseGestureScope.globalBounds , which shouldn't be used from tests. Use coordinates local to the node with which you're interacting instead. ( Ie9b08 )
  • Fixed popup position on cut-out displays. ( Idd7dd )
  • Modifier.drawBackground has been renamed to Modifier.background ( I13677 )

Version 0.1.0-dev15

22 июля 2020 г.

androidx.compose.material:material:0.1.0-dev15 , androidx.compose.material:material-icons-core:0.1.0-dev15 , and androidx.compose.material:material-icons-extended:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.

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

  • @Model annotation is now deprecated. Use state and mutableStateOf as alternatives. This deprecation decision was reached after much careful discussion.

    Обоснование

    Rationale includes but is not limited to:

    • Reduces API surface area and concepts we need to teach
    • More closely aligns with other comparable toolkits (Swift UI, React, Flutter)
    • Reversible decision. We can always bring @Model back later.
    • Removes corner-case usage and difficult to answer questions about configuring @Model as things we need to handle
    • @Model data classes, equals, hashcode, etc.
    • How do I have some properties “observed” and others not?
    • How do I specify structural vs. referential equality to be used in observation?
    • Reduces “magic” in the system. Would reduce the likelihood of someone assuming system was smarter than it is (ie, it knowing how to diff a list)
    • Makes the granularity of observation more intuitive.
    • Improves refactorability from variable -> property on class
    • Potentially opens up possibilities to do hand-crafted State-specific optimizations
    • More closely aligns with the rest of the ecosystem and reduces ambiguity towards immutable or us “embracing mutable state”

    Migration Notes

    Almost all existing usages of @Model are fairly trivially transformed in one of two ways. The example below has a @Model class with two properties just for the sake of example, and has it being used in a composable.

    @Model class Position(
     var x: Int,
     var y: Int
    )
    
    @Composable fun Example() {
     var p = remember { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p.x = it }
       onYChange={ p.y = it }
     )
    }
    

    Alternative 1: Use State<OriginalClass> and create copies.

    This approach is made easier with Kotlin's data classes. Essentially, make all previously var properties into val properties of a data class, and then use state instead of remember , and assign the state value to cloned copies of the original using the data class copy(...) convenience method.

    It's important to note that this approach only works when the only mutations to that class were done in the same scope that the State instance is created. If the class is internally mutating itself outside of the scope of usage, and you are relying on the observation of that, then the next approach is the one you will want to use.

    data class Position(
     val x: Int,
     val y: Int
    )
    
    @Composable fun Example() {
     var p by state { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p = p.copy(x=it) }
       onYChange={ p = p.copy(y=it) }
     )
    }
    

    Alternative 2: Use mutableStateOf and property delegates

    This approach is made easier with Kotlin's property delegates and the mutableStateOf API which allows you to create MutableState instances outside of composition. Essentially, replace all var properties of the original class with var properties with mutableStateOf as their property delegate. This has the advantage that the usage of the class will not change at all, only the internal implementation of it. The behavior is not completely identical to the original example though, as each property is now observed/subscribed to individually, so the recompositions you see after this refactor could be more narrow (a good thing).

    class Position(x: Int, y: Int) {
     var x by mutableStateOf(x)
     var y by mutableStateOf(y)
    }
    
    // source of Example is identical to original
    @Composable fun Example() {
     var p = remember { Position(0, 0) }
     PositionChanger(
       position=p,
       onXChange={ p.x = it }
       onYChange={ p.y = it }
     )
    }
    

    ( I409e8 , b/152050010 , b/146362815 , b/146342522 , b/143413369 , b/135715219 , b/143263925 , b/139653744 )

  • onFocusChange callback in text fields renamed to onFocusChanged ( Ida4a1 )

  • Added thresholds param in stateDraggable to specify thresholds between anchors. This was used to set a 56dp threshold in bottom drawer. Also BottomDrawerLayout now uses a separate BottomDrawerState enum. ( I533fa )

  • 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 deprecated override of FilledTextField composable ( I7f8f8 )

  • Rename Button object (containing the defaults used by Button function) to ButtonConstants ( I7c5f7 , b/159687878 )

  • Button's content slot now behaves as Row (useful when you need to have an icon with a text, see samples on Button how to write it) ( I0ff10 , b/158677863 )

  • RadioGroup and RadioGroupItem have been deprecated. Use Box with Modifier.selectable, Row and Column to make proper set of radioButton choices by your design ( I7f5cf , b/149528535 )

  • Added Material Outlined Textfield ( I1a518 )

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

  • TabRow.TabPosition not contains position in Dp, not in IntPx ( I34a07 , b/158577776 )

  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. ( Ib7b44 )

  • In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. ( Ic0191 )

  • Deprecates 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. ( I101cd , b/155375067 )

  • Scaffold API has been reworked: few parameters changed their name, added new parameters for better customization. Added getter to query sizes of Fab, TopBar and BottomBar ( I0e7ce )

  • Added the DropdownMenu component in ui-material, a Material Design menu implementation. ( I9bb3d )

  • Allow to show/hide software keyboard manually using SoftwareKeyboardController ( Ifb9d6 , b/155427736 )

  • Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements ( I8425f , b/155287131 )

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

  • Renames Emphasis.emphasize() to Emphasis.applyEmphasis() ( Iceebe )

  • Disabled buttons now visually follows the Material Design specification ( I47dcb , b/155076924 )

  • FilledTextField gets ime action, visual transformation and keyboard type support ( I1f9cf , b/155075201 )

  • Adds strokeWidth parameter to CircularProgressIndicator to customize the stroke size. To change the stroke size (height) of a LinearProgressIndicator, you can use Modifier.preferredHeight() or another size modifier. ( Icea16 , b/154919081 )

  • Adds strokeWidth parameter to CircularProgressIndicator to customize the stroke size. To change the stroke size (height) of a LinearProgressIndicator, you can use Modifier.preferredHeight() or another size modifier. ( Icea16 , b/154919081 )

  • Added slot API for trailing and leading icons in the FilledTextField and handling of the error state ( Ic12e0 )

  • FAB's and Extended FAB's default color has been changed to MaterialTheme.colors.secondary. ( I3b9b9 , b/154118816 )

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

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

  • Slider is now stateless. Users will need to pass and update state by themselves, just like in any other control. ( Ia00aa )

  • StaticDrawer was removed. If you need it, use Box with material-spec'ed width instead ( I244a7 )

  • Added Material Design implementation of Filled Text Field ( Ic75cd )

  • Added modifier param to ListItem and reordered params to promote trailing lambda body ( I66e21 )

  • Adds defaultFontFamily constructor parameter to Typography, allowing specifying the default font family that will be used for any provided TextStyles that do not have a family set. ( I89d07 )

  • Temporarily removed Material Data Tables from the API surface. ( Iaea61 )

  • Renamed paramaters in Divider composable ( Ic4373 )

  • children ( Ia6d19 )

  • Removes MaterialTheme.emphasisLevels, instead use EmphasisAmbient.current to retrieve the emphasis levels ( Ib5e40 )

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

  • Changed MaterialTheme APIs such as MaterialTheme.colors(), MaterialTheme.typography() to be properties instead of functions. Remove parentheses from existing calls, no behavioral change is expected. ( I3565a )

  • Refactored FloatingActionButton APIs to accept composable lambdas instead of primitives. See updated samples for usage information. ( I00622 )

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

  • Surface and Card were moved from androidx.ui.material.surface to androidx.ui.material ( I88a6d , b/150863888 )

  • 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. _Body:Created extension method on android.graphics.Bitmap, Bitmap.asImageAsset(), to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework ( Id5bbd )

  • Removed Snackbar API with String parameters in favour of using the overload that accepts composable lambdas. See updated samples for usage information ( I55f80 )

  • Refactored Tab APIs to accept text and icon lambdas, ( Ia057e )

  • Added BottomNavigation component, see the docs and samples for usage information ( I731a0 )

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

  • Replaced ButtonStyle with distinct functions and removed text (string) overload. See updated samples for usage information. ( If63ab , b/146478620 , b/146482131 )

  • rename Border modifier to DrawBorder ( I8ffcc )

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

  • Breaking changes to the ambients API. See log and Ambient<T> documentation for details ( I4c7ee , b/143769776 )

  • Scaffold material component has been added. Scaffold implements ( I7731b )

  • Replaced DrawBorder in favor of Border Modifier ( Id335a )

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

  • 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 )
  • 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 )
  • runOnIdleCompose renamed to runOnIdle ( I83607 )
  • 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 )
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. ( I7f164 )
  • Transition API has been changed to return a TransitionState instead of passing the TransitionState to children. This makes the API more consistent with animate() APIs. ( I24e38 )
  • An IntBounds unit class has been added, representing integer pixel bounds from layout. The API of PopupPositionProvider has been updated to use it. ( I0d8d0 , b/159596546 )
  • A new optional flag useUnmergedTree was added to test finders. ( I2ce48 )
  • Removed obsolete size testing APIs. ( Iba0a0 )
  • Removed Shader inline class that wrapped the NativeShader expect class Renamed NativeShader to Shader. The wrapped Shader inline class did not add anything valuable to the API surface and was an inline class, so use the NativeShader class directly. ( I25e4d )
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme ( Ia3665 , b/156527485 )
  • Material DropdownMenu are now scrollable. ( Ide699 )
  • 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 )
  • 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 )
  • Switch now appears in a disabled state when enabled is set to false ( If4624 , b/155941869 , b/159331694 )
  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. ( I995f0 )
  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. ( I896c5 , b/158134875 )
  • 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 )

  • In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. ( I3ad98 )

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

  • Toggleable component has been deprecated. Use Modifier.toggleable instead ( I35220 , b/157642842 )

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

  • Fixed onClick not being invoked for DropdonMenuItems. ( I3998b , b/157673259 )

  • MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. ( I02b47 , b/157642842 )

  • TestTag is now deprecated. Use Modifier.testTag instead. ( If5110 , b/157173105 )

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

  • 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.semantics has been undeprecated to allow usages for high level components. ( I4cfdc )

  • DrawLayer modifiers api has been changed: outlineShape renamed to shape and has the RectangleShape default value and now non-nullable; clipToOutline renamed to clip; clipToBounds removed as it is the same as clip == true with RectangleShape ( I7ef11 , b/155075735 )

  • Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. ( I80afd )

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

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

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

  • FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. ( Ic4826 )

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

  • Add cursor color customisation to the TextField ( I6e33f )

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

  • Renamed LayoutModifier2 to LayoutModifier. ( Id29f3 )

  • Removed deprecated LayoutModifier interface. ( I2a9d6 )

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

  • Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. ( Id9945 )

  • New Modifier.zIndex() is added to control the drawing order of the children within the same parent layout. elevation property on DrawLayerModifier is renamed to shadowElevation and doesn't control the drawing order anymore. The params order fo DrawShadow is changed: elevation is now the first one and the shape is the second one with a RectangleShape default. ( I20150 , b/152417501 )

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

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

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

  • Created PixelMap API to support querying pixel information from an ImageAsset. ( I69ad6 )

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

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

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

  • Added positionInParent and boundsInParent for LayoutCoordinates. ( Icacdd , b/152735784 )

  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. ( I499fa , b/152753731 )

  • Renamed LayoutResult to MeasureResult. ( Id8c68 )

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

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

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

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

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

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

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

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

  • Removed RepaintBoundary in favor of DrawLayerModifier ( I00aa4 )

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

  • The Opacity composable function has been replaced with the drawOpacity modifier. ( I5fb62 )

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

  • Added LayerModifier, a modifier that allows adding a RenderNode for a Layout. It allows setting clipping, opacity, rotation, scaling, and shadows. This will replace RepaintBoundary. ( I7100d , b/150774014 )

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

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

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

  • WithConstraints got LayoutDirection parameter ( I6d6f7 )

  • Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. ( I3d955 )

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

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

  • Support right-to-left direction in LayoutPadding modifier ( I9e8da )

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

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

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

  • Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) ( I11cb1 )

  • Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. ( I0245a )

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

  • Improvements to the API surface of Constraints ( I0fd15 )