https://kotlinlang.org logo
#getting-started
Title
# getting-started
j

Jason Inbody

02/18/2021, 6:29 PM
I'm completely new to Kotlin and I need to rewrite a cross platform app to be native. I've already finished the Swift UI side and loved the declarative UI style. I saw Kotlin had entered beta with Jetpack Compose with their version of declarative UI. I understand it's in beta but how fluid is it it to use? I need to use Google maps and also braintrees drop in payment UI. SwiftUI had was to make representable views from UIKit incase you got in a corner with something that wasn't supported. Does Compose have something like that? I know for a fact there's no braintree support for Kotlin Compose but can you mix a Java view, wrap it in Kotlin and then add it to a compose view? I'm just trying to feel out if there's work arounds incase I would get stuck where there's no support
a

Adam Powell

02/18/2021, 6:32 PM
Yes, there's support for this:
Copy code
// Create a view in the constructor/factory block
AndroidView({ context -> MyView(context) }) { view ->
  // then update it declaratively here
  view.setFoo(foo)
}
Come join us over in #compose too!
2 Views