Search code examples
javaandroiduser-interfaceviewcardview

How to create pointer UI in android studio?


I want to create "first time user guide" like this image,

now I can make it like this image. So, I want the card be able to point to another view like the first image.

Questions :

  1. How could I add the pointer shape?
  2. How could I use that pointer shape to point another view?

Thank you very much.


Solution

    1. The most convenient way is to create the shape as image, and put it to the drawable directory. Then you can set it as background to your pointer.
    2. You should use FrameLayout. In your XML, put the pointer shape view to the last child of the FrameLayout, so it will be "above" the others, in the Z axis. Then in code, set the X and Y coordinates of the pointer shape view to point to another view.

    I hope it helps!