Gists for medium article titled Jetpack Compose: Assert Intent Data Consumption in Instrumented Tests
This file contains hidden or 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
| .class public final Lcom/example/myapplication/HelloActivity; | |
| .super Landroidx/activity/ComponentActivity; | |
| .source "HelloActivity.kt" | |
| # annotations | |
| .annotation runtime Lkotlin/Metadata; | |
| d1 = { | |
| "\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0007\u00a2\u0006\u0004\u0008\u0002\u0010\u0003J\u0012\u0010\u0004\u001a\u00020\u00052\u0008\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0014\u00a8\u0006\u0008" | |
| } |
This file contains hidden or 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
| .class public final Lcom/example/myapplication/MainActivity$Companion; | |
| .super Ljava/lang/Object; | |
| .source "MainActivity.kt" | |
| # annotations | |
| .annotation system Ldalvik/annotation/EnclosingClass; | |
| value = Lcom/example/myapplication/MainActivity; | |
| .end annotation |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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( |
NewerOlder