Back to project page Calma.
The source code is released under:
Apache License
If you think the Android project Calma listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.espian.showcaseview.targets; /*from ww w . ja va 2 s .c o m*/ import android.app.Activity; import android.graphics.Point; import android.view.View; public class ViewTarget implements Target { private final View mView; public ViewTarget(View view) { mView = view; } public ViewTarget(int viewId, Activity activity) { mView = activity.findViewById(viewId); } @Override public Point getPoint() { int[] location = new int[2]; mView.getLocationInWindow(location); int x = location[0] + mView.getWidth() / 2; int y = location[1] + mView.getHeight() / 2; return new Point(x, y); } }