Google is committed to advancing racial equity for Black communities. See how.

Compose Material

Build Jetpack Compose UIs with ready to use Material Design Components. This is the higher level entry point of Compose, designed to provide components that match those described at www.material.io.

Latest Update Current Release
July 22, 2020 0.1.0-dev15

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 {
    implementation "androidx.compose.material:material:0.1.0-dev15"
}

android {
    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerVersion "1.4.0-dev-withExperimentalGoogleExtensions-20200720"
        kotlinCompilerExtensionVersion "0.1.0-dev15"
    }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += ["-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check"]
    }
}
Enable Kotlin version 1.4-M3 in your project level build.gradle in both the buildscript {} and allprojects {} blocks:
ext.kotlin_version = "1.4-M3"
repositories {
  //... Your existing repositories ...
  maven {
    url "https://dl.bintray.com/kotlin/kotlin-eap/"
  }
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Please let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 0.1.0-dev

Version 0.1.0-dev15

July 22, 2020

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

Dependencies Update

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

API Changes

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

    Justification

    Rationale includes but is not limited to:

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

    Migration Notes

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

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

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

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

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

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

    Alternative 2: Use mutableStateOf and property delegates

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

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

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

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

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

  • Removes previously deprecated Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. (I663b2, b/155375067)

  • Removed deprecated override of FilledTextField composable (I7f8f8)

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

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

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

  • Added Material Outlined Textfield (I1a518)

  • androidx.ui.foundation.TextFieldValue and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead (I4066d, b/155211005)

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

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

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

  • Deprecates Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. (I101cd, b/155375067)

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

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

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

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

  • Consolidated CanvasScope implementations so there is now just DrawScope and ContentDrawScope Renamed CanvasScope to DrawScope. Updated DrawScope to implement Density interface and provide LayoutDirection Deleted DrawScope subclass in ContentDrawScope Painter and PainterModifier have been updated to no longer maintain an RTL property themselves as DrawScope provides this already without manually providing it (I1798e)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Renamed paramaters in Divider composable (Ic4373)

  • children (Ia6d19)

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

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

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

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

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

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

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

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

  • Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content. _Body:Created extension method on android.graphics.Bitmap, Bitmap.asImageAsset(), to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework (Id5bbd)

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

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

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

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

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

  • rename Border modifier to DrawBorder (I8ffcc)

  • LayoutCoordinates no longer has a position property. The position property does not make sense when considering LayoutModifiers, rotation, or scaling. Instead, developers should use parentCoordinates and childToLocal() to calculate the transform from one LayoutCoordinate to another.

    LayoutCoordinates uses IntPxSize for the size property instead of PxSize. Layouts use integer pixel sizes for layouts, so all layout sizes should use integers and not floating point values. (I9367b)

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

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

  • Replaced DrawBorder in favor of Border Modifier (Id335a)

Bug Fixes

  • FocusModifier is deprecated in favor of Modifier.focus, Modifier.focusRequester, Modifier.focusObserver. FocusState and FocusDetailedState are deprecated in favor of FocusState2 (I46919, b/160822875, b/160922136)
  • VerticalScroller and HoriziontalScroller have been deprecated. Use ScrollableColumn and ScrollableRow for build-in experience with Column/Row behaviour and parameters, or Modifier.verticalScroll and Modifier.horizontalScroll on your own element. Similarly, ScrollerPosition has been deprecated in favor of ScrollState' (I400ce, b/157225838, b/149460415, b/154105299)
  • Modifier.draggable and Modifier.scrollable APIs were reworked. DragDirection was removed in favor of Orientation. State required for scrollable has beed simplified. ScrollableState has been renamed to ScrollableController (Iab63c, b/149460415)
  • runOnIdleCompose renamed to runOnIdle (I83607)
  • Single-value semantics properties now use a calling style. For example, 'semantics { hidden = true }' is now written as: 'semantics { hidden() }'. (Ic1afd, b/145951226, b/145955412)
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. (I7f164)
  • Transition API has been changed to return a TransitionState instead of passing the TransitionState to children. This makes the API more consistent with animate() APIs. (I24e38)
  • An IntBounds unit class has been added, representing integer pixel bounds from layout. The API of PopupPositionProvider has been updated to use it. (I0d8d0, b/159596546)
  • A new optional flag useUnmergedTree was added to test finders. (I2ce48)
  • Removed obsolete size testing APIs. (Iba0a0)
  • Removed Shader inline class that wrapped the NativeShader expect class Renamed NativeShader to Shader. The wrapped Shader inline class did not add anything valuable to the API surface and was an inline class, so use the NativeShader class directly. (I25e4d)
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme (Ia3665, b/156527485)
  • Material DropdownMenu are now scrollable. (Ide699)
  • Removed layout direction parameter from the measure block of the Layout() function. Layout direction is however available inside the callback through the measure scope object (Ic7d9d)
  • Use AnimationSpec instead of AnimationBuilder in the top level APIs to clarify the concept of static animation specification -Improve the transition DSL by removing the lambda requirement for creating AnimationSpecs such as tween, spring. They instead take constructor params directly. -Improve the overall ease of use of AnimationSpec opening up constructors instead of relying on builders -Change the duration and delay for KeyFrames and Tween to Int. This eliminates unnecessary type casts and method overloading (for supporting both Long and Int). (Ica0b4)
  • Switch now appears in a disabled state when enabled is set to false (If4624, b/155941869, b/159331694)
  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. (I995f0)
  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. (I896c5, b/158134875)
  • Refactored Radius class to be an inline class. Removed companion creation methods in favor of function constructor with default parameter to have the radius along the y-axis match that of the mandatory x-axis radius parameter.

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

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

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

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

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

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

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

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

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

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

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

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

  • VerticalScroller now provides Column out of the box. HorizontalScroller now provides Row out of the box. (Ieca5d, b/157020670)

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

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

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

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

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

  • WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp (I91b9a, b/149979702)

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

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

  • Created CanvasScope API that wraps a Canvas object to expose a stateless, declarative drawing API surface. Transformations are contained within their own receiver scope and sizing information is also scoped to corresponding inset bounds. It does not require a consumer to maintain its own Paint state object for configuring drawing operations.

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

  • Add cursor color customisation to the TextField (I6e33f)

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

  • Renamed LayoutModifier2 to LayoutModifier. (Id29f3)

  • Removed deprecated LayoutModifier interface. (I2a9d6)

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

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

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

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

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

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

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

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

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

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

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

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

  • Improve DrawModifier API:

    • Made the receiver scope for draw() ContentDrawScope
    • Removed all parameters on draw()
    • DrawScope has same interface as former CanvasScope
    • ContentDrawScope has drawContent() method (Ibaced, b/152919067)
  • runOnIdleCompose and runOnUiThread are now global functions instead of methods on ComposeTestRule. (Icbe8f)

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

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

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

  • Renamed LayoutResult to MeasureResult. (Id8c68)

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

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

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

  • ParentData composable is deprecated. You should either create a modifier which implements ParentDataModifier interface, or use LayoutTag modifier if you simply need to tag layout children to recognize them inside the measure block. (I51368, b/150953183)

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

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

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

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

  • Removed RepaintBoundary in favor of DrawLayerModifier (I00aa4)

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

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

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

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

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

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

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

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

  • WithConstraints got LayoutDirection parameter (I6d6f7)

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

  • Deprecated: Draw composable is a common source of bugs as it's (I78392, b/149827027)

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

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

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

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

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

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

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

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

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

  • Improvements to the API surface of Constraints (I0fd15)