Se7eN
11/20/2020, 11:17 AM@Stable
? Also, is it fine to make a modifier composable?Andrey Kulikov
11/20/2020, 3:34 PMModifier.yourModifierName()
function shouldn’t be composable according to our guidelines. instead you can use Modifier.yourModifierName() = composed { …your code }
which allows you to have a composable factory. When you use it the real composable would be invoked right on the applied Layout. imagine if you apply the same modifier object for two Layouts, in this case they will not share the same stateSe7eN
11/20/2020, 3:37 PMBox {
Image(customModifier)
Image(customModifier)
}
Modifier.customModifier = composed {
// some state
}
Andrey Kulikov
11/20/2020, 5:57 PM