rive-app / rive-app/rive-android
I want to release a rive animation instance in Android.
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 538
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
By repeating one rive, only the value of setNumberState changes and is displayed every second. After calling reset, it is playing again. However, every time you do this, RAM accumulates. When profiling.
I gave several options to the release method or controller, but it is not released. How can I turn it off?
<app.rive.runtime.kotlin.RiveAnimationView
android:id="@+id/game_effect_rive"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:riveAutoPlay="false"
app:riveAlignment="BOTTOM_CENTER"
app:riveFit="CONTAIN"
app:riveLoop="ONESHOT"
app:riveResource="@raw/particle"
android:translationZ="100dp"/>
fun playEffectRive(challengeEffectRive: RiveAnimationView, effect: String?) {
lifecycleOwner.lifecycleScope.launch {
challengeEffectRive.visibility = View.VISIBLE
when (effect) {
ScoreEffect.STEPIN.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 5f)
}
ScoreEffect.PERFECT.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 4f)
}
ScoreEffect.GREAT.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 3f)
}
ScoreEffect.GOOD.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 2f)
}
ScoreEffect.OK.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 1f)
}
ScoreEffect.MISS.effect -> {
challengeEffectRive.setNumberState(PARTICLE, NUMBER, 0f)
}
}
delay(900)
challengeEffectRive.reset()
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RiveAnimationView and the playEffectRive example, then inspect the release method or controller behavior around repeated reset calls. Reproduce the repeated animation while profiling RAM; done means the instance can be stopped or released without continued memory accumulation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100