List of usage examples for android.widget ScrollView offsetDescendantRectToMyCoords
public final void offsetDescendantRectToMyCoords(View descendant, Rect rect)
From source file:au.org.ala.fielddata.mobile.CollectSurveyData.java
public void scrollTo(final Attribute attribute) { pager.post(new Runnable() { public void run() { Binder binder = (Binder) surveyViewModel.getAttributeListener(attribute); View boundView = binder.getView(); ViewParent parent = boundView.getParent(); while (parent != null && !(parent instanceof ScrollView)) { parent = parent.getParent(); }//from w w w . j av a 2 s . com if (parent != null) { final ScrollView view = (ScrollView) parent; final Rect r = new Rect(); view.offsetDescendantRectToMyCoords((View) boundView.getParent(), r); view.post(new Runnable() { public void run() { view.scrollTo(0, r.bottom); } }); } } }); }