Join Samer Buna for an in-depth discussion in this video Handling swipe gestures, part of React Native Essential Training.
- [Instructor] We are swiping left and right…but we now need to handle the swipe,…what is going to happen when a swipe is complete.…And if you remember, we can do operations…after an animation is complete…using the callback argument for the start method.…So in here, this is the function,…we're going to handle the swipe.…So I'll go ahead…and write a new function for handling swipe.…We'll call this function handleSwipe…and I'll just call it here.…And eventually, the handleSwipe is going to be different…if we're swiping left and right,…but let's start with a simple handle swipe left.…
We'll define handleSwipe.…This is a function.…In this function, we want to do two things.…First, we want to update the state and change the imageIndex…that makes the view change its content.…And then we want to animate the same view…that is holding the image…that we swiped completely to the left,…we want to animate it from the right.…So let's start with setState.…setState is simple.…We want to change the imageIndex…to be the previous state image index, plus one.…
- Hello React Native on iOS and Android
- Styling React Native components
- Platform APIs
- Building a simple game app and a data-driven app
- Using the Fetch API
- Creating an animation loop
- Testing on Android
- Changing an app logo and a splash screen
- Using TestFlight with internal testers
Skill Level Intermediate
1. Getting Started
2. React Native Fundamentals
Hello React Native on iOS5m 42s
3. Building a Simple Game App
4. Building a Data-driven App
5. Animation and Gesture Control
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.