Java tutorial
//package com.java2s; //License from project: Apache License import android.view.View; public class Main { public static float getViewX(View view) { return Math.abs((view.getRight() - view.getLeft()) / 2); } }