- Let's start by opening the Android project in Android Studio. In the Android Studio welcome screen, select Open an existing Android Studio project and open the android directory of the project.
- Open the project explorer and expand the package structure until you can see the Java source files (for example, app/java/com.nativeuicomponent):
- Right-click on the package and select New | Java Class. Use ButtonViewManager for the class name and set the Kind field to Class.
- Use the same method to also create a ButtonPackage class.
- Let's begin implementing our ButtonViewManager class, which must be a subclass of SimpleViewManager<View> ...
Get React Native Cookbook - Second Edition now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.