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.utils; //w w w. j ava2s .c o m import android.graphics.Point; import android.view.View; import com.espian.showcaseview.ShowcaseView; /** * Calculates various items for use with ShowcaseView */ public class Calculator { public static final Point getShowcasePointFromView(View view, ShowcaseView.ConfigOptions options) { Point result = new Point(); if (options.insert == ShowcaseView.INSERT_TO_VIEW) { result.x = view.getLeft() + view.getWidth() / 2; result.y = view.getTop() + view.getHeight() / 2; } else { int[] coordinates = new int[2]; view.getLocationInWindow(coordinates); result.x = coordinates[0] + view.getWidth() / 2; result.y = coordinates[1] + view.getHeight() / 2; } return result; } }