diff options
| author | Jeff Brown <jeffbrown@google.com> | 2011-03-02 21:38:11 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2011-03-02 21:38:11 -0800 |
| commit | a454767b09ecb7d25d00beae0e5a1fdd48605c63 (patch) | |
| tree | 21bd62830a3bacf4776aafa631ba60e45441b116 /core/java/android/view/ViewConfiguration.java | |
| parent | e2e012683d6f35f5eedfd0c39167ea78e32e2650 (diff) | |
Get key repeat timeout and delay from ViewConfiguration.
Replaces previously hardcoded values. This ensures that key repeat
takes the accessibility long press timeout setting into account.
Unfortunately the system must be rebooted for the change to take
effect. We will fix that later.
Change-Id: I3ab70bb037331620b7e532170c1727287b5c6f91
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
| -rw-r--r-- | core/java/android/view/ViewConfiguration.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index d95c5b0cd775..739758c8c79f 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -74,11 +74,16 @@ public class ViewConfiguration { private static final int PRESSED_STATE_DURATION = 125; /** - * Defines the duration in milliseconds before a press turns into + * Defines the default duration in milliseconds before a press turns into * a long press */ - private static final int DEFAULTLONG_PRESS_TIMEOUT = 500; - + private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500; + + /** + * Defines the time between successive key repeats in milliseconds. + */ + private static final int KEY_REPEAT_DELAY = 50; + /** * Defines the duration in milliseconds a user needs to hold down the * appropriate button to bring up the global actions dialog (power off, @@ -330,7 +335,21 @@ public class ViewConfiguration { */ public static int getLongPressTimeout() { return AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT, - DEFAULTLONG_PRESS_TIMEOUT); + DEFAULT_LONG_PRESS_TIMEOUT); + } + + /** + * @return the time before the first key repeat in milliseconds. + */ + public static int getKeyRepeatTimeout() { + return getLongPressTimeout(); + } + + /** + * @return the time between successive key repeats in milliseconds. + */ + public static int getKeyRepeatDelay() { + return KEY_REPEAT_DELAY; } /** |
