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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a backdrop for the keyboard #464

Merged
merged 7 commits into from
Oct 6, 2023
Merged

Adding a backdrop for the keyboard #464

merged 7 commits into from
Oct 6, 2023

Conversation

WadeWT
Copy link
Contributor

@WadeWT WadeWT commented Oct 5, 2023

Adding an optional backdrop to the keyboard for theming purposes.

Sorry about my first attempt, I'm not very good at this 馃槄

Copy link
Owner

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it out, and it works well. Just fix that one thing and we can merge.

@@ -219,10 +224,26 @@ fun KeyboardScreen(
Box(
contentAlignment = alignment,
modifier = Modifier
.conditional(backdropEnabled) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary just use kotlin conditionals:

val backgroundColor = if (backdropEnable) { } else {MaterialTheme....}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had trouble doing a val or if inside of the modifier but I found a different way to achieve what I wanted using only kotlin stuff. I hope that's ok.

@@ -498,3 +499,11 @@ fun startSelection(ime: IMEService): Selection {
}
return Selection()
}

fun Modifier.conditional(condition: Boolean, modifier: Modifier.() -> Modifier): Modifier {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this one.

Copy link
Owner

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, didn't know about that one. 馃憤

@dessalines dessalines merged commit 4c73e79 into dessalines:main Oct 6, 2023
1 check passed
@WadeWT WadeWT deleted the Backdrop branch October 7, 2023 00:22
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