I want to use a Showcase library in order to show a message in an item of a row of a RecyclerView
.
In order to do this, I need to pass to the library the coordinates of the item, and I do this in the adapter. The problem is that in the onBindViewHolder
method, the coordinates are still 0.
How could I properly get the coordinates?
The way I'm doing it is the following:
if (position == 2) {
final int x = (int) ((RecyclerViewPlaceViewHolder) holder).mPlaceDescriptionTextView
.getX();
final int y = (int) ((RecyclerViewPlaceViewHolder) holder).mPlaceDescriptionTextView
.getY();
new ShowcaseView.Builder((Activity) mContext)
.setTarget(new Target() {
@Override
public Point getPoint() {
return new Point(x, y);
}
})
.setContentTitle("ShowcaseView")
.setContentText("This is highlighting the Home button")
.hideOnTouchOutside()
.build();
}
Thanks a lot in advance!