summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget
diff options
context:
space:
mode:
authorRobert Burns <burnsra@gmail.com>2010-11-20 00:35:49 -0500
committerSteve Kondik <shade@chemlab.org>2010-11-20 03:22:35 -0500
commit3a79f7c1dfdc113c053bf2e0bb96d08e9329f303 (patch)
tree5a24e3bde0fe55c3184e2220cdc05055f909486a /core/java/android/widget
parentdc55b05d3f98dcbf55fafc2e105747a1ea4464f4 (diff)
downloadframeworks_base-3a79f7c1dfdc113c053bf2e0bb96d08e9329f303.zip
frameworks_base-3a79f7c1dfdc113c053bf2e0bb96d08e9329f303.tar.gz
frameworks_base-3a79f7c1dfdc113c053bf2e0bb96d08e9329f303.tar.bz2
Added the overscrolling bounce/weight as a preference
Change-Id: I544bc4216304d059b84e96fcafbbf849d6737324
Diffstat (limited to 'core/java/android/widget')
-rw-r--r--core/java/android/widget/AbsListView.java22
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;
}