Составьте материал
androidx.compose.material
androidx.compose.material.icons
( См. справочную документацию по API для всех пакетов compose )
| Последнее обновление | Стабильный релиз | Предварительная версия релиза | Бета-версия | Альфа-версия |
|---|---|---|---|---|
| 17 декабря 2025 г. | 1.10.0 | - | - | 1.11.0-alpha02 |
Структура
Compose — это комбинация из 7 идентификаторов групп Maven в рамках androidx . Каждая группа содержит целевой набор функций, каждый со своим набором примечаний к выпуску.
В этой таблице поясняются группы и приводятся ссылки на каждый набор примечаний к выпуску.
| Группа | Описание |
|---|---|
| compose.animation | Создавайте анимации в их приложениях Jetpack Compose, чтобы улучшить пользовательский опыт. |
| compose.compiler | Преобразуйте функции с аннотацией @Composable и включите оптимизацию с помощью плагина компилятора Kotlin. |
| compose.foundation | Создавайте приложения Jetpack Compose, используя готовые к применению строительные блоки, и расширяйте их функциональность для создания собственных элементов дизайн-системы. |
| compose.material | Создавайте пользовательские интерфейсы Jetpack Compose с помощью готовых компонентов Material Design. Это более продвинутый уровень Compose, предназначенный для предоставления компонентов, соответствующих описанию на сайте www.material.io. |
| compose.material3 | Создавайте пользовательские интерфейсы Jetpack Compose с помощью компонентов Material Design 3 — следующей эволюции Material Design. Material 3 включает в себя обновленные темы оформления и компоненты, а также функции персонализации Material You, такие как динамический цвет, и разработан таким образом, чтобы гармонично сочетаться с новым визуальным стилем Android 12 и системным интерфейсом. |
| compose.runtime | Основные компоненты программной модели Compose и системы управления состоянием, а также основная среда выполнения, на которую ориентирован плагин компилятора Compose. |
| compose.ui | Основные компоненты Compose UI, необходимые для взаимодействия с устройством, включают в себя компоновку, отрисовку и ввод данных. |
Объявление зависимостей
Чтобы добавить зависимость от Compose, необходимо добавить репозиторий Google Maven в ваш проект. Для получения дополнительной информации ознакомьтесь с информацией в репозитории Google Maven .
Добавьте зависимости для необходимых артефактов в файл build.gradle вашего приложения или модуля:
классный
dependencies { implementation "androidx.compose.material:material:1.10.0" } android { buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Котлин
dependencies { implementation("androidx.compose.material:material:1.10.0") } android { buildFeatures { compose = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } kotlinOptions { jvmTarget = "1.8" } }
Для получения дополнительной информации о зависимостях см. раздел «Добавление зависимостей сборки» .
Обратная связь
Ваши отзывы помогают улучшить Jetpack. Сообщите нам, если вы обнаружите новые проблемы или у вас есть идеи по улучшению этой библиотеки. Пожалуйста, ознакомьтесь с существующими проблемами в этой библиотеке, прежде чем создавать новую. Вы можете проголосовать за существующую проблему, нажав кнопку со звездочкой.
Для получения более подробной информации см. документацию по системе отслеживания ошибок .
Версия 1.11
Версия 1.11.0-alpha02
17 декабря 2025 г.
Выпущена версия androidx.compose.material:material-*:1.11.0-alpha02 . Версия 1.11.0-alpha02 содержит следующие коммиты .
Версия 1.11.0-alpha01
3 декабря 2025 г.
Выпущена версия androidx.compose.material:material-*:1.11.0-alpha01 . Версия 1.11.0-alpha01 содержит следующие коммиты .
Версия 1.10
Версия 1.10.0
3 декабря 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0 . Версия 1.10.0 содержит следующие коммиты .
Версия 1.10.0-rc01
19 ноября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-rc01 . Версия 1.10.0-rc01 содержит следующие коммиты .
Версия 1.10.0-beta02
5 ноября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-beta02 . Версия 1.10.0-beta02 содержит следующие коммиты .
Версия 1.10.0-beta01
22 октября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-beta01 . Версия 1.10.0-beta01 содержит следующие коммиты .
Версия 1.10.0-alpha05
8 октября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-alpha05 . Версия 1.10.0-alpha05 содержит следующие коммиты .
Версия 1.10.0-alpha04
24 сентября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-alpha04 . Версия 1.10.0-alpha04 содержит следующие коммиты .
Версия 1.10.0-alpha03
10 сентября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-alpha03 . Версия 1.10.0-alpha03 содержит следующие коммиты .
Версия 1.10.0-alpha02
27 августа 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-alpha02 . Версия 1.10.0-alpha02 содержит следующие коммиты .
Версия 1.10.0-alpha01
13 августа 2025 г.
Выпущена версия androidx.compose.material:material-*:1.10.0-alpha01 . Версия 1.10.0-alpha01 содержит следующие коммиты .
Исправлены ошибки
- Перенос
minSdkпо умолчанию с API 21 на API 23. ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
Версия 1.9
Версия 1.9.5
19 ноября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.5 . Версия 1.9.5 содержит следующие коммиты .
Версия 1.9.4
22 октября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.4 . Версия 1.9.4 содержит следующие коммиты .
Версия 1.9.3
8 октября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.3 . Версия 1.9.3 содержит следующие коммиты .
Версия 1.9.2
24 сентября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.2 . Версия 1.9.2 содержит следующие коммиты .
Версия 1.9.1
10 сентября 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.1 . Версия 1.9.1 содержит следующие коммиты .
Версия 1.9.0
13 августа 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0 . Версия 1.9.0 содержит следующие коммиты .
Важные изменения по сравнению с версией 1.8.0
Изменения в поведении
- Для корректной проверки кода, поставляемой с Compose, теперь требуется минимальная версия AGP 8.8.2. Если вы не можете обновить AGP, вы можете обновить Lint самостоятельно, используя
android.experimental.lint.version=8.8.2(или более новую версию) в файле gradle.properties. Для запуска проверок кода Compose внутри IDE требуется Android Studio Ladybug или более поздняя версия.
Изменения в API
- Для использования проектов, выпущенных с Kotlin 2.0, требуется KGP 2.0.0 или более поздняя версия. ( Idb6b5 )
- API для оформления текстовых полей больше не являются экспериментальными. ( I7480f )
Исправлены ошибки
-
ExposedDropdownMenuбинарно совместим со старыми версиями. ( I133f7 )
Версия 1.9.0-rc01
30 июля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-rc01 . Версия 1.9.0-rc01 содержит следующие коммиты .
Версия 1.9.0-beta03
16 июля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-beta03 . Версия 1.9.0-beta03 содержит следующие коммиты .
Версия 1.9.0-beta02
2 июля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-beta02 . Версия 1.9.0-beta02 содержит следующие коммиты .
Версия 1.9.0-beta01
18 июня 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-beta01 . Версия 1.9.0-beta01 содержит следующие коммиты .
Исправлены ошибки
- Гиперссылки в
Text(AnnotatedString)теперь по умолчанию имеют стиль Material Design. ( I0e8ed , b/339843816 )
Версия 1.9.0-alpha04
4 июня 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-alpha04 . Версия 1.9.0-alpha04 содержит следующие коммиты .
Версия 1.9.0-alpha03
20 мая 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-alpha03 . Версия 1.9.0-alpha03 содержит следующие коммиты .
Версия 1.9.0-alpha02
7 мая 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-alpha02 . Версия 1.9.0-alpha02 содержит следующие коммиты .
Версия 1.9.0-alpha01
23 апреля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.9.0-alpha01 . Версия 1.9.0-alpha01 содержит следующие коммиты .
Изменения в поведении
- Для корректной проверки синтаксиса, поставляемой с Compose, теперь требуется минимальная версия AGP 8.8.2. Если вы не можете обновить AGP, вы можете обновить Lint самостоятельно, используя
android.experimental.lint.version=8.8.2(или более новую версию) в файлеgradle.properties. Для запуска проверок синтаксиса Compose внутри IDE требуется Android Studio Ladybug или более поздняя версия.
Изменения в API
- Для использования проектов, выпущенных с Kotlin 2.0, требуется KGP 2.0.0 или более поздняя версия. ( Idb6b5 )
- API для оформления текстовых полей больше не являются экспериментальными ( I7480f , b/269651160 )
- Объявить
runWithTimingDisabledв пользуrunWithMeasurementDisabled, который более четко описывает поведение — все метрики приостанавливаются. Кроме того, предоставить доступ к суперклассуMicrobenchmarkScope, поскольку повторное объявление функцииrunWithMeasurementDisabledдля открытого доступа невозможно, так как она является встроенной. ( I9e23b , b/389149423 , b/149979716 )
Исправлены ошибки
-
ExposedDropdownMenuбинарно совместим со старыми версиями. ( I133f7 ) - Исправлена ошибка, приводившая к сбою при отображении индикаторов прогресса и загрузки в случае передачи значения
Float.NaNв качестве параметра прогресса. ( I4fa96 , b/352364576 )
Версия 1.8
Версия 1.8.3
18 июня 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.3 . Версия 1.8.3 содержит следующие коммиты .
Версия 1.8.2
20 мая 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.2 . Версия 1.8.2 содержит следующие коммиты .
Версия 1.8.1
7 мая 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.1 . Версия 1.8.1 содержит следующие коммиты .
Версия 1.8.0
23 апреля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0 . Версия 1.8.0 содержит следующие коммиты .
Версия 1.8.0-rc03
9 апреля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-rc03 . Версия 1.8.0-rc03 содержит следующие коммиты .
Версия 1.8.0-rc02
26 марта 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-rc02 . Версия 1.8.0-rc02 содержит следующие коммиты .
Версия 1.8.0-rc01
12 марта 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-rc01 . Версия 1.8.0-rc01 содержит следующие коммиты .
Версия 1.8.0-beta03
26 февраля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-beta03 . Версия 1.8.0-beta03 содержит следующие коммиты .
Версия 1.8.0-beta02
12 февраля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-beta02 . Версия 1.8.0-beta02 содержит следующие коммиты .
Версия 1.8.0-beta01
29 января 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-beta01 . Версия 1.8.0-beta01 содержит следующие коммиты .
Версия 1.8.0-alpha08
15 января 2025 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha08 . Версия 1.8.0-alpha08 содержит следующие коммиты .
Исправлены ошибки
- Добавляет
displayCutoutв группу отступов, которые компоненты Material учитывают по умолчанию, чтобы избежать перекрытия содержимого с областью выреза на дисплее.- Это изменение в поведении повлияет на работу компонентов, учитывающих отступы, вокруг выреза в экране. Это касается как значения по умолчанию параметра
WindowInsetsдля компонентов Material 3, учитывающих отступы, так и значенийWindowInsetsпредоставляемых компонентом. - Объекты по умолчанию для Материала 2 и Материала 3. Если это изменение приводит к нежелательному поведению, укажите параметр
WindowInsetsвручную для каждого компонента отдельно. ( I43ee9 , b/362508045 )
- Это изменение в поведении повлияет на работу компонентов, учитывающих отступы, вокруг выреза в экране. Это касается как значения по умолчанию параметра
- Активность, используемая в качестве хоста для тестируемого компонента при применении
ComposeContentTestRule.setContent, теперь использует темуTheme.Material.Light.NoActionBar, чтобы избежать наложенияActionBarна тестовый контент при использовании SDK 35. Чтобы отказаться от этого поведения, вы можете удалить зависимость отui-test-manifestи добавить запись активности в файлAndroidManifest.xmlвашего тестового приложения дляComponentActivityс выбранной вами темой. ( I7ae1b , b/383368165 )
Внешний вклад
- Отобразить
sheetGesturesEnabledвModalBottomSheetLayout. ( I3f032 , b/329543529 )
Версия 1.8.0-alpha07
11 декабря 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha07 . Версия 1.8.0-alpha07 содержит следующие коммиты .
Исправлены ошибки
- Исправлена ошибка, из-за которой модификаторы размера текстового поля иногда не учитывались. ( I90d4c , b/356905963 )
Версия 1.8.0-alpha06
13 ноября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha06 . Версия 1.8.0-alpha06 содержит следующие коммиты .
Версия 1.8.0-alpha05
30 октября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha05 . Версия 1.8.0-alpha05 содержит следующие коммиты .
Исправлены ошибки
- Оптимизируйте поведение свойства
contentPaddingв Scaffold, чтобы избежать постоянной перекомпоновки содержимого body при изменении значенияcontentPadding. ( I8c8e2 , b/373904168 ) - Настройте ползунок материала так, чтобы он изменял свое значение при нажатии клавиш управления. ( I1c442 )
Версия 1.8.0-alpha04
16 октября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha04 . Версия 1.8.0-alpha04 содержит следующие коммиты .
Изменения в API
- Удалите
readOnlyизTextFields, чтобы закрепить их в стабильной версии Foundation. ( I3aaba )
Исправлены ошибки
- Добавлена поддержка эффекта пульсации в расширяющихся компонентах на Android S+, например, в карточке, которая расширяется при нажатии. Ранее пульсация не заполняла новый размер, но теперь она будет расширяться до новых границ. ( If509a , b/183019123 )
Версия 1.8.0-alpha02
18 сентября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha02 . Версия 1.8.0-alpha02 содержит следующие коммиты .
Версия 1.8.0-alpha01
4 сентября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.8.0-alpha01 . Версия 1.8.0-alpha01 содержит следующие коммиты .
Изменения в API
- Добавлен новый конструктор
NavGraphBuilder.bottomSheetдля создания bottomSheet с безопасными аргументами (( I28589 , I777db , b/351858980 )) - Добавлены новые перегрузки
TextFieldиOutlinedTextField, принимающие значениеTextFieldState( I3b74c ).
Версия 1.7
Версия 1.7.8
12 февраля 2025 г.
Выпущена версия androidx.compose.material:material-*:1.7.8 . Версия 1.7.8 содержит следующие коммиты .
Версия 1.7.7
29 января 2025 г.
Выпущена версия androidx.compose.material:material-*:1.7.7 . Изменений по сравнению с версией 1.7.6 нет.
Версия 1.7.6
11 декабря 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.6 . Версия 1.7.6 содержит следующие коммиты .
Версия 1.7.5
30 октября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.5 . Версия 1.7.5 содержит следующие коммиты .
Версия 1.7.4
16 октября 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.4 . Версия 1.7.4 содержит следующие коммиты .
Версия 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
- Компоненты Material Design были переведены на использование новых API Ripple и больше не запрашивают данные
RippleTheme. - Компоненты Material, которые ранее принимали
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-beta05
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-beta03
12 июня 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-beta03 . Версия 1.7.0-beta03 содержит следующие коммиты .
Версия 1.7.0-beta02
29 мая 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-beta02 . Версия 1.7.0-beta02 содержит следующие коммиты .
Изменения в API
- Обновлен API для стилизации ссылок: перенесены
TextLinkStylesвTextStyleи удаленыTextDefaultsиз Material Design ( I5477b ).
Версия 1.7.0-beta01
14 мая 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-beta01 . Версия 1.7.0-beta01 содержит следующие коммиты .
Изменения в API
- Обновлен API для получения ссылок с тематическим оформлением Material Design в текстовом формате. В частности, удалены методы из класса
TextDefaultsдля создания тематическихLinkAnnotationsи анализа HTML с тематическими ссылками. Вместо этого добавлен классTextLinkStyles, позволяющий стилизовать ссылки в качестве параметра для составного элемента Text. ( I31b93 )
Версия 1.7.0-alpha08
1 мая 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha08 . Версия 1.7.0-alpha08 содержит следующие коммиты .
Изменения в API
- Исправлена ошибка, из-за которой
backgroundColorне применялся кTextFieldDecorationBoxиOutlinedTextFieldDecorationBox. Теперь поля для декорирования принимают параметрshape. ( I371c2 , b/307694651 ) -
RippleConfiguration#isEnabledбыл удален, аLocalRippleConfigurationтеперь допускает значение null. Чтобы отключить эффект пульсации, вместо того, чтобы указыватьRippleConfigurationсisEnabled = false, укажитеnullдляLocalRippleConfiguration. ( I22725 ) - Помимо обычного стиля при наведении курсора и фокусировке, текстовые ссылки имеют опцию стилизации состояния нажатия. Для поддержки этой опции методы
TextDefaultsимеют аргументpressedStyle. ( Ic473f , b/139312671 )
Исправлены ошибки
- Верхний отступ текстового поля
OutlinedTextFieldдля метки теперь учитывает размер системного шрифта. ( Idc781 )
Версия 1.7.0-alpha07
17 апреля 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha07 . Версия 1.7.0-alpha07 содержит следующие коммиты .
Изменения в API
- Помимо обычного стиля, текстовые ссылки получили опцию стилизации состояния нажатия, а также состояния при наведении курсора и фокусировке. ( I5f864 , b/139312671 )
- Добавлен объект
TextDefaults, содержащий методы для созданияLinkAnnotationи анализа строки с HTML-тегами, которые применяютMaterialThemeк ссылкам. ( I98532 , b/139312671 )
Версия 1.7.0-alpha06
3 апреля 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha06 . Версия 1.7.0-alpha06 содержит следующие коммиты .
Объявление
- Для использования
androidx.compose.materialбольше не требуется использовать одну и ту же версию каждого артефакта в этой группе Maven. Пользователи могут комбинировать версии библиотек Compose Foundation ( IE5FBA ).
Изменения в API
- Перенесены дополнительные значения по умолчанию для
ModalDrawerиBottomDrawerв объектDrawerDefaults. ( Ib5b2e )
Версия 1.7.0-alpha05
20 марта 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha05 . Версия 1.7.0-alpha05 содержит следующие коммиты .
Изменения в API
- Флаг
ScaffoldSubcomposeInMeasureFixбыл удален. ( I67363 )
Версия 1.7.0-alpha04
6 марта 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha04 . Версия 1.7.0-alpha04 содержит следующие коммиты .
Новые функции
- Добавлен новый артефакт
androidx.compose.material:material-navigation, который добавляет поддержку нижних панелей в качестве пунктов назначения при использовании Navigation Compose . Он заменяет библиотеку Accompanist Navigation Material . ( d65d57 , b/180247978 )
Версия 1.7.0-alpha03
21 февраля 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha03 . Версия 1.7.0-alpha03 содержит следующие коммиты.
Изменения в API
-
BottomDrawerпереведен из экспериментальной версии в стабильную.BottomDrawerStateтеперь предоставляет информацию о ходе выполнения в виде функции, что позволяет запрашивать прогресс между конкретными целями.BottomDrawerStateтеперь позволяет настраивать спецификацию анимации, аconfirmStateChangeбольше не является завершающей лямбда-функцией. ( I9c029 , b/261423850 ) -
BackdropScaffoldпереведен из экспериментальной версии в стабильную. Спецификация анимации теперь соответствует спецификацииtweenв соответствии с рекомендациями. ПараметрsnackbarHostобъектаBackdropScaffoldбольше не является последним параметром, чтобы избежать путаницы с завершающими лямбда-выражениями.BackdropScaffoldStateпредоставляет APIprogress(from, to)для запроса прогресса между якорями. ( I73f48 , b/261423218 ) - Стандартные нижние листы переведены из экспериментальной в стабильную версию. Устаревшие конструкторы удалены. Спецификация анимации теперь соответствует рекомендациям по созданию твинов. ( I3c1a8 , b/278692145 , b/261409034 )
- Модальные нижние панели переведены из экспериментальной в стабильную версию. Устаревшие конструкторы удалены. Спецификация анимации теперь соответствует спецификации
tweenв соответствии с рекомендациями. ( Ic53f4 , b/278692145 , b/266780235 , b/261409034 )
Исправлены ошибки
- Исправлена ошибка, из-за которой
BackdropScaffoldмог аварийно завершать работу в определенных сценариях в сочетании сLookaheadScope. ( I51396 ) - Удалена подкомпозиция внутри
BottomSheetScaffoldдля повышения производительности. Исправлена ошибка, из-за которойBottomSheetScaffoldаварийно завершал работу в определенных сценариях в сочетании сLookaheadScope. ( I2f90c ) - Удалена подкомпозиция внутри
ModalBottomSheetLayout, что повышает производительность. ( I7a025 )
Версия 1.7.0-alpha02
7 февраля 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha02 . Версия 1.7.0-alpha02 содержит следующие коммиты.
Версия 1.7.0-alpha01
24 января 2024 г.
Выпущена версия androidx.compose.material:material-*:1.7.0-alpha01 . Версия 1.7.0-alpha01 содержит следующие коммиты.
Изменения в поведении
- Компоненты Material Design были переведены на использование новых API Ripple и больше не запрашивают данные
RippleTheme.
Изменения в API
rememberRippleиRippleThemeустарели в material-ripple, вместо них в библиотеки material и других дизайн-систем добавлены новые API ripple иRippleConfiguration.Компоненты Material, которые ранее принимали
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 , b/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-beta03
13 декабря 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-beta03 . Версия 1.6.0-beta03 содержит следующие коммиты.
Версия 1.6.0-beta02
29 ноября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-beta02 . Версия 1.6.0-beta02 содержит следующие коммиты.
Версия 1.6.0-beta01
15 ноября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-beta01 . Версия 1.6.0-beta01 содержит следующие коммиты.
Версия 1.6.0-alpha08
18 октября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha08 . Версия 1.6.0-alpha08 содержит следующие коммиты.
Изменения в API
- Функция
materialIconустарела, вместо неё используется перегруженная версия, принимающая параметрautoMirror. ( Ia338d )
Исправлены ошибки — Автоматическое увеличение высоты элемента навигации для большого контента. ( 0c4ecc , b/272336962 )
Версия 1.6.0-alpha07
4 октября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha07 . Версия 1.6.0-alpha07 содержит следующие коммиты.
- Обновления зависимостей
Версия 1.6.0-alpha06
20 сентября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha06 . Версия 1.6.0-alpha06 содержит следующие коммиты.
Изменение поведения, нарушающее привычный порядок вещей
- Удалена функциональность, связанная с выдвижными панелями, из
BottomSheetScaffold. Для реализации предыдущей функциональности обернитеBottomSheetScaffoldв Drawercomposable. См. пример вBottomSheetScaffoldWithDrawerSample. ( I1dcc8 )
Изменения в API
- Введен временный флаг для управления тем, должен ли Scaffold измерять свои дочерние элементы во время измерения или во время размещения. По умолчанию измерение будет производиться во время измерения. Если у вас возникнут проблемы с новым поведением, пожалуйста, сообщите об этом, создав соответствующую проблему. ( If6e3b )
Версия 1.6.0-alpha05
6 сентября 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha05 . Версия 1.6.0-alpha05 содержит следующие коммиты.
Новые функции
- Добавлена поддержка автоматического зеркального отображения иконок при отображении в макетах с направлением письма справа налево. Иконки в модулях material-icons-core и material-icons-extended теперь предоставляют дополнительные наборы иконок для поддержки автоматического зеркального отображения, если иконка это позволяет. Новые наборы имеют префикс
Icons.AutoMirrored.Filled...и содержат иконки, которые будут автоматически зеркально отображаться в макетах с направлением письма справа налево. Список иконок, которые могут (и должны) автоматически зеркально отображаться, см. в списке иконок Material Design .
Изменения в API
- Добавлена поддержка автоматического зеркального отображения иконок при отображении в макетах с направлением письма справа налево. Иконки в модулях material-icons-core и material-icons-extended теперь предоставляют дополнительные наборы иконок для поддержки автоматического зеркального отображения, если иконка это позволяет. Новые наборы имеют префикс
Icons.AutoMirrored.Filled...и т. д. и содержат иконки, которые будут автоматически зеркально отображаться в макетах с направлением письма справа налево. Список иконок, которые могут (и должны) автоматически зеркально отображаться, см. в списке иконок Material Design . Ранее предоставленные свойства иконок для этих иконок теперь помечены как устаревшие, и предлагается вариант замены блока для облегчения миграции. Если у вас нет специальной обработки для зеркального отображения иконок в макетах с направлением письма справа налево, мы рекомендуем перейти на новый набор иконок. Например,Icons.Filled.ArrowBackследует переименовать вIcons.AutoMirrored.Filled.ArrowBack. ( I4b511 )
Версия 1.6.0-alpha04
23 августа 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha04 . Версия 1.6.0-alpha04 содержит следующие коммиты.
Исправлены ошибки
- Исправлена ошибка, из-за которой некоторые компоненты, использующие
Subcomposition(например,BottomSheetScaffold) внутри Scaffold, находящегося внутриLookaheadScopeпытались определить свой размер слишком рано. ( If2c5d ) - Исправлен расчет
offsetDropdownMenu, теперь смещения по оси X зависят исключительно от локального направления компоновки, а смещения по оси Y больше не будут инвертироваться, когда меню находится в нижней части экрана. ( Iccc74 , b/294103942 ) - Оптимизированы внутренние механизмы компоновки
BottomSheetScaffoldи исправлена потенциальная проблема, связанная с использованиемBottomSheetScaffoldвнутриLookaheadLayout. ( Ic0afa )
Версия 1.6.0-alpha03
9 августа 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha03 . Версия 1.6.0-alpha03 содержит следующие коммиты.
Изменения в API
- Компоненты Material2 теперь имеют отдельный API для передачи значений
windowInsets, что обеспечивает поддержку функциональности «от края до края» в Android. В отличие от компонентов Material3, компоненты Material2 по умолчанию не поддерживают значения inset, и их следует передавать вручную. Для получения дополнительной информации обратитесь к соответствующим примерам. ( I655e8 )
Версия 1.6.0-alpha02
26 июля 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha02 . Версия 1.6.0-alpha02 содержит следующие коммиты.
Изменения в API
- Мы переносим зависимость от плотности на уровень компонента. Это относится к следующим компонентам:
SwipeToDismissи компонентам на основе листа. Пожалуйста, используйте новую перегрузку, если плотность является параметром. ( I1846e ) - Дополнительные аннотации для указания допустимых входных данных для компонуемых объектов ( I51109 )
- Обновлены файлы API для аннотирования подавления совместимости ( I8e87a , b/287516207 )
- Добавлено новое выравнивание начала для
FabPosition( Ib7aea , b/170592777 ) - В Material 2 класс
TextFieldColorsWithIconsустарел и заменен наTextFieldColors. При переопределенииleadingIconColorилиtrailingIconColorтакже переопределяйте перегрузку с помощьюinteractionSource. ( Id57ed , b/199377790 )
Версия 1.6.0-alpha01
21 июня 2023 г.
Выпущена версия androidx.compose.material:material-*:1.6.0-alpha01 . Версия 1.6.0-alpha01 содержит следующие коммиты.
Изменения в поведении
- В типографике Material 2 параметр
includeFontPaddingтеперь по умолчанию имеетfalse. Также изменены значения высоты строки по умолчанию наTrim.NoneиAlignment.Center, а вTextStyleклассаTypographyдобавлены явныеlineHeight(в sp). Для настройки этих значений обратитесь к документации API , а подробное объяснение изменений см. в статье блога ( Icabc3 , I3f801 , I04c03 ).
Изменения в API
- API-интерфейсы
Swipeableв Material устарели. Пожалуйста, обратитесь к API-интерфейсамAnchoredDraggableв Foundation, которые оптимизированы как для простых, так и для сложных сценариев использования. ( I732e0 )
Исправлены ошибки
-
BottomSheetState,ModalBottomSheetStateиBottomDrawerStateтеперь предоставляют свойство progress, указывающее на прогресс между текущей (установленной) точкой привязки и ближайшей точкой привязки в направлении свайпа. ( 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теперь отображается как значение типа float.animateToиsnapToявляются внутренними. Используйтеexpand()иcollapse()вместо них.directionиoverflowудалены.offsetзаменен наrequireOffset(). I323b4 - Отметьте функцию
snapToв Drawer как неэкспериментальный API. ( Ib9c18 , b/261425368 ) - Добавлен параметр цвета дорожки для круговых индикаторов выполнения, а также параметр толщины обводки для круговых и линейных индикаторов выполнения. ( Ie668c , b/216325962 , b/222964817 )
- Переименованы
ModalBottomSheetState,ModalBottomSheetState.SaverиrememberModalBottomSheetState'sconfirmStateChange' вconfirmValueChange. ( Ib48d1 ) - Добавьте
Modifier.minimumInteractiveComponentSize. Его можно использовать для резервирования размера не менее 48.dp, чтобы исключить неоднозначность сенсорного взаимодействия, если размер элемента будет меньше. ( I33f58 , b/258495559 ) - Внесены изменения в API Swipeable в
ModalBottomSheetLayout. Метод animateTo классаModalBottomSheetStateбольше не принимает параметрanimationSpec, а отображаемое смещение теперь может быть равно null. ИспользуйтеrequireOffsetдля принудительного задания смещения. ( Ia2e79 ) - Добавление аннотации
@JvmDefaultWithCompatibility( I8f206 ) - Внесены изменения в API Swipeable в
ModalDrawer. DrawerStateanimateToкласса 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теперь предоставляют свойство progress, указывающее на прогресс между текущей (установленной) точкой привязки и ближайшей точкой привязки в направлении свайпа. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 ) - Исправлена ошибка, из-за которой действие закрытия
AlertDialogотображалось ниже действия подтверждения, когда действия располагались друг над другом, чтобы поместиться в ширину диалогового окна. Это исправление приводит реализацию в соответствие со спецификацией Material Design. ( I029de , b/235454277 ) -
BottomSheetScaffoldбольше не будет участвовать во вложенной прокрутке, еслиgesturesEnabledустановлено в значение false. ( I634f3 , b/215403277 ) - Исправлена ошибка, из-за которой
BottomSheetScaffoldаварийно завершал работу при передаче пустого содержимого для слотов. ( Ib24a5 , b/235588730 ) - Исправлена ошибка, из-за которой
PullRefreshIndicatorперехватывал клики/события указателя. ( 2494256 , b/271777421 ) - Исправлена ошибка, из-за которой
ModalBottomSheetLayoutаварийно завершал работу в крайнем случае при изменении ориентации экрана. Анимации макета (например,Modifier.animateContentSize) внутри/на содержимом листа теперь работают плавно. ( I2f981 , b/266780234 )
Версия 1.5.0-rc01
26 июля 2023 г.
Выпущена версия androidx.compose.material:material-*:1.5.0-rc01 . Версия 1.5.0-rc01 содержит следующие коммиты.
Версия 1.5.0-beta03
28 июня 2023 г.
Выпущена версия androidx.compose.material:material-*:1.5.0-beta03 . Версия 1.5.0-beta03 содержит следующие коммиты.
Исправлены ошибки
-
BottomSheetState,ModalBottomSheetStateиBottomDrawerStateтеперь предоставляют свойство progress, указывающее на прогресс между текущей (установленной) точкой привязки и ближайшей точкой привязки в направлении свайпа. ( I1b317 , b/271169225 , b/276375124 , b/276776071 , b/270066861 )
Версия 1.5.0-beta02
7 июня 2023 г.
Выпущена версия androidx.compose.material:material-*:1.5.0-beta02 . Версия 1.5.0-beta02 содержит следующие коммиты.
Версия 1.5.0-beta01
24 мая 2023 г.
Выпущена версия androidx.compose.material:material-*:1.5.0-beta01 . Версия 1.5.0-beta01 содержит следующие коммиты.
Изменения в API
- Смещение
DrawerStateиBottomDrawerStateбольше не допускает значения null. Вместо этого они возвращаютFloat.NaN, указывая на отсутствие смещения. ( IE9855 ) - Добавлена возможность передачи объекта
ScrollStateпри созданииDropdownMenuилиExposedDropdownMenuдля управления состоянием вертикальной прокрутки отображаемых пунктов меню. ( Idb009 , b/185304441 ) - Добавить поддержку включения/отключения жестов
ModalBottomSheetLayout, чтобы пользователь мог настроить это для более функционального нижнего листа ( I40af0 ). - Добавлен параметр цвета в
BasicText, позволяющий эффективно анимировать или задавать цвет текста. ( Iffd88 , b/246961787 ) - Переименование свойства Semantics
isContainerвisTraversalGroup( I121f6 )
Исправлены ошибки
- Исправлена ошибка, из-за которой действие закрытия
AlertDialogотображалось под действием подтверждения, когда действия располагались друг над другом, чтобы поместиться в ширину диалогового окна. Это исправление приводит реализацию в соответствие со спецификацией Material Design. ( I029de , b/235454277 )
Версия 1.5.0-alpha04
10 мая 2023 г.
Выпущена версия androidx.compose.material:material-*:1.5.0-alpha04 . Версия 1.5.0-alpha04 содержит следующие коммиты.
Изменения в API
- Мы переносим зависимость от плотности на уровень компонента. Это относится к следующим компонентам:
BottomDrawer,ModalBottomSheetLayout,BottomSheetScaffold,Switch,ModalDrawer. Пожалуйста, используйте новую перегрузку, если плотность является параметром. ( I8fbd8 )
Версия 1.5.0-alpha03
19 апреля 2023 г.
androidx.compose.material:material-*:1.5.0-alpha03 is released. Version 1.5.0-alpha03 contains these commits.
Изменения в API
- Update
BottomDrawerinternals to use the newSwipeableV2APIs. Because of thisBottomDrawerStatewill now only have APIS defined at the class level, it won't inherit methods/properties fromSwipeableState. We're using composition with an internalSwipeableV2State. 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 asisOpen/isClosedcontinue 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.animateContentSizeon sheet content) inBottomSheetScaffoldhas been optimized and now works smoothly. ( Ia913c , b/270518202 , b/254446195 ) -
BottomSheetScaffoldwill not participate in nested scroll anymore whengesturesEnabledis set tofalse. ( I634f3 , b/215403277 )
Версия 1.5.0-alpha02
5 апреля 2023 г.
androidx.compose.material:material-*:1.5.0-alpha02 is released. Version 1.5.0-alpha02 contains these commits.
Исправлены ошибки
- Fixed a bug where
BottomSheetScaffoldwould crash when provided with empty content for slots. ( Ib24a5 , b/235588730 ) - Fixes
PullRefreshIndicatorintercepting clicks / pointer events ( 2494256 , b/271777421 )
Версия 1.5.0-alpha01
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
ModalBottomSheetLayoutwould crash in an edge case on orientation change. Layout animations (egModifier.animateContentSize) in/on the sheet content now work smoothly. ( I2f981 , b/266780234 )
Версия 1.4
Version 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. Version 1.4.0 contains these commits.
Важные изменения по сравнению с версией 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'sanimateTohas been replaced by the open and close methods and the offset is now nullable. UserequireOffsetto require the offset. ( I3de9e ) - Added
minLinesparameter into material and material3 Text,TextFieldandOutlinedTextFieldwhich allows setting the minimum height of the component in terms of number of lines ( I4af1d ) - Added
minLinesparameter to theBasicTextandBasicTextField. It allows to set the minimum height of these composables in terms of number of lines ( I24294 , b/122476634 )
Version 1.4.0-rc01
8 марта 2023 г.
androidx.compose.material:material-*:1.4.0-rc01 is released with no changes. Version 1.4.0-rc01 contains these commits.
Version 1.4.0-beta02
22 февраля 2023 г.
androidx.compose.material:material-*:1.4.0-beta02 is released. Version 1.4.0-beta02 contains these commits.
Изменения в API
- Incorporated changes in the Swipeable APIs in
BottomSheetScaffold.BottomSheetState'sconfirmStateChangeparam has been renamed toconfirmValueChange.progressis now exposed as a float value.animateToandsnapToare internal. Useexpand()andcollapse()instead.directionandoverflowhave been removed.offsethas been replaced withrequireOffset(). ( 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, andkitchenicons. ( I65f5e )
Version 1.4.0-beta01
8 февраля 2023 г.
androidx.compose.material:material-*:1.4.0-beta01 is released. Version 1.4.0-beta01 contains these commits.
Изменения в API
- Fixes an issue where
pullRefreshwas not consuming velocity, causing overscroll to show. Also changed the API signature of theonReleaselambda inModifier.pullRefreshto return a Float for consumed velocity ( I7db65 , b/266874741 ) - Restored property getter
LocalMinimuTouchTargetEnforcementand mark it as deprecated and redirect toLocalMinimumInteractiveComponentEnforcement. ( 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 HalfExpandedstate was calculated incorrectly and the sheet would appear to be floating. ( I8c615 , b/265610459 ) - Fixed a bug in
ModalBottomSheetLayoutwhere 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
IsContainersemantics property on Surfaces. This property will be used in a later change that determines traversal order based on the semantic meaning of elements such as surfaces. ( I63379 ) - Mark the
snapTofunction 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.SaverandrememberModalBottomSheetState'sconfirmStateChangetoconfirmValueChange. ( Ib48d1 ) - Дополнительная возможность возврата нулевого значения для устаревших скрытых функций ( 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'sanimateTodoes not take ananimationSpecparameter anymore and theoffsetexposed is now nullable. UserequireOffsetto require theoffset. ( Ia2e79 )
Исправлены ошибки
- A
ModalBottomSheetLayout's sheet now has a maximum width of 640 dp. ( I71a4f , b/234927577 ) - Fixes an issue where
rememberPullRefreshStatewas not updatingrefreshThresholdandrefreshingOffsetover time. ( Ifed10 , b/263159832 ) - Progress for progress indicators is now properly bounded to its expected range. ( I8a7eb , b/262262727 )
- When
ModalBottomSheetStatehas not received any anchors yet, it will update thecurrentValuewithout an animation whensnapTooranimateToare called instead of throwing an exception. ( I2c91b ) - Fixed the enabled state at the Material 2
FilterChipimplementation. ( Id326a , b/261329817 ) - Fixed a bug where
ModalBottomSheetLayoutwould crash if it wasHalfExpandedwhen rotating from portrait to landscape. Please ensure you are passing in the correctinitialValue, for example by checking the configuration. ( Ie8df7 , b/182882364 ) - Fixed an issue where
ModalBottomSheetLayoutwould crash if the sheet content was empty.ModalBottomSheetLayoutnow allows empty sheet content. If the sheet content is empty, it will only have a Hidden state. ( Ic2288 , b/200980998 , b/216693030 )
Известная проблема
- When updating from
androidx.compose.foundation:1.4.0-alpha03toandroidx.compose.foundation:1.4.0-alpha04, you might experience ajava.lang.NoSuchFieldErrorerror. Here is where the issue was orginially reported. A fix has been submitted, and will be available on the next Compose update. As a work around, update yourandroidx.compose.materialandandroidx.compose.material3libraries to the latest version(1.1.0-alpha04) or downgrade yourandroidx.compose.foundationto 1.4.0-alpha03.
Version 1.4.0-alpha03
7 декабря 2022 г.
androidx.compose.material:material-*:1.4.0-alpha03 is released. Version 1.4.0-alpha03 contains these commits.
Изменения в API
- Добавление аннотации
@JvmDefaultWithCompatibility( I8f206 ) - Incorporated changes in the
SwipeableAPIs inModalDrawer.DrawerState'sanimateTohas been replaced by theopenandclosemethods and the offset is now nullable. UserequireOffsetto require the offset. ( I3de9e ) - Added an Modifier API to query ancestors scroll info. ( I2ba9d , b/203141462 )
- Used in
Clickableto correctly delay press interactions, when gestures could become scroll events. - Fixed
Clickablesnot correctly delaying ripples, when used inside anScrollable ViewGroup. - Updated Drawers and Sheets to correctly delay presses in case gestures can become scroll events.
Исправлены ошибки
- Fixed an issue where
PullRefreshIndicatorcould get stuck afteronRefreshis called, if the refreshing state was not changed to true. ( Ie2416 , b/248274004 )
Обновления зависимостей
- Compose UI and Compose Material now depend on Lifecycle 2.5.1. ( I05ab0 , b/258038814 )
Version 1.4.0-alpha02
9 ноября 2022 г.
androidx.compose.material:material-*:1.4.0-alpha02 is released. Version 1.4.0-alpha02 contains these commits.
Изменения в API
-
awaitFirstDownandwaitForUpOrCancellationnow accept aPointerEventPassfor greater flexibility. ( I7579a , b/212091796 ) - Added
minLinesparameter into material and material3 Text,TextFieldandOutlinedTextFieldwhich allows setting the minimum height of the component in terms of number of lines ( I4af1d ) - Added
minLinesparameter to theBasicText andBasicTextField. It allows to set the minimum height of these composables in terms of number of lines ( I24294 , b/122476634 )
Version 1.4.0-alpha01
24 октября 2022 г.
androidx.compose.material:material-*:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
Изменения в API
- A new method,
awaitEachGesture(), for gesture detectors was added. It operates similar toforEachGesture(), but the loop over gestures operates entirely within theAwaitPointerEventScopeso events can't be lost between iterations. -
forEachGesture()has been deprecated in favor ofawaitEachGesture()because it allows events to be lost between gestures. ( Iffc3f , b/251260206 )
Версия 1.3
Версия 1.3.1
9 ноября 2022 г.
androidx.compose.material:material-*:1.3.1 is released. Version 1.3.1 contains these commits.
Версия 1.3.0
24 октября 2022 г.
androidx.compose.material:material-*:1.3.0 is released. Version 1.3.0 contains these commits.
Важные изменения по сравнению с версией 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. Version 1.3.0-rc01 contains these commits.
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 )
Версия 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-beta01
24 августа 2022 г.
androidx.compose.material:material-*:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
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-alpha03
10 августа 2022 г.
androidx.compose.material:material-*:1.3.0-alpha03 is released. Version 1.3.0-alpha03 contains these commits.
Версия 1.3.0-alpha02
27 июля 2022 г.
androidx.compose.material:material-*:1.3.0-alpha02 is released. Version 1.3.0-alpha02 contains these commits.
Внешний вклад
- Fix
AnimatedVisibilityissue withFloatingActionButtonin Scaffold ( I3a0ae , b/224005027 )
Версия 1.3.0-alpha01
29 июня 2022 г.
androidx.compose.material:material-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
Изменения в API
- Change parameter name from values to value in
RangeSlider( I3b79a )
Исправлены ошибки
- Update badge sample to provide more meaningful content description. ( I10b9d )
Версия 1.2
Версия 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. Version 1.2.0 contains these commits.
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
22 июня 2022 г.
androidx.compose.material:material-*:1.2.0-rc02 is released. Version 1.2.0-rc02 contains these commits.
Версия 1.2.0-rc01
15 июня 2022 г.
androidx.compose.material:material-*:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
Изменения в API
- Interfaces in compose libraries are now built using jdk8 default interface methods ( I5bcf1 )
Исправлены ошибки
- Updates badge with leading icon tab to affix badge to the label instead of the icon. ( I90993 )
Версия 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
BottomSheetScaffoldwas drawing over the top app bar's shadow.BottomSheetScaffoldnow 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 )
Версия 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-beta01
11 мая 2022 г.
androidx.compose.material:material-*:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
Новые функции
- This is the first beta release of 1.2!
Изменения в API
- Renamed
TextFieldDefaults.BorderStrokecomposable that draws a border stroke inOutlinedTextFieldtoTextFieldDefaults.BorderBox. ( I5f295 )
Version 1.2.0-alpha08
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 useconsume()to consume the change completely. You can useisConsumedto determine whether or not someone else has previously consumed the change. -
PointerInputChange::copy()now always makes a shallow copy. It means that copies ofPointerInputChangewill be consumed once one of the copies is consumed. If you want to create an unboundPointerInputChange, use constructor instead. ( Ie6be4 , b/225669674 )
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 )
Версия 1.2.0-alpha05
9 марта 2022 г.
androidx.compose.material:material-*:1.2.0-alpha05 is released. Version 1.2.0-alpha05 contains these commits.
Изменения в API
-
LazyVerticalGridandLazyHorizontalGridare now stable. ( I307c0 ) -
LazyVerticalGrid/LazyHorizontalGridand 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. DeprecatedViewCompat.getWindowInsetsControllerin favor ofWindowCompat.getInsetsControllerto ensure that the correct Window is used (such as if the View is in a dialog). ( I660ae , b/219572936 ) - Text:
includeFontPaddingis now turned off by default. The clipping issues as a result ofincludeFontPadding=falseis handled and no clipping should occur for tall scripts. ( I31c84 , b/171394808 ) - Added a new
LazyVerticalGridAPI to define cross axis sizes ( I17723 )
Версия 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
TextFieldDecorationBoxandOutlinedTextFieldDecorationBox. Using them together withBasicTextFieldwill 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,ComposableTargetMarkerandComposableOpenTargetthat allows compile time reporting of when a composable function is called targeting an applier it was not designed to use.In most cases the annotations can be inferred by the compose compiler plugin so using these annotation directly should be rare . The cases that cannot be inferred include creating and using a custom applier, abstract composable functions (such as interface methods), fields or global variables that are composable lambdas (local variables and parameters are inferred), or when using
ComposeNodeor a related composable functions.For custom appliers the composable functions that calls
ComposeNodeorReusableComposeNodeneed to add aCompoableTargetannotation for the function and any composable lambda parameter types. It is recommended, however, to create an annotation that is annotated withComposableTargetMarkerand then the marked annotation be used instead ofComposableTargetdirectly. A composable annotation marked withComposableTargetMarkeris equivalent to aComposbleTargetwith the fully qualified name of the attribute class as the applier parameter. For an example of usingComposableTargetMarkerseeanroidx.compose.ui.UiComposable. ( I38f11 )
Версия 1.2.0-alpha03
9 февраля 2022 г.
androidx.compose.material:material-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.
Исправлены ошибки
- Addes chip group sample ( I97080 , b/192585545 )
Версия 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
NonRestartableComposableto methods that are overloads of existing methods without complex logic. This reduces compiler generated memoization checks (equals) for all parameters which are repeated in the inner function that is called. ( I90490 ) - Add support for action chip ( I07100 , b/192585545 )
Версия 1.2.0-alpha01
12 января 2022 г.
androidx.compose.material:material-*:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
Обновления зависимостей
- Now depends on Kotlin
1.6.10.
Внешний вклад
-
ModalBottomSheetStatenow has aisSkipHalfExpandedflag. It can be either set through the constructor or updated later on by settingModalBottomSheetState'sisSkipHalfExpandedproperty totrue. UpdatingisSkipHalfExpanded's value causes a recomposition of the sheet. ( I18b86 , b/186669820 )
Версия 1.1
Версия 1.1.1
23 февраля 2022 г.
androidx.compose.material:material-*:1.1.1 is released. Version 1.1.1 contains these commits.
Исправлены ошибки
- Fix
NullPointerExceptionatandroidx.compose.ui.platform.RenderNodeLayer.updateDisplayList( aosp/1947059 , b/206677462 ) - Fix crash caused by clipboard content while reading from clipboard on Android. ( I06020 , b/197769306 )
- Fixed RTL in
LazyVerticalGrid( aosp/1931080 , b/207510535 )
Версия 1.1.0
9 февраля 2022 г.
androidx.compose.material:material-*:1.1.0 is released. Version 1.1.0 contains these commits.
Важные изменения с версии 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.
Исправлены ошибки
- Fix the corner radius that is applied for
Checkboxes ( I38b03 , b/175198975 , b/202309440 )
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
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-beta01
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
ExposedDropdownMenubased onExposedDropdownMenuBoxwithTextFieldandDropdownMenuinside ( If60b2 ) -
dismissOnOutsideClickwas added toPopupProperties, replacingdismissOnClickOutsidewhich 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.-
updateAndroidWindowManagerFlagswas added toPopupProperties, 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
LocalMinimumTouchTargetEnforcementcomposition 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
performGestureandGestureScope, which have been replaced byperformTouchInputandTouchInjectionScope. ( Ia5f3f , b/190493367 ) - Added
touchBoundsInRoottoSemanticsNodethat includes the minimum touch target size so that developers can ensure that touch targets meet accessibility minimums. ( I2e14b , b/197751214 )
Исправлены ошибки
- Allow clip to extend touch target bounds beyond the clip region for minimum touch target purposes. ( I43e10 , b/171509422 )
- Updated
Dividercomposable to respectDp.Hairlinefor the thickness parameter to support drawing single pixel dividers regardless of display density. ( I16ffb , b/196840810 )
Version 1.1.0-alpha03
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-alpha03to depend on Kotlin1.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 )
Version 1.1.0-alpha02
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-alpha01
4 августа 2021 г.
androidx.compose.material:material-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
Изменения в API
- Updated
DrawScope#drawImagemethod that consumes source and destination rects to consume an optional FilterQuality parameter. This is useful for pixel art that is intended to be pixelated when scaled up for pixel based art. Updated BitmapPainter + Image composable to also consume an optional FilterQuality parameter ( Ie4fb0 , b/180311607 ) - 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 )
Версия 1.0
Версия 1.0.5
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 )
Версия 1.0.4
13 октября 2021 г.
androidx.compose.material:material-*:1.0.4 is released. Version 1.0.4 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.31
Версия 1.0.3
29 сентября 2021 г.
androidx.compose.material:material-*:1.0.3 is released. Version 1.0.3 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.30
Версия 1.0.2
1 сентября 2021 г.
androidx.compose.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 .
Версия 1.0.1
4 августа 2021 г.
androidx.compose.material:material-*:1.0.1 is released. Version 1.0.1 contains these commits.
Обновления зависимостей
- Updated to depend on Kotlin
1.5.21.
Версия 1.0.0
28 июля 2021 г.
androidx.compose.material:material-*:1.0.0 is released. Version 1.0.0 contains these commits.
Основные особенности версии 1.0.0
This is the first stable release of Compose. Please see the official Compose Release blog for more details!
Известные проблемы
If you are using Android Studio Bumblebee Canary 4 or AGP
7.1.0-alpha04/7.1.0-alpha05, you may hit the following crash:java.lang.AbstractMethodError: abstract method "void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)"To fix, temporarily increase your minSdkVersion to 24+ in your
build.gradlefile. This issue will be fixed in the next version of Android Studio Bumblebee and AGP7.1. ( b/194289155 )
Version 1.0.0-rc02
14 июля 2021 г.
androidx.compose.material:material-*:1.0.0-rc02 is released. Version 1.0.0-rc02 contains these commits.
Исправлены ошибки
- Dialogs now follow the platform sizing behaviour. Set
usePlatformDefaultWidthto false to override this behaviour. ( Iffaed , b/192682388 )
Версия 1.0.0-rc01
1 июля 2021 г.
androidx.compose.material:material-*:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.
Изменения в API
- Added
BadgeBoxcomponent, see the docs and samples for usage information ( I5e284 ) -
useDefaultMaxWidthinPopupPropertieswas renamed tousePlatformDefaultWidth. ( 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:Booleanparameter inTextFieldColors.labelColor()function also changed: it will now returnfalseeven 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.txtlocated in thesrc/mainor equivalent directory. The file specifies a rule per line, where a rule in this case is a pattern for matching to methods or classes in the library. The syntax for these rules is a superset of the human-readable ART profile format that is used when usingadb shell profman --dump-classes-and-methods .... These rules take one of two forms to target either methods or classes.A method rule will have the following pattern:
<FLAGS><CLASS_DESCRIPTOR>-><METHOD_SIGNATURE>And a class rule will have the following pattern:
<CLASS_DESCRIPTOR>Here
<FLAGS>is one or more of the charactersH,S, andPto indicate whether or not this method should be flagged as "Hot", "Startup", or "Post Startup".The
<CLASS_DESCRIPTOR>is the descriptor for the class that the targeted method belongs to. For example, the classandroidx.compose.runtime.SlotTablewould have a descriptor ofLandroidx/compose/runtime/SlotTable;.The
<METHOD_SIGNATURE>is the signature of the method, and includes the name, parameter types, and return types of the method. For example, the methodfun isPlaced(): BooleanonLayoutNodehas the signatureisPlaced()Z.These patterns can have wildcards (
**,*, and?) in order to have a single rule encompass multiple methods or classes.
What do the rules do?
A method that has the flag
Hindicates that this method is a "hot" method, and should be compiled ahead of time.A method that has the flag
Sindicates that it is a method which is called at startup, and should be compiled ahead of time to avoid the cost of compilation and interpreting the method at startup time.A method that has the flag
Pindicates that it is a method which is called after startup.A class that is present in this file indicates that it is used during startup and should be pre-allocated in the heap to avoid the cost of class loading.
Как это работает?
- Libraries can define these rules which will be packaged in AAR artifacts. When an 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
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.clickablebecause the Card will not clip the ripple indication in those cases.
- 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
- 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.clickablebecause the Surface will not clip the ripple indication in those cases.
- 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
Изменения в API
-
FabPositionwas 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 byModifier.focusTarget()( I6c860 ) - Replaced
FocusStateenum with aFocusStateinterface ( Iccc1a , b/187055290 ) - Removed
LocalRippleNativeRenderingnow 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
RippleDrawableinternally 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,LocalRippleNativeRenderinghas been added - provide a value offalseto 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
errorthat 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
7 апреля 2021 г.
androidx.compose.material:material-*:1.0.0-beta04 is released. Version 1.0.0-beta04 contains these commits.
Изменения в API
- API CHANGE:
DrawerStatestate is no longer extends experimental SwipeableState.- API CHANGE:
BottomDrawerStateis now marked as Experimental, to match already Experimental BottomDrawer component ( I81114 , b/181656094 )
- API CHANGE:
- Rename
hideSoftwareKeyboardandshowSoftwareKeyboardonSoftwareKeyboardControllertohide()andshow()respectively.- Provide the full CompositionLocal interface for LocalSoftwareKeyboardController, allowing it to be set (especially useful in tests) ( I579a6 )
- LiveRegion accessibility API is added. If node is marked as a live region, the accessibility services will automatically notify the user about its changes ( Idcf6f , b/172590946 )
Исправлены ошибки
- 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
-
DefaultMonotonicFrameClockis deprecated. CallingwithFrameNanosorRecomposer.runRecomposeAndApplyChangeswith noMonotonicFrameClockwill now throwIllegalStateException. ( I4eb0d ) - Added a new API
LeadingIconTabto support displaying an icon and inline text in a tab. ( I23267 )
Внешний вклад
- [by Jossi Wolf]
BottomDrawernow wraps the content of the drawer slot.BottomDrawerdoesn't throw anIllegalStateExceptionwhen 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 aroundBottomDrawerStateandModalBottomSheetLayoutStatehave been updated.BottomDrawerState#isOpenreturns true now if it is in either open or expanded state. ( I87241 )
Версия 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
LocalSoftwareKeyboardControllercomposition local API to replace previousSoftwareKeyboardControllerinterface 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:uino longer depends on AppCompat or Fragment. If you are using a ComposeView in your application, and you are using Fragment and/or AppCompat, make sure that you are using AppCompat 1.3+ / Fragment 1.3+ - these versions are needed to correctly set lifecycle and saved state owners required for ComposeView. ( I1d6fa , b/161814404 )
Версия 1.0.0-beta01
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 )
-
InteractionStatehas been replaced with[Mutable]InteractionSource- Interfaces are responsible for emitting / collecting Interaction events.
- Instead of passing
interactionState = remember { InteractionState() }to components such asButtonandModifier.clickable(), useinteractionSource = remember { MutableInteractionSource() }. - Instead of:
Interaction.Pressed in interactionStateyou should instead use the extension functions on InteractionSource, such as InteractionSource.collectIsPressedAsState(). - For complex use cases you can use InteractionSource.interactions to observe the stream of Interactions. See the InteractionSource documentation and samples for more information.
- ( I85965 , b/152525426 , b/171913923 , b/171710801 , b/174852378 )
- Add AccessibilityMananger interface and LocalAccessibilityMananger in CompositionLocals ( I53520 )
- Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent ( I580ed , b/169874631 , b/175142755 )
- 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
@ExperimentalRippleApiand changedRippleAlphato 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.
- Renamed isErrorValue parameter inside TextField and OutlinedTextField into isError. ( I831f9 , b/171305338 , b/168004067 )
- 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 toanimateScrollBy()LazyListState.snapToItemIndex()was renamed toscrollToItem()ScrollState.smoothScrollTo()was renamed toanimateScrollTo()( I35ded )Any composables marked with
@ReadOnlyComposableare 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
@TestOnlytop level clearRoots function has been removed. It is no longer necessary. - keySourceInfoOf and resetSourceInfo functions have been removed. They are no longer necessary.
- Composer.collectKeySourceInformation has been removed. It is no longer necessary.
- isJoinedKey, joinedKeyLeft, and joinedKeyRight methods have been removed. They are no longer necessary.
- Various top level APIs have been moved and reorganized into different files. Due to Kotlin's file class semantics, this will break binary compatibility but not source compatibility, so should not be an issue for most users.
- ( I99b7d , b/177245490 )
Modifier.scrollable has been reworked. Now it uses Scrollable interface instead of ScrollableController class ( I4f5a5 , b/174485541 , b/175294473 )
Modifier.draggable now accepts DraggableState instead of a simple lambda. you can create state via
rememberDraggableState { delta -> }to get the same behaviour as before ( Ica70f , b/175294473 )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
iconparameter in BottomNavigationItem to be afterselectedandonClick. - Renamed
alwaysShowLabelsparameter in BottomNavigationItem toalwaysShowLabel. - Renamed
bodyContentparameters in a few components to justcontent. - Reordered parameters in
ButtonDefaults.buttonColors(). Please note that because the type of the parameters have not changed, this will not cause an error in your code - please ensure you are either using named parameters or update the ordering manually, otherwise your code will not work the same as previously. - Added
secondaryVariantparameter todarkColors(). This color is typically the same assecondaryin dark theme, but adding for consistency and further customization. - Removed ElevationDefaults and animateElevation() from the public API surface since they were not commonly used / useful.
- Renamed
onValueChangeEndinSlidertoonValueChangeFinishedand made it nullable. - Renamed
textparameter inSnackbartocontentfor consistency. - Added
contentPaddingparameter toDropdownMenuItemto allow customizing the default padding and madecontentbe an extension onRowScope. - Renamed
ModalDrawerLayouttoModalDrawer. - Renamed
BottomDrawerLayouttoBottomDrawer. - ( I1cc66 )
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. Theindicationparameter inModifier.indicationwas 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
toggleandtoggleModifierparameter from DropdownMenu, and renameddropdownModifier,dropdownOffsetanddropdownContenttomodifier,offsetandcontentrespectively. DropdownMenu now behaves consistently toPopup, where the parent layout is used for the position of the menu. In most cases you can movetoggleto be a sibling ofDropdownMenuand wrap both in aBox. 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 likeremember { mutableStateOf(0) }we are going to removesavedInstanceState { 0 }composable. You should userememberSaveable { mutableStateOf(0) }instead and it will save and restore automatically if the type used inside the MutableState can be stored in the Bundle. If previously you were passing a custom saver object now you need to use a new overload of rememberSaveable which hasstateSaverparameter. The usage will look like this:val holder = rememberSaveable(stateSaver = HolderSaver) { mutableStateOf(Holder(0)) }( Ib4c26 , b/177338004 ) - Added 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
textandiconparameters, and BottomNavigationItem'slabelparameter 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 passingemptyContent()to represent no text / icon / label, you should usenullinstead. ( 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
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>. AddsAnimatable.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
@ExperimentalMaterialAPIanymore ( 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 extendsComposeTestRuleand definessetContent, which has been removed fromComposeTestRule. Added a factory methodcreateEmptyComposeRule()that returns aComposeTestRuleand does not launch an Activity for you. Use this when you want to launch your Activity during your test, eg usingActivityScenario.launch( I9d782 , b/174472899 )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)anditemsIndexed(items: List)are now extension functions so you have to manually import them when used. New extension overloads for Arrays:items(items: Array)anditemsIndexed(Array)( I803fc , b/175562574 )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
@ExperimentalTestingto@ExperimentalTestApito 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 withanimateAsState(), which returns aState<T>instead ofT. This allows better performance, as the invalidation scope can be narrowed down to where the State value is read. ( Ib179e ) - Add Semantics role API and add Role as a parameter to clickable, selectable and toggleable SemanticsModifier. Changed Modifier.progressSemantics so that Slider can also use it. ( I216cd )
Версия 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
defaultprefixes 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-ripplelibrary 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 )
Версия 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
childrenas the name for their trailing lambda tocontent, 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 withrememberRippleIndication()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.drawOpacitytoModifier.alpha - Renamed
Modifier.drawShadowtoModifier.shadow( I264ca , b/173208140 )
- Renamed
- 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 intoplaceable.placeWithLayer()method of LayoutModifier ( I15e9f , b/173030831 ) - Deprecated Ambients named with
Ambientas their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. ( I33440 ) - 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 )
Версия 1.0.0-alpha07
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 )
Исправлены ошибки
-
captureToBitmapmoved tocaptureToImage. ( 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 )
Версия 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 )
Версия 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
.currenton the ambient property, as with any other ambient. This was change was made for consistency and to avoid having multiple ways to accomplish the same thing. Additionally renames some ambient properties to better describe their purpose as follows:- ContentColorAmbient -> AmbientContentColor
- TextStyleAmbient -> AmbientTextStyle
- IndicationAmbient -> AmbientIndication
- EmphasisAmbient -> AmbientEmphasisLevels
- RippleThemeAmbient -> AmbientRippleTheme ( I37b6d )
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 )
Версия 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
*colorparameters 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 )
Версия 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'sonSelectparameter toonClick( 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
disabledBackgroundColoranddisabledContentColorparameters 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
resistanceFactorAtMinandresistanceFactorAtMaxinModifier.swipeablewere replaced with a single resistance param. A newdefaultResistanceConfigmethod was added inSwipeableConstants. ( 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()andFloatingActionButtonConstants.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
onNodeorwaitForIdleare 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
createAndroidComposeRuleandAndroidInputDispatcherfromandroidx.ui.test.androidtoandroidx.ui.test( Idef08 , b/164060572 )
Версия 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 )
Версия 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.
Известная проблема
= 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
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.showSnackbarsuspend function. Additionally:- 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.snackbarHostStateas 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
TabRowobject has been removed, replacing it with TabConstants. TabRow.TabPosition has moved to be top level (TabPosition), and indicatorContainer has been renamed toindicator. 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 toremember { mutableStateOf(...) }for clarity. This reduces the overall API surface and number of concepts for state management, and matches theby mutableStateOf()pattern for class property delegation. ( Ia5727 ) - Button's padding param was renamed to contentPadding ( Id252e , b/161809394 )
- Add an experimental material component SwipeToDismiss. ( I129e5 )
Исправлены ошибки
- Removed
onChildPositionedandOnChildPositionedModifier. Developers should useonPositionedandOnPositionedModifieron 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 toPlacementScope.place(), and the previousPlacementScope.place()was renamed toPlacementScope.placeRelative(). As a result, thePlacementScope.place()method will not automatically mirror the position in right-to-left contexts anymore. If this is desired, usePlacementScope.placeRelative()instead. ( I873ac , b/162916675 ) - 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
textparameter tolabel,onSelectedtoonSelect,activeColortoselectedContentColor,inactiveColortounselectedContentColorand updates parameter ordering to match guidelines. ( Icb605 , b/161809324 ) -
Modifier.stateDraggablewas 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 )
- Remove unused OffsetBase interface
- Align Offset and IntOffset classes to have a consistent API surface
- Rename IntOffset.Origin to IntOffset.Zero to be consistent with Offset API
- Moved nativeCanvas method off of Canvas interface to support consumers to create their own Canvas instances
- Created stub EmptyCanvas class to refactor DrawScope to be a non-null parameter instead of lateinit and ensure non-nullability of the field
- Renamed ClipOp enums to be Pascal Case
- Renamed FilterQuality enums to be Pascal Case
- Renamed StrokeJoin enums to be Pascal Case
- Renamed PointMode enums to be Pascal Case
- Renamed PaintingStyle enums to be Pascal Case
- Renamed PathFillType enums to be Pascal Case
- Renamed StrokeCap enums to be Pascal Case
- Updated DrawCache implementation to no longer use lateinit params
- Updated DrawScope to no longer use lazy delegation for fillPaint and strokePaint internal parameters
- Updated Image composable to avoid Box usage for less overhead
- Updated Outline class to have @Immutable annotations
- Updated PathNode to have @Immutable annotations for each path instruction
- Updated Vector subcomposition to remove redundant conditional checks for equality as compose already handles them
- Deprecated Rect companion constructor methods in favor of function constructors
- Updated Brush classes and function constructors with @Immutable and @Stable APIs
- Updated VertexMode enum to be PascalCase
- Updated DrawScope selectPaint method to conditionally overwrite stroke parameters on the paint if they have changed
- Updated Size to add destructuring API, rename UnspecifiedSize to Unspecified and removed unused methods
- Move dialog to ui ( I47fa6 )
- Removed
SemanticsNodeInteraction.performPartialGesture. UseSemanticsNodeInteraction.performGestureinstead. ( Id9b62 ) - Renamed
SemanticsNodeInteraction.getBoundsInRoot()toSemanticsNodeInteraction.getUnclippedBoundsInRoot()( Icafdf , b/161336532 ) - The APIs for right-to-left support has been updated. LayoutDirectionAmbient has been added, which can be used to read and change the layout direction. Modifier.rtl and Modifier.ltr have been removed. ( I080b3 )
- Modifier.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-dev15version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies .
Изменения в API
@Modelannotation 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
@Modelback later. - Removes corner-case usage and difficult to answer questions about configuring
@Modelas things we need to handle -
@Modeldata 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”
Примечания по миграции
Almost all existing usages of
@Modelare fairly trivially transformed in one of two ways. The example below has a@Modelclass 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
varproperties intovalproperties of a data class, and then usestateinstead ofremember, and assign the state value to cloned copies of the original using the data classcopy(...)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
Stateinstance 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
mutableStateOfAPI which allows you to create MutableState instances outside of composition. Essentially, replace allvarproperties of the original class withvarproperties withmutableStateOfas 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
enabledparam to Checkbox, Switch and Toggleable ( I41c16 )Ripple is now a Modifier. While Clickable is not yet converted the recommended usage is
Clickable(onClick = { ... }, modifier = ripple())( Ie5200 , b/151331852 , b/150060763 )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
enabledparam. Some of the params on Button were renamed or reordered. ( I54b5a )Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content. _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
textandiconlambdas, ( 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
Bordermodifier toDrawBorder( 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 )
-
runOnIdleComposerenamed torunOnIdle( 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
enabledis 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 )
runOnIdleComposeandrunOnUiThreadare now global functions instead of methods on ComposeTestRule. ( Icbe8f )[Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using
by state { ... }orby mutableStateOf(...). ( I5312c )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
setContentorsetViewContentinstead. Compose.disposeComposition has been deprecated. Use thedisposemethod on theCompositionreturned bysetContentinstead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move ( Idef00 )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_PARAMflag to betrue, which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. ( I7971c )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 )