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

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

Open
Cmarien opened this issue Jan 11, 2024 · 0 comments
Open

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

Cmarien opened this issue Jan 11, 2024 · 0 comments

Comments

@Cmarien
Copy link

Cmarien commented Jan 11, 2024

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

@Cmarien Cmarien changed the title Pointer doesn't stay pressed on slider animation [ANDROID] Pointer doesn't stay pressed on slider animation Jan 11, 2024
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

1 participant