Stylianos Gakis
11/26/2021, 10:52 PM@DisallowComposableCalls
that I can apply to my own functions to not allow them to be called from inside composable functions?
Or if not, any ideas on how to improve the developer experience regarding this: I have a function that looks like this:
inline val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density).toInt()
That is used from normal non-composable functions, but is simply annoying as it always comes as a code completion suggestion when I’m inside composable functions, but in there I always want the androidx.compose.ui.unit.dp
import instead.tad
11/27/2021, 9:34 PMX
that provides that extension, but you'd need to use with(X) { int.dp }
everywheretad
11/27/2021, 9:34 PMDensity
in ComposeStylianos Gakis
11/28/2021, 11:11 AM