rn-bounceable icon indicating copy to clipboard operation
rn-bounceable copied to clipboard

Change color on press and hold

Open peterlazar1993 opened this issue 2 years ago • 3 comments

@kanzitelli Good job on the library 👏

I was wondering if I could change the color on long press, how would that be achieved?

peterlazar1993 avatar Sep 06 '22 15:09 peterlazar1993

hey @peterlazar1993! Thank you!

Could you elaborate more on your use case?

But as I understood, you want to change background or highlight the object inside the Bounceable component when it's long pressed. If so, I would recommend to put top-level View inside the Bounceable, and when onPress function is called, change the bg color of that View and use onLongPress callback as you wish. Let me know if it helps!

kanzitelli avatar Sep 06 '22 21:09 kanzitelli

Kapture 2022-09-07 at 03 13 17 I am trying to achieve something like this

I like the approach you mentioned, I shall try it!

peterlazar1993 avatar Sep 06 '22 21:09 peterlazar1993

@peterlazar1993 yeah that looks nice! i think it will be possible to do that with the approach mentioned before. I think for smooth colour changing you will need to use Animated View from reanimated. Let me know how it goes and that would be nice if you share your experience achieving that!

kanzitelli avatar Sep 06 '22 22:09 kanzitelli