3

i am using this library from Github to make sequence of TapTargetView

https://github.com/KeepSafe/TapTargetView

i want to use the TapTargetSequence but i don't know the first parameter of this " TapTarget.forBounds " in the Sequence example that provided in down page of the link and don't know the meaning of Rect

and about this library

https://github.com/sjwall/MaterialTapTargetPrompt

i don't know how to sequence of this library

2 Answers2

2

From the source of TapTargetView:

Each tap target describes a target via a pair of bounds and icon. The bounds dictate the location and touch area of the target, where the icon is what will be drawn within the center of the bounds.

You are supposed to provide a Rect object that defines starting point and the area of your target to show the view for. (left, top, right, bottom).

Example of how to create a target rectangle for a view (view is your button):

int[] loc = new int[2];
view.getLocationOnScreen(loc);
Rect rect = new Rect(loc[0], loc[1], loc[0] + view.getWidth(), l[1] + view.getHeight());
kor
  • 141
  • 5
  • Please can you explain more .. If I had a two buttons on random places over the screen (not exactly in the middle or top or...) how can I define the area of these buttons – Abdalrhman Elsayed Nov 14 '16 at 16:05
  • I am just a beginner , so I will be thankful if you gave me an example on any method of them – Abdalrhman Elsayed Nov 14 '16 at 16:08
  • @AbdalrhmanElsayed answer updated. Please don't forget to accept/upvote. – kor Nov 14 '16 at 16:33
  • it doesn't work , please can you edit the code of github to copy it to work directly for me as can't understand this use any link of them , i just want to make Sequence TapTargetView for 2 buttons – Abdalrhman Elsayed Nov 15 '16 at 19:20
-2
Rect rect = new Rect(300, 500, 300, 800);  
TapTarget.forBounds(rect, "Oh look!", "You can point to any part of the screen. You also can't cancel this one!")
.cancelable(
.icon(droid)
.id(6)
General Grievance
  • 4,555
  • 31
  • 31
  • 45