Skip to content

[ANDROID] Pointer doesn't stay pressed on slider animation #224

@Cmarien

Description

@Cmarien

Description

Hi, I'm trying to use a slider animation, a button should slide when pressed and the pointer moves but when I press the button, the button state change and onStateChanged is triggered with the pressed state and then instantly after that it is triggered again with the un-pressed state as if I have put my finger up even though I still have my finger on the screen and didn't started to move.

Provide a Repro

import { useRef } from "react"
import { View } from "react-native"

import Rive, { RiveRef } from "rive-react-native"

export const TestRiveScreen = () => {
  const riveRef = useRef<RiveRef>(null)

  return (
    <View style={{ justifyContent: "center" }}>
      <Rive
        ref={riveRef}
        resourceName="test_slider"
        stateMachineName="Slider Machine"
        autoplay={true}
        onRiveEventReceived={(event) => {
          console.log("event", event)
        }}
        onStateChanged={(machine, name) => {
          console.log(machine, name)
        }}
        style={{ width: "100%", height: 400 }}
      />
    </View>
  )
}

Source .riv/.rev file

https://rive.app/community/4409-9028-slider-example/

Expected behavior

The button should slide with the finger and the button un-pressed state should not trigger if my finger is still pressed in

Device & Versions (please complete the following information)

  • Device: [Android Emulator]
  • OS: [Android]
  • NPM Version: [8.19.3]

Additional context

The same code with the same animation works fine on iOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions