summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--api/test-current.txt1
-rw-r--r--core/java/android/view/ViewConfiguration.java18
-rw-r--r--core/res/res/values/config.xml4
-rw-r--r--core/res/res/values/symbols.xml1
6 files changed, 26 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index c44e2a1c7d8c..5b230eea2435 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -43176,6 +43176,7 @@ package android.view {
method public int getScaledOverscrollDistance();
method public int getScaledPagingTouchSlop();
method public int getScaledScrollBarSize();
+ method public int getScaledScrollFactor();
method public int getScaledTouchSlop();
method public int getScaledWindowTouchSlop();
method public static int getScrollBarFadeDuration();
diff --git a/api/system-current.txt b/api/system-current.txt
index f58d47fa7664..2996be73e332 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -46346,6 +46346,7 @@ package android.view {
method public int getScaledOverscrollDistance();
method public int getScaledPagingTouchSlop();
method public int getScaledScrollBarSize();
+ method public int getScaledScrollFactor();
method public int getScaledTouchSlop();
method public int getScaledWindowTouchSlop();
method public static int getScrollBarFadeDuration();
diff --git a/api/test-current.txt b/api/test-current.txt
index 7619faf41a50..52554691972c 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -43257,6 +43257,7 @@ package android.view {
method public int getScaledOverscrollDistance();
method public int getScaledPagingTouchSlop();
method public int getScaledScrollBarSize();
+ method public int getScaledScrollFactor();
method public int getScaledTouchSlop();
method public int getScaledWindowTouchSlop();
method public static int getScrollBarFadeDuration();
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 9a73d0b1bfaa..33b488fbc6b4 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -219,6 +219,12 @@ public class ViewConfiguration {
private static final int OVERFLING_DISTANCE = 6;
/**
+ * Amount to scroll in response to a {@link MotionEvent#ACTION_SCROLL} event, in dips per
+ * axis value.
+ */
+ private static final int SCROLL_FACTOR = 64;
+
+ /**
* Default duration to hide an action mode for.
*/
private static final long ACTION_MODE_HIDE_DURATION_DEFAULT = 2000;
@@ -246,6 +252,7 @@ public class ViewConfiguration {
private final int mOverflingDistance;
private final boolean mFadingMarqueeEnabled;
private final long mGlobalActionsKeyTimeout;
+ private final int mScrollFactor;
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
@@ -274,6 +281,7 @@ public class ViewConfiguration {
mOverflingDistance = OVERFLING_DISTANCE;
mFadingMarqueeEnabled = true;
mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT;
+ mScrollFactor = SCROLL_FACTOR;
}
/**
@@ -357,6 +365,8 @@ public class ViewConfiguration {
com.android.internal.R.dimen.config_viewMaxFlingVelocity);
mGlobalActionsKeyTimeout = res.getInteger(
com.android.internal.R.integer.config_globalActionsKeyTimeout);
+ mScrollFactor = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.config_scrollFactor);
}
/**
@@ -669,6 +679,14 @@ public class ViewConfiguration {
}
/**
+ * @return Amount to scroll in response to a {@link MotionEvent#ACTION_SCROLL} event. Multiply
+ * this by the event's axis value to obtain the number of pixels to be scrolled.
+ */
+ public int getScaledScrollFactor() {
+ return mScrollFactor;
+ }
+
+ /**
* The maximum drawing cache size expressed in bytes.
*
* @return the maximum size of View's drawing cache expressed in bytes
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 6161494353f2..6e2e9f6e528d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1764,6 +1764,10 @@
<!-- Amount of time in ms the user needs to press the relevant key to bring up the global actions dialog -->
<integer name="config_globalActionsKeyTimeout">500</integer>
+ <!-- Distance that should be scrolled in response to a {@link MotionEvent#ACTION_SCROLL event}
+ with an axis value of 1. -->
+ <dimen name="config_scrollFactor">64dp</dimen>
+
<!-- Maximum number of grid columns permitted in the ResolverActivity
used for picking activities to handle an intent. -->
<integer name="config_maxResolverActivityColumns">3</integer>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 3c2b55b033b9..9d806b9cf798 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -418,6 +418,7 @@
<java-symbol type="dimen" name="config_viewConfigurationTouchSlop" />
<java-symbol type="dimen" name="config_viewMinFlingVelocity" />
<java-symbol type="dimen" name="config_viewMaxFlingVelocity" />
+ <java-symbol type="dimen" name="config_scrollFactor" />
<java-symbol type="dimen" name="default_app_widget_padding_bottom" />
<java-symbol type="dimen" name="default_app_widget_padding_left" />
<java-symbol type="dimen" name="default_app_widget_padding_right" />