Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
[Compose] Small fix and gone for MotionLayout (#506)
Browse files Browse the repository at this point in the history
* [Compose] Small fix and gone for MotionLayout

We should not have a default LayoutInformationReceiverFlag that is not
None.

Gone is now animated as expected in MotionLayout.

Added Example with test.

* Delete empty file
  • Loading branch information
oscar-ad committed Apr 22, 2022
1 parent 3d2c70c commit 47292e3
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ internal abstract class EditableJSONLayout(@Language("json5") content: String) :
private var forcedHeight: Int = Int.MIN_VALUE
private var forcedDrawDebug: MotionLayoutDebugFlags = MotionLayoutDebugFlags.UNKNOWN
private var updateFlag: MutableState<Long>? = null
private var layoutInformationMode: LayoutInfoFlags = LayoutInfoFlags.BOUNDS
private var layoutInformationMode: LayoutInfoFlags = LayoutInfoFlags.NONE
private var layoutInformation = ""
private var last = System.nanoTime()
private var debugName : String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ internal class MotionMeasurer : Measurer() {
state.reset()
constraintSet.applyTo(state, measurables)
state.apply(root)
root.children.fastForEach { it.isAnimated = true }
applyRootSize(constraints)
root.updateHierarchy()

Expand Down
1 change: 1 addition & 0 deletions projects/ComposeConstraintLayout/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
implementation "androidx.activity:activity-compose:1.3.0"

implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-unit:$compose_version"
implementation "androidx.compose.ui:ui-util:$compose_version"
Expand Down
Loading

0 comments on commit 47292e3

Please sign in to comment.