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

Declarative UI #259

Open
Huckleberry322 opened this issue Jun 6, 2022 · 23 comments
Open

Declarative UI #259

Huckleberry322 opened this issue Jun 6, 2022 · 23 comments

Comments

@Huckleberry322
Copy link

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?

@zplata
Copy link
Contributor

zplata commented Jun 9, 2022

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

@imougy
Copy link

imougy commented Sep 1, 2022

Thank you, please put this a priority. We recently started developing for Android just because of Compose, pre-Compose, life is messy and inoperable.

@riggaroo
Copy link

riggaroo commented Sep 5, 2022

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.

@imougy
Copy link

imougy commented Sep 5, 2022

@riggaroo one more reason to develop for Android (Compose is another)!
Thanks you!

@akardas16
Copy link

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

@Tommyten
Copy link

Tommyten commented Oct 6, 2022

Compose UI support would be awesome to have.
Ideally not only Jetpack Compose, but also Jetbrains Compose could be supported.

@MysteryMS
Copy link

Definitely looking forward on this. Any news?

@rahmanrezaee
Copy link

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
                                )

                            }
                    })

                }

            }
        }

@MysteryMS
Copy link

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

@dimsuz
Copy link

dimsuz commented Feb 28, 2023

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.

@FrancoisBlavoet
Copy link

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.

@umberto-sonnino
Copy link
Contributor

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!

@iZakirSheikh
Copy link

Please add the compose support asap on priority.

@carlfindahl
Copy link

We are considering to use Rive and need good Compose support to make that choice, so hopefully this will be coming soon 😁

@wwalkingg
Copy link

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.

@Veeksi
Copy link

Veeksi commented Oct 3, 2023

Any updates regarding this?

@umberto-sonnino
Copy link
Contributor

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

@MysteryMS
Copy link

I believe Lottie for compose is a better alternative for now. They seem to have enhanced support using compose principles.

@delrioe
Copy link

delrioe commented Dec 15, 2023

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.

Rive + Jetpack Compose

Hope it helps.

@JurajBegovac
Copy link

Hi, any updates regarding this? Also, is there a plan/roadmap to support it for compose multiplatform?

@delrioe
Copy link

delrioe commented Mar 15, 2024

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

@jsparidaans
Copy link

@umberto-sonnino it's been a while, any update on when compose might be supported?

@distivi
Copy link

distivi commented May 14, 2024

@umberto-sonnino, our team is thinking of migrating from Lottie to Rive. Any updates/plans/roadmap on this topic?

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

No branches or pull requests