Situation:
I have two ScrollView inside of each of two HorizontalScrollView of a TableRow.
Goal:
When I touch drag one of ScrollView, another ScrollView must scroll as much. For instance, if I have a list of name on left ScrollView and corresponding phone numbers in right ScrollView, scrolling one ScrollView should not destroy the original bounding between the names and phone numbers.
Can it be implemented by onTouchEvent? If so, how should I implement this(on both or one of the ScrollView)?
Please help me out Android Gurus!
I have a simple solution that works for me:
subclass both
ScrollView
s and override theironScrollChanged
event to updateScrollManager
when scrolling changes:create a
ScrollManager
class that coordinates the scrolling of multiple participantscreate the custom
ScrollView
s and set theScrollManager
for notification on bothThanks to andig for such a great synching scrollview solution.
But there is little bit lag between both scrollviews while flinging.
So i am writing here extended solution to remove that lag between both scrollview.
I have just used OverScroller class and handled fling event manually in SyncedScrollView.
You have to just replace SyncedScrollView with below code. Use other classes from andig's solution