List of utility methods to do View Position Get
int | getPositionForView(final AdapterView> adapterView, final View view) Get the position within the adapter's dataset for the view, where view is an adapter item or a descendant of an adapter item. int position = adapterView.getPositionForView(view); if (adapterView instanceof ListView) { position -= ((ListView) adapterView).getHeaderViewsCount(); return position; |
int | getRelativeTop(View myView) get Relative Top return getTop(myView) - myView.getTop();
|
int | getTop(View myView) get Top if (myView.getParent() == myView.getRootView()) return myView.getTop(); else return myView.getTop() + getTop((View) myView.getParent()); |