The second Android 11 Developer Preview is now available, test it out and share your feedback.

Compose

Latest Update Current Release
April 1, 2020 0.1.0-dev08

Declaring dependencies

To add a dependency on Compose, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

dependencies {
    def compose_version = "0.1.0-dev08"

    kotlinPlugin "androidx.compose:compose-compiler:$compose_version"
    implementation "androidx.compose:compose-runtime:$compose_version"
}
composeOptions {
    kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
    kotlinCompilerExtensionVersion "0.1.0-dev08"
}

For more information about dependencies, see Add build dependencies.

Version 0.1.0-dev

Version 0.1.0-dev08

April 1, 2020

androidx.compose:compose-compiler:0.1.0-dev08 and androidx.compose:compose-runtime:0.1.0-dev08 are released. Version 0.1.0-dev08 contains these commits.

Bug Fixes

  • Replaced Modifier plus operator with factory extension functions (I225e4)
  • RowScope and ColumnScope members are now accessible outside Row and Column. (I3a641)

Version 0.1.0-dev07

March 18, 2020

androidx.compose:compose-compiler:0.1.0-dev07 and androidx.compose:compose-runtime:0.1.0-dev07 are released. Version 0.1.0-dev07 contains these commits.

API Changes

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

Bug Fixes

  • Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. (If4738)
  • WithConstraints got LayoutDirection parameter (I6d6f7)

Version 0.1.0-dev06

March 4, 2020

androidx.compose:compose-compiler:0.1.0-dev06 and androidx.compose:compose-runtime:0.1.0-dev06 are released. Version 0.1.0-dev06 contains these commits.

New Features

  • Updated the ComposeFlags.COMPOSER_PARAM flag to be true, which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. (aosp/1226314)

Version 0.1.0-dev05

February 19, 2020

androidx.compose:compose-compiler:0.1.0-dev05 and androidx.compose:compose-runtime:0.1.0-dev05 are released. Version 0.1.0-dev05 contains these commits.

API Changes

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

Bug Fixes

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

Version 0.1.0-dev04

January 29, 2020

androidx.compose:compose-compiler:0.1.0-dev04 and androidx.compose:compose-runtime:0.1.0-dev04 are released. The commits included in this version can be found here.

API Changes

  • Added areEquivalent callback to MutableState (Ic2ef8)
  • Removed Component and refactor top-level composition APIs (I1f22e)
  • Transform composable calls with composer param (I1691e)
  • Remove Composition classes in favor of Composer base class (Ieadbf)
  • Mark State<T> and MutableState<T> as stable types (b/146557624)
  • Add currentComposerIntrinsic and tests to ensure correct param passing (I133f0)
  • Made ModelObserver single-threaded. (Ica33d)
  • Correctly generate groups around inline composable calls (Ibf739)
  • Remove unused EffectsDsl annotation (Ibe81d)
  • Added a @Stable annotation. Marked Modifier as stable. (Iacba7)
  • Introduced MutableState, State, mutableStateOf APIs (I98291)
  • Refactored effects to @Composable (Ie2686)
  • Improved performance of ObserverMap and ModelObserver. (Ieb9b6)
  • Changed read observations to allow observing non-ComponentNodes. (Ia4d93)