android-viewflow
android-viewflow copied to clipboard
Synchronized scroll in ListView
I use ViewFlow in my application. This application is a Tv Guide which provides programs channel by channel. My ViewFlow contains ListView. When the user vertically scroll and go to side list, the list must have the same position :
My principal problems was to know listVliew to set postion => I just add a getter and the syncrhonisation is manage in my actiivity.
But I think other people might be interested in this type of functionality. So I propose this feature to easily manage and automatically synchronizing the position of the ListView
II think creating a ListViewFlow which inherits which from ViewFlow
Are you interested ?
This is actually the first time I see an app making use of ViewFlow, cool!
So, if I get it right. Your ListViewFlow would know that it contains a ListView and be able to synchronize the current vertical position to the other ListViews?
Sounds interesting but I'm thinking of a more general solution. I guess it would be possible to somehow add a custom "synchronizer" to the ViewFlow that would synchronize the views in any way the user want.
First of all, am I understanding your "problem" correctly?
Not exactly, my problem was that I had to know mLoadedViews to set position on them when a ListView is scrolling. So, I add a getLoadedViews() method in ViewFlow. I do not have this scenario, but when a new ListView is created by ViewFlow, it means it's position have also to be set. But I think this solution is bad and can be improved.
Good idea to generalize, I'll think about it. In my case, I use OnScrollListener on all loadedView, and the position is set with 2 position indicator.
Have you idea of another synchronisation use case ? I just thinking about tabs : all views in horizontally scroll have the same tab selected.
I don't really have a use case at all, other than the one you gave me. I just thinking that handling ListViews directly seems to be a bit to specialized. It should be possible to do a bit of abstraction to the problem to handle ListView as well as other types of use cases in the future. But then again, if we can't come up with another use case, maybe we're over-doing it. Let me think of this case a bit.