Skip to content

Instantly share code, notes, and snippets.

View cp-radhika-s's full-sized avatar
🎯
Focusing

Radhika Saliya cp-radhika-s

🎯
Focusing
View GitHub Profile
Image(
painter = painterResource(id = R.drawable.cake), contentDescription = "",
contentScale = ContentScale.Crop,
modifier = Modifier
.layoutId("headerImage")
)
val context = LocalContext.current
val motionScene = remember {
context.resources
.openRawResource(R.raw.motion_scene)
.readBytes()
.decodeToString()
}
MotionLayout(
motionScene = MotionScene(content = motionScene),
val context = LocalContext.current
val motionScene = remember {
context.resources
.openRawResource(R.raw.motion_scene)
.readBytes()
.decodeToString()
}
MotionLayout(
motionScene = MotionScene(content = motionScene),
{
ConstraintSets: {
start: {
....
},
end: {
....
}
}
}
val motionState = rememberMotionLayoutState()
MotionLayout(
motionScene = /* our motion scene json */,
motionLayoutState = motionState,
modifier = Modifier
.fillMaxSize()
.background(LightGray)
) { ... }
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
RecipeDetail()
}
implementation "androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha03"
override fun onBackPressed() {
engine.navigationChannel.popRoute()
}
override fun onResume() {
super.onResume()
engine.lifecycleChannel.appIsResumed()
}
override fun onPause() {
super.onPause()
engine.lifecycleChannel.appIsPaused()
}
override fun onDestroy() {
super.onDestroy()
detachFlutterView()
}
private fun detachFlutterView() {
engine.activityControlSurface.detachFromActivity()
engine.lifecycleChannel.appIsDetached()
binding.flutterView.detachFromFlutterEngine()
}