I am trying to synchronize the positions of two ScrollViews. I am trying to do this to display a list of guidebooks on TV.
I created my own class that extends RelativeLayout to display the manual. This relative layout has four children: an image in the upper left corner, a HorizontalScrollView to display column headings in the upper right corner, a ScrollView for displaying row headings in the lower left corner, and a ScrollView in the lower right corner that contains lists, This ScrollView then contains a HorizontalScrollView. which, in turn, contains a LinearLayout with several child views displaying the data. Hope this explains it clearly, but here is a chart to make it clearer:
____________ |__|___hsv___| | | | | | sv -> | | | hsv -> | |sv| ll -> | | | etc | | | | |__|_________|
I set it up like this because I wanted the guide lists to scroll both horizontally and vertically, but there is no scroll that does this. In addition, I want the row and column headings to appear regardless of the position of the index lists, but I want them to be properly aligned. Therefore, I am trying to find a way to synchronize the positions of two hsv, as well as synchronize the positions of two sv. I am also trying to do this in such a way as to avoid just starting the handler every few milliseconds, to poll one view and call scrollTo on the other.
I am by no means sure that this is the best way to do this, but this is what I came up with. If anyone has any other suggestions, please feel free to!
android scroll views scrollview horizontalscrollview
Billy
source share