diff --git a/api/current.txt b/api/current.txt index 6234168a3a998..b43922f6d2767 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45995,6 +45995,7 @@ package android.view { method public static deprecated int getEdgeSlop(); method public static deprecated int getFadingEdgeLength(); method public static deprecated long getGlobalActionKeyTimeout(); + method public float getScaledHorizontalScrollFactor(); method public static int getJumpTapTimeout(); method public static int getKeyRepeatDelay(); method public static int getKeyRepeatTimeout(); @@ -46013,7 +46014,6 @@ 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(); @@ -46022,6 +46022,7 @@ package android.view { method public static float getScrollFriction(); method public static int getTapTimeout(); method public static deprecated int getTouchSlop(); + method public float getScaledVerticalScrollFactor(); method public static deprecated int getWindowTouchSlop(); method public static long getZoomControlsTimeout(); method public boolean hasPermanentMenuKey(); diff --git a/api/removed.txt b/api/removed.txt index 75da976d1b649..fa62e056757c1 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -374,6 +374,10 @@ package android.view { method protected void initializeScrollbars(android.content.res.TypedArray); } + public class ViewConfiguration { + method public int getScaledScrollFactor(); + } + public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable { field public static final int TYPE_KEYGUARD = 2004; // 0x7d4 } diff --git a/api/system-current.txt b/api/system-current.txt index 6a6b279d8f326..3bd9b726dfd75 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -49450,6 +49450,7 @@ package android.view { method public static deprecated int getEdgeSlop(); method public static deprecated int getFadingEdgeLength(); method public static deprecated long getGlobalActionKeyTimeout(); + method public float getScaledHorizontalScrollFactor(); method public static int getJumpTapTimeout(); method public static int getKeyRepeatDelay(); method public static int getKeyRepeatTimeout(); @@ -49468,7 +49469,6 @@ 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(); @@ -49477,6 +49477,7 @@ package android.view { method public static float getScrollFriction(); method public static int getTapTimeout(); method public static deprecated int getTouchSlop(); + method public float getScaledVerticalScrollFactor(); method public static deprecated int getWindowTouchSlop(); method public static long getZoomControlsTimeout(); method public boolean hasPermanentMenuKey(); diff --git a/api/system-removed.txt b/api/system-removed.txt index 3aa93982fc94f..1244103ee62d5 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -368,6 +368,10 @@ package android.view { method protected void initializeScrollbars(android.content.res.TypedArray); } + public class ViewConfiguration { + method public int getScaledScrollFactor(); + } + public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable { field public static final int TYPE_KEYGUARD = 2004; // 0x7d4 } diff --git a/api/test-current.txt b/api/test-current.txt index 1f342e6b94099..70061cd3747c7 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -46372,6 +46372,7 @@ package android.view { method public static deprecated int getEdgeSlop(); method public static deprecated int getFadingEdgeLength(); method public static deprecated long getGlobalActionKeyTimeout(); + method public float getScaledHorizontalScrollFactor(); method public static int getHoverTooltipHideShortTimeout(); method public static int getHoverTooltipHideTimeout(); method public static int getHoverTooltipShowTimeout(); @@ -46394,7 +46395,6 @@ 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(); @@ -46403,6 +46403,7 @@ package android.view { method public static float getScrollFriction(); method public static int getTapTimeout(); method public static deprecated int getTouchSlop(); + method public float getScaledVerticalScrollFactor(); method public static deprecated int getWindowTouchSlop(); method public static long getZoomControlsTimeout(); method public boolean hasPermanentMenuKey(); diff --git a/api/test-removed.txt b/api/test-removed.txt index 75da976d1b649..fa62e056757c1 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -374,6 +374,10 @@ package android.view { method protected void initializeScrollbars(android.content.res.TypedArray); } + public class ViewConfiguration { + method public int getScaledScrollFactor(); + } + public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable { field public static final int TYPE_KEYGUARD = 2004; // 0x7d4 } diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index f16fcc933b707..574137b30f1ee 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -232,10 +232,16 @@ 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. + * Amount to scroll in response to a horizontal {@link MotionEvent#ACTION_SCROLL} event, + * in dips per axis value. */ - private static final int SCROLL_FACTOR = 64; + private static final float HORIZONTAL_SCROLL_FACTOR = 64; + + /** + * Amount to scroll in response to a vertical {@link MotionEvent#ACTION_SCROLL} event, + * in dips per axis value. + */ + private static final float VERTICAL_SCROLL_FACTOR = 64; /** * Default duration to hide an action mode for. @@ -289,7 +295,8 @@ public class ViewConfiguration { private final int mOverflingDistance; private final boolean mFadingMarqueeEnabled; private final long mGlobalActionsKeyTimeout; - private final int mScrollFactor; + private final float mVerticalScrollFactor; + private final float mHorizontalScrollFactor; private boolean sHasPermanentMenuKey; private boolean sHasPermanentMenuKeySet; @@ -319,7 +326,8 @@ public class ViewConfiguration { mOverflingDistance = OVERFLING_DISTANCE; mFadingMarqueeEnabled = true; mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT; - mScrollFactor = SCROLL_FACTOR; + mHorizontalScrollFactor = HORIZONTAL_SCROLL_FACTOR; + mVerticalScrollFactor = VERTICAL_SCROLL_FACTOR; } /** @@ -406,8 +414,11 @@ 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); + + mHorizontalScrollFactor = res.getDimensionPixelSize( + com.android.internal.R.dimen.config_horizontalScrollFactor); + mVerticalScrollFactor = res.getDimensionPixelSize( + com.android.internal.R.dimen.config_verticalScrollFactor); } /** @@ -730,9 +741,27 @@ 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. + * + * @removed */ public int getScaledScrollFactor() { - return mScrollFactor; + return (int) mVerticalScrollFactor; + } + + /** + * @return Amount to scroll in response to a horizontal {@link MotionEvent#ACTION_SCROLL} event. + * Multiply this by the event's axis value to obtain the number of pixels to be scrolled. + */ + public float getScaledHorizontalScrollFactor() { + return mHorizontalScrollFactor; + } + + /** + * @return Amount to scroll in response to a vertical {@link MotionEvent#ACTION_SCROLL} event. + * Multiply this by the event's axis value to obtain the number of pixels to be scrolled. + */ + public float getScaledVerticalScrollFactor() { + return mVerticalScrollFactor; } /** diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 99b91bdf046b7..1c87726b3ca9e 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -618,7 +618,7 @@ public abstract class AbsListView extends AdapterView implements Te private int mTouchSlop; private float mDensityScale; - private float mScrollFactor; + private float mVerticalScrollFactor; private InputConnection mDefInputConnection; private InputConnectionWrapper mPublicInputConnection; @@ -877,7 +877,7 @@ public abstract class AbsListView extends AdapterView implements Te final ViewConfiguration configuration = ViewConfiguration.get(mContext); mTouchSlop = configuration.getScaledTouchSlop(); - mScrollFactor = configuration.getScaledScrollFactor(); + mVerticalScrollFactor = configuration.getScaledVerticalScrollFactor(); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mOverscrollDistance = configuration.getScaledOverscrollDistance(); @@ -4225,7 +4225,7 @@ public abstract class AbsListView extends AdapterView implements Te axisValue = 0; } - final int delta = Math.round(axisValue * mScrollFactor); + final int delta = Math.round(axisValue * mVerticalScrollFactor); if (delta != 0) { if (!trackMotionScroll(delta, delta)) { return true; diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 918b6c0d65ff5..da00d9c970b10 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -129,7 +129,7 @@ public class HorizontalScrollView extends FrameLayout { private int mOverscrollDistance; private int mOverflingDistance; - private float mScrollFactor; + private float mHorizontalScrollFactor; /** * ID of the active pointer. This is used to retain consistency during @@ -224,7 +224,7 @@ public class HorizontalScrollView extends FrameLayout { mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mOverscrollDistance = configuration.getScaledOverscrollDistance(); mOverflingDistance = configuration.getScaledOverflingDistance(); - mScrollFactor = configuration.getScaledScrollFactor(); + mHorizontalScrollFactor = configuration.getScaledHorizontalScrollFactor(); } @Override @@ -743,7 +743,7 @@ public class HorizontalScrollView extends FrameLayout { axisValue = 0; } - final int delta = Math.round(axisValue * mScrollFactor); + final int delta = Math.round(axisValue * mHorizontalScrollFactor); if (delta != 0) { final int range = getScrollRange(); int oldScrollX = mScrollX; diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index d8f337926073e..0a9e361a20c47 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -135,7 +135,7 @@ public class ScrollView extends FrameLayout { private int mOverscrollDistance; private int mOverflingDistance; - private int mScrollFactor; + private float mVerticalScrollFactor; /** * ID of the active pointer. This is used to retain consistency during @@ -250,7 +250,7 @@ public class ScrollView extends FrameLayout { mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mOverscrollDistance = configuration.getScaledOverscrollDistance(); mOverflingDistance = configuration.getScaledOverflingDistance(); - mScrollFactor = configuration.getScaledScrollFactor(); + mVerticalScrollFactor = configuration.getScaledVerticalScrollFactor(); } @Override @@ -796,7 +796,7 @@ public class ScrollView extends FrameLayout { axisValue = 0; } - final int delta = Math.round(axisValue * mScrollFactor); + final int delta = Math.round(axisValue * mVerticalScrollFactor); if (delta != 0) { final int range = getScrollRange(); int oldScrollY = mScrollY; @@ -1875,7 +1875,7 @@ public class ScrollView extends FrameLayout { @Override public String toString() { - return "HorizontalScrollView.SavedState{" + return "ScrollView.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " scrollPosition=" + scrollPosition + "}"; } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index db234e753bbcd..194c119f076c7 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1880,8 +1880,16 @@ Takes effect only if the scrollbar drawables have no intrinsic size. --> 4dp - + + 64dp + + + 64dp + + 64dp