diff options
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/AbsListView.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 6e224e5..29d3be3 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -51,6 +51,8 @@ import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputConnectionWrapper; import android.view.inputmethod.InputMethodManager; +import android.provider.Settings; + import java.util.ArrayList; import java.util.List; @@ -1172,7 +1174,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te layoutChildren(); mInLayout = false; - mOverscrollMax = (b - t) / OVERSCROLL_LIMIT_DIVISOR; + mOverscrollMax = (b - t) / getOverscrollWeight(); } /** @@ -1294,6 +1296,22 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } /** + * Returns the overscroll weight for this view + * + * @return This view's overscroll weight. + */ + public int getOverscrollWeight() { + int weight = Settings.System.getInt(mContext.getContentResolver(), + Settings.System.OVERSCROLL_WEIGHT, 0); + + if (weight == 0) { + return OVERSCROLL_LIMIT_DIVISOR; + } else { + return weight; + } + } + + /** * Get a view and have it show the data associated with the specified * position. This is called when we have already discovered that the view is * not available for reuse in the recycle bin. The only choices left are @@ -2407,7 +2425,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te final int childCount = getChildCount(); if (childCount > 0) { return Math.min(mOverscrollMax, - getChildAt(childCount - 1).getBottom() / OVERSCROLL_LIMIT_DIVISOR); + getChildAt(childCount - 1).getBottom() / getOverscrollWeight()); } else { return mOverscrollMax; } |