I am having two listviews in parallel on single screen. Both are having their own scroll listener.
What I want to do is scroll the first listview
, then the second listview
should also scroll and vice versa.
Is this possible ?
I am having two listviews in parallel on single screen. Both are having their own scroll listener.
What I want to do is scroll the first listview
, then the second listview
should also scroll and vice versa.
Is this possible ?
Suppose your ListViews are mListView1
and mListView2
, then do something like this -
mListView1.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {}
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
// Smooth scroll mListView2 according to mListView1.
mListView2.smoothScrollToPosition(firstVisibleItem);
}
@Override
private void isScrollCompleted() {}
});