Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Lightning-Fast Mobile App Development with Galio

You're reading from   Lightning-Fast Mobile App Development with Galio Build stylish cross-platform mobile apps with Galio and React Native

Arrow left icon
Product type Paperback
Published in Nov 2021
Publisher Packt
ISBN-13 9781801073165
Length 272 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alin Gheorghe Alin Gheorghe
Author Profile Icon Alin Gheorghe
Alin Gheorghe
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Chapter 1:Introduction to React Native and Galio 2. Chapter 2: Basics of React Native FREE CHAPTER 3. Chapter 3: The Correct Mindset 4. Chapter 4: Your First Cross-Platform App 5. Chapter 5: Why Galio? 6. Chapter 6: The Basics of Mobile UI Building 7. Chapter 7: Exploring the State of Our App 8. Chapter 8: Creating Your Own Custom Components 9. Chapter 9: Debugging and Reaching out for Help 10. Chapter 10: Building an Onboarding Screen 11. Chapter 11: Let's Build – Stopwatch App 12. Chapter 12: Where To Go from Here? 13. Other Books You May Enjoy

Creating a Timer

Now that we're done with the Stopwatch screen, it's time to open the Timer.js file and work on our Timer screen. We should dive right in, remove everything, and start importing everything we need for this.

First of all, we all know that at the end of a Timer cycle, there's always a sound playing, letting you know that it has stopped. For that, we need a new package called expo-av. This is an Expo package for dealing with audio. It is quite easy to use, so let's begin by installing it into our project by using the following command:

expo install expo-av

Now that we have installed this, we can start importing everything we'll need to build this component. We'll need a timer component that is quite similar to the Stopwatch. We'll also need to use intervals and date objects to calculate everything, so useEffect and useState will be imperative for our screen.

The difference is that we'll need to let the user input exactly...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image