Instructions use spotlight library

Tram Ho

  • As a user, after installing and opening an application, the next thing to be concerned about is what the components of the application's interface function, how the application will be used, and the instructions. Using the user for the first time opening the app is essential.
  • In this article, we will learn how to use one of the libraries to handle the above purpose, which is Spotlight.

1. Gradle

  • First we have to implement the library in the Gradle file:

2. Create Target Object

  • Next, we will create an object provided by Spotlight that is the Target object, each of which corresponds to the components we want to highlight to guide in the application.
  • This object will set properties as below

  • With setAnchor (view), the view is the component we want to guide
  • setShape () creates a spotlight for the elements we want to guide
  • setEffect () creates an effect associated with the set shape
  • setOverlay (layout), the layout will be the layout we want to overlay to highlight the other elements

3. Create Spotlight Object

  • Once we have the Target objects, we will use those objects to place in the Spotlight object, then we will be able to perform the next process.

4. Start / Finish Spotlight

  • Once we have a Spotlight object, we can start or finish this object

5. Next / Previous / Show Target

  • For Spotlight objects with multiple targets, we can next or previous to pass the Target object, or we can specify which Target is shown.

6. Custom Shape

  • We can also customize a custom shape to set the shape of the Target object

7. Custom Effect

  • In addition, the effects can also be customized by us to set the effect for the Target object

8. Conclusion

Share the news now

Source : Viblo