Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting: When to use line breaks? #40

Open
pocmo opened this issue Sep 20, 2020 · 1 comment
Open

Formatting: When to use line breaks? #40

pocmo opened this issue Sep 20, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@pocmo
Copy link
Owner

pocmo commented Sep 20, 2020

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 pocmo added the enhancement New feature or request label Sep 20, 2020
@pocmo
Copy link
Owner Author

pocmo commented Sep 20, 2020

Does ktlint have an opinion on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant