This is a library for Android.
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

日本語

Retractive Scroll Views for Android

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.

Sample movies

Scrolling a retractive scroll view

Sync three scroll views

Download

ver.0.1

How to use

How to retract a 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>

How to sync some RetractiveHorizontalScrollViews

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);

Code Examples

These are the same as movies.

Retractive-Scroll-Views-for-Android_example is here.

Retractive-Scroll-Views-for-Android_example_sync is here.

Javadoc

Please see detail at javadoc.

License

Copyright © 2012 Tomoya Yamamoto 山本智世 profile_image

Distributed under the MIT License.

Contact

Tomoya Yamamoto 山本智世 profile_image (tmyymmt+github@gmail.com)

Reference Information

You can see good ideas for about this kind of thing in Japanese.