Open Huckleberry322 opened 2 years ago
Hey @Huckleberry322 - Jetpack Compose is definitely something we want to explore next with the Rive Android runtime! We can update this issue when we have some kind of support for this
Thank you, please put this a priority. We recently started developing for Android just because of Compose, pre-Compose, life is messy and inoperable.
Hey @zplata 👋🏻 I'm from the Developer Relations Team at Google focusing on Compose, Rive is a really cool technology. We'd love to help you get a Compose friendly version of Rive SDK out, let us know if you need any reviews or have any questions on Compose that we could help answer for you.
@riggaroo one more reason to develop for Android (Compose is another)! Thanks you!
this may help you
Rive already has support SwiftUI for IOS. But what about Android Compose UI? In my current project i wrap it in AndroidView Composable. Any future ideas for Compose UI?
this may help you https://github.com/mjtalbot/rive_piggy
Compose UI support would be awesome to have. Ideally not only Jetpack Compose, but also Jetbrains Compose could be supported.
Definitely looking forward on this. Any news?
use androidview composable function
setContent {
Bettary_appTheme(
darkTheme = false
) {
Column(
Modifier.fillMaxSize(),
Arrangement.Center,
Alignment.CenterHorizontally
) {
Text(text = "Select Address Activity")
AndroidView({
LayoutInflater.from(it)
.inflate(R.layout.charging_animation_layout, null)
.apply {
animationView = findViewById(R.id.charging_animation)
animationView.setRiveResource(
R.raw.charging,
autoplay = true
)
}
})
}
}
}
Well, yeah, that's a workaround, but it would be nicer to have built in support to compose like only calling a RiveAnimation() function for example with detailed configuration
Also the above example is a pretty simplistic one. What about reacting to compose state changes to influence the scene? Or reacting to clicks in the rive scene to influence Compose or vice versa? Of course all this can be done, but it's not idiomatic, requires this interop with the legacy View stuff, etc, etc.
Native integration would be much nicer to have, but it's good that AndroidView
still can be used as a workaround.
Any news here?
Hard to justify investing in Rive if it only supports the old view system. For fully compose apps, that's unfortunately a big step backward. We can always wrap view code, but a native compose implementation would give us idiomatic declarative APIs.
Just a quick update: we added an example of a Compose component that wraps the current View in 4.3.2
This is a starting point and we're still looking to add a proper Jetpack Compose API in the upcoming versions!
Please add the compose support asap on priority.
We are considering to use Rive and need good Compose support to make that choice, so hopefully this will be coming soon 😁
If using Compose's API, should directly support Compose Multiplatform. This can prepare for the future Compose iOS and also take the initiative. Moreover, the Compose API is cross-platform.
Any updates regarding this?
Any updates regarding this?
We have an example Activity showing how to wrap our RiveAnimationView
with Compose.
We plan on having a more comprehensive Compose solution but it has not been scheduled yet
I believe Lottie for compose is a better alternative for now. They seem to have enhanced support using compose principles.
Hey guys, I took the time to find a way to have Rive composables in my project and I made a post in Stack Overflow with the code. That is the best solution I could come up with.
Hope it helps.
Hi, any updates regarding this? Also, is there a plan/roadmap to support it for compose multiplatform?
I made a composable using AndroidView. It works pretty well for listening state Changes etc. I made sure there weren't any memory leaks in case you guys want to have callbacks. But please, please feel free to test it and let me know if that works for you. https://stackoverflow.com/questions/77668942/rive-jetpack-compose-android
@umberto-sonnino it's been a while, any update on when compose might be supported?
@umberto-sonnino, our team is thinking of migrating from Lottie to Rive. Any updates/plans/roadmap on this topic?
Rive already has support SwiftUI for IOS. But what about Android Compose UI? In my current project i wrap it in AndroidView Composable. Any future ideas for Compose UI?