This is a library for Android. This is a retractable HorizontalScrollView. You can also sync scrolling in HorizontalScrollViews. It supports Android 1.6 (API Level4) or later.
RetractiveHorizontalScrollView extends android.widget.HorizontalScrollView. In the future, I might add RetractiveVerticalScrollView extends android.widget.ScrollView, if you want it.
Scrolling a retractive scroll view
Create layout like this. And use RetractiveHorizontalScrollView as android.widget.HorizontalScrollView. Complete example is here.
<nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView>
<LinearLayout>
<TextView/> <!-- left side -->
<TextView/> <!-- main content -->
<TextView/> <!-- right side -->
</LinearLayout>
</nu.mine.tmyymmt.android.widget.RetractiveHorizontalScrollView>
Add some RetractiveHorizontalScrollViews which you want to sync to another view by RetractiveHorizontalScrollView#addSyncScrollView(RetractiveHorizontalScrollView syncScrollView). Complete example is here.
RetractiveHorizontalScrollView scrollView1 = (RetractiveHorizontalScrollView) findViewById(R.id.scroll_view);
RetractiveHorizontalScrollView scrollView2 = (RetractiveHorizontalScrollView) findViewById(R.id.scroll_view2);
RetractiveHorizontalScrollView scrollView3 = (RetractiveHorizontalScrollView) findViewById(R.id.scroll_view3);
// add scroll views which you want to sync with scrollView1.
scrollView1.addSyncScrollView(scrollView2);
scrollView1.addSyncScrollView(scrollView3);
// add scroll views which you want to sync with scrollView2.
scrollView2.addSyncScrollView(scrollView1);
scrollView2.addSyncScrollView(scrollView3);
// add scroll views which you want to sync with scrollView3.
scrollView3.addSyncScrollView(scrollView1);
scrollView3.addSyncScrollView(scrollView2);
These are the same as movies.
Retractive-Scroll-Views-for-Android_example is here.
Retractive-Scroll-Views-for-Android_example_sync is here.
Please see detail at javadoc.
Copyright © 2012 Tomoya Yamamoto 山本智世
Distributed under the MIT License.
Tomoya Yamamoto 山本智世 (tmyymmt+github@gmail.com)
You can see good ideas for about this kind of thing in Japanese.