recompose icon indicating copy to clipboard operation
recompose copied to clipboard

Formatting: When to use line breaks?

Open pocmo opened this issue 5 years ago • 1 comments

Currently we do not use line breaks for formatting.

So for example we'd create the following Text Composable:

Text(text = "I am a test", color = Color(0xffffcc00.toInt()), fontSize = 20.sp, modifier = Modifier.width(100.dp).background(Color(0xaa0000ff.toInt())))

We probably should define a threshold of number of arguments/modifier, where we start using line breaks, e.g.:

Text(
    text = "I am a test",
    color = Color(0xffffcc00.toInt()),
    fontSize = 20.sp,
    modifier = Modifier
        .width(100.dp)
        .background(Color(0xaa0000ff.toInt()))
)

pocmo avatar Sep 20 '20 07:09 pocmo

Does ktlint have an opinion on that?

pocmo avatar Sep 20 '20 07:09 pocmo