Gists for medium article titled Jetpack Compose: Assert Intent Data Consumption in Instrumented Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
val actionsProperties = motionProperties("actions") | |
Box( | |
modifier = Modifier | |
.background(actionsProperties.value.color("background")) | |
.layoutId("actionsTopBg") | |
) | |
Row( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
ConstraintSets: { | |
start: { | |
... | |
actionsTopBg: { | |
width: 'spread', | |
height: 0, | |
start: ['parent', 'start', 16], | |
end: ['parent', 'end', 16], | |
top: ['date','bottom'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
val actionsProperties = motionProperties("actions") // new code | |
Row( | |
modifier = Modifier | |
.background(actionsProperties.value.color("background")) // new code | |
.layoutId("actions") | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
ConstraintSets: { | |
start: { | |
... | |
actions: { | |
... | |
top: ['date','bottom'], | |
custom: { | |
background: '#444444' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
Box( | |
modifier = Modifier | |
.anchoredDraggable(anchoredDraggableState, Orientation.Vertical) | |
.shadow(elevation = 4.dp, shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp)) | |
.background( | |
Color.White, | |
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp) | |
) | |
.layoutId("contentBg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
val draggedDownAnchorTop = with(LocalDensity.current) { 200.dp.toPx() } | |
val anchors = DraggableAnchors { | |
AnchoredDraggableCardState.DRAGGED_DOWN at draggedDownAnchorTop | |
AnchoredDraggableCardState.DRAGGED_UP at 0f | |
} | |
val density = LocalDensity.current | |
val anchoredDraggableState = remember { | |
AnchoredDraggableState( | |
initialValue = AnchoredDraggableCardState.DRAGGED_DOWN, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
val context = LocalContext.current | |
val motionSceneContent = remember { | |
context.resources | |
.openRawResource(R.raw.motion_scene) | |
.readBytes() | |
.decodeToString() | |
} | |
MotionLayout( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class AnchoredDraggableCardState { | |
DRAGGED_DOWN, DRAGGED_UP | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
end: { | |
headerImage: { | |
width: "spread", | |
height: 250, | |
top: ['parent', 'top', 0], | |
start: ['parent', 'start', 0], | |
end: ['parent', 'end', 0], | |
translationY: -250, | |
alpha: 0.3, |
NewerOlder