-
Notifications
You must be signed in to change notification settings - Fork 183
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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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....}
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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. 馃憤
Adding an optional backdrop to the keyboard for theming purposes.
Sorry about my first attempt, I'm not very good at this 馃槄