I've searched some time on google and on stackoverflow but i can't find a solution. Is there any posibility to get a listview overscroll on Android 2.2 or 2.1 like the sense ui does?! Like here in my alarm view: AlarmView Sense UI
-
I think Overscroll is implemented in Android OS and is not configurable the user. I know CyanogenMod has this implemented though – Joe Simpson Aug 12 '11 at 15:17
-
1Can you elaborate on what the sense ui does? – Ted Hopp Aug 12 '11 at 15:25
-
@Ted Hopp Of course, the sense UI overscroll is a bit iPhone like. you can pull the view down an it goes down smooth, than you release and the view slides back to top again. Here is an images from my HTC Desire from the alarm view: [AlarmView Sense UI](http://imageshack.us/photo/my-images/41/senseoverscroll.png/) Maybe there is any existing view for this? – Fabian Aug 15 '11 at 10:39
-
Unfortunately the API for overscrolling was not released until 2.3 or higher. However, it clearly is possible if you are willing to copy & modify AOSP source as necessary into your workspace. Both UberMusic and ADW EX offer overscroll for 2.1+. – Tom Aug 20 '11 at 13:06
5 Answers
I'm shocked to see Chirag's answer being highly rated like this. It isn't helpful to anyone because its incomplete and doesn't build. It also doesn't cite its source.
The original code is found here: http://code.google.com/p/scroll-pager/
Also note that the scroll-pager code is released under the GPL license.
UPDATE : I talked to the author of scroll-pager and he has now switched to the MIT license.

- 1,274
- 10
- 18
-
is it possible to make it work for listView (or any other adapterView) instead? – android developer Jul 21 '13 at 21:18
http://developer.android.com/reference/android/widget/ScrollView.html
You should never use a ScrollView with a ListView, because ListView takes care of its own vertical scrolling. Most importantly, doing this defeats all of the important optimizations in ListView for dealing with large lists, since it effectively forces the ListView to display its entire list of items to fill up the infinite container supplied by ScrollView.

- 11
- 2
I can see this post is pretty old, but I've recently released this open-source project on GitHub which solves this problem and could help others solve similar over-scroll issues in the future.
It basically provides an iOS-like over-scrolling effect for many core Android scrollable views - ListView is one of them, and is very easy to apply.
Specifically for list-views, all you have to do to enable it this:
ListView listView = ... // For example: (ListView) findViewById(R.id.list_view);
OverScrollDecoratorHelper.setUpOverScroll(listView);
And to include the project in yours, add this to your build.gradle:
dependencies {
// ...
compile 'me.everything:overscroll-decor-android:1.0.0'
}

- 2,407
- 26
- 27
Listview has built-in support for overscrolling. Check out setOverscrollMode and related methods setOverscrollHeader and setOverscrollFooter. ListView makes use of the overscroll header/footer by overriding AbsListView.onOverscrolled; if you want different behavior, you can implement it by overriding it yourself.

- 232,168
- 48
- 399
- 521
-
Those Methods are implemented since Android API Level 9 (2.3) but not in 2.1 or 2.2 – Fabian Aug 15 '11 at 10:35
Define scrollview in your xml file.
Then in your java file wite this:
scrollView = (ScrollView) findViewById(R.id.scr);
contentView = (ViewGroup) findViewById(R.id.r2);
scrollView.setOnTouchListener(new ScrollPager(scrollView, contentView));
scrollView.post(new Runnable() {
public void run() {
scrollView.scrollTo(0, contentView.getPaddingTop());
}
});
And Add a class in above java file:
public class ScrollPager implements OnTouchListener
public ScrollPager(ScrollView aScrollView, ViewGroup aContentView)
{
mScrollView = aScrollView;
mContentView = aContentView;
scroller = new Scroller(mScrollView.getContext(), new OvershootInterpolator());
task = new Runnable()
{
public void run()
{
scroller.computeScrollOffset();
mScrollView.scrollTo(0, scroller.getCurrY());
if (!scroller.isFinished())
{
mScrollView.post(this);
}
}
};
}

- 2,058
- 2
- 20
- 30
-
6This is incomplete, and doesn't even compile, citing the source is the honest thing to do here... – Rotemmiz Mar 13 '12 at 14:53
-
1I did indeed,it doesn't even compile, it's just chunks of code, the full project can be found in @Jozua 's answer. – Rotemmiz Mar 20 '12 at 11:59
-
@Rotemmiz so keep going with his answer.I didn't suggest you to use my code. – Chirag Shah Mar 20 '12 at 14:00