P
P
Portal_Shooter2021-10-08 11:48:40
React Native
Portal_Shooter, 2021-10-08 11:48:40

How to select several blocks when moving a finger?

Hello. I need to do something like this.
6160021f9454f059675685.jpeg
I think visually the meaning is clear. The user can choose which day and at what time he will do something. If the user wants to set the same time for several days in a row, then he can hold down on one day, and then simply swipe to the side and select the rest of the days. Here is where I have a problem. I don't understand how to implement this functionality. All I could find on the Internet is this git. Here the author does exactly what I need, but I'm new to react and can't figure out how it works. How does it pass styles to neighboring cells? I see where he does it, with the help of what, but the principle of work still does not reach me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Quintis, 2021-10-10
@Quintis

Hello, every day stores styles in the state, when touching the day, the state changes and a new yellow day is rendered, like this:
<View onTouchStart={() => doSomething()} />
doSomething changes styles through the state

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question