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

Issue #91: Add support for ImageButton #110

Closed
wants to merge 6 commits into from

Conversation

t-regbs
Copy link
Contributor

@t-regbs t-regbs commented Nov 24, 2020

I added this check to the LineWriter:

fun startLine(text: String = "") {
        if (builder.isNotEmpty() && checkLast('(').not()) {
            repeat(indent) { builder.append(INDENT) }
        }
        builder.append(text)
}

Where checkLast is

fun checkLast(char: Char): Boolean {
        return builder.last() == char
}

Because without the check instead of having as desired:

Button(onClick = {}, modifier = Modifier.width(100.dp).height(100.dp)) {
         Image(imageResource(R.drawable.ic_lock_power_off))
}

I get:

Button(onClick = {}, modifier = Modifier.width(100.dp).height(100.dp)) {
         Image(      imageResource(R.drawable.ic_lock_power_off))
}

t-regbs and others added 6 commits November 21, 2020 17:14
# Conflicts:
#	recompose-composer/src/test/kotlin/recompose/composer/ComposerTest.kt
# Conflicts:
#	recompose-composer/src/test/kotlin/recompose/composer/ComposerTest.kt
@pocmo
Copy link
Owner

pocmo commented Jan 26, 2021

Hey @t-regbs. Thank you for your pull request. Overall this looks good. I wonder if we can solve the problem you are describing differently than the change in startLine(). The function startLine() is supposed to start an indented line and now you made it more complex handling other unrelated cases. So, I wonder if we should avoid calling startLine() in the first place if this is not what we want here... but I haven't looked closely at the code yet.

@pocmo pocmo closed this Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants