rive-app / rive-app/rive-android

RiveAnimationView's setOnClickListener doesn't work

Open
#276 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
538
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Hi, I created a button animation file using Rive, however, when we use the button in Android, the setOnClickListener doesn't work. Can you let me know how to add setOnClickListener to the animation view? Thank you!

Here is the sample code.

val animationView = findViewById<RiveAnimationView>(R.id.android_player_view)
...
animationView.setOnClickListener { 
// Animation button is clicked, but it never gets called!!!!!!!
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RiveAnimationView entry point and reproduce the issue using the Kotlin sample code in the report. Trace how the view handles touch and click events, then verify that setOnClickListener is invoked when the animation view is tapped.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.