diff options
| author | Joanne Chung <joannechung@google.com> | 2021-03-04 02:30:32 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-03-04 02:30:32 +0000 |
| commit | 41a214c2a79102422b90bc71efe185a27345e475 (patch) | |
| tree | 3fd18ef29c0b7d37496535b801a3d8e338b025b0 /core/java/android/view/ViewConfiguration.java | |
| parent | d77366e4f2e208ad7faa8f0e43d5af7c6231ad96 (diff) | |
| parent | a6d3ac4721bef235f5de7f7cc16842362849583d (diff) | |
Merge "Make SelectionActionModeHelper hardcoded constants configurable." into sc-dev
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
| -rw-r--r-- | core/java/android/view/ViewConfiguration.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index c2f17c310363..ec23a29b2070 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -310,6 +310,18 @@ public class ViewConfiguration { */ private static final float AMBIGUOUS_GESTURE_MULTIPLIER = 2f; + /** + * The timeout value in milliseconds to adjust the selection span and actions for the selected + * text when TextClassifier has been initialized. + */ + private static final int SMART_SELECTION_INITIALIZED_TIMEOUT_IN_MILLISECOND = 200; + + /** + * The timeout value in milliseconds to adjust the selection span and actions for the selected + * text when TextClassifier has not been initialized. + */ + private static final int SMART_SELECTION_INITIALIZING_TIMEOUT_IN_MILLISECOND = 500; + private final boolean mConstructedWithContext; private final int mEdgeSlop; private final int mFadingEdgeLength; @@ -335,6 +347,8 @@ public class ViewConfiguration { private final float mHorizontalScrollFactor; private final boolean mShowMenuShortcutsWhenKeyboardPresent; private final long mScreenshotChordKeyTimeout; + private final int mSmartSelectionInitializedTimeout; + private final int mSmartSelectionInitializingTimeout; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915) private boolean sHasPermanentMenuKey; @@ -378,6 +392,8 @@ public class ViewConfiguration { // Getter throws if mConstructedWithContext is false so doesn't matter what // this value is. mMinScalingSpan = 0; + mSmartSelectionInitializedTimeout = SMART_SELECTION_INITIALIZED_TIMEOUT_IN_MILLISECOND; + mSmartSelectionInitializingTimeout = SMART_SELECTION_INITIALIZING_TIMEOUT_IN_MILLISECOND; } /** @@ -488,6 +504,11 @@ public class ViewConfiguration { mScreenshotChordKeyTimeout = res.getInteger( com.android.internal.R.integer.config_screenshotChordKeyTimeout); + + mSmartSelectionInitializedTimeout = res.getInteger( + com.android.internal.R.integer.config_smartSelectionInitializedTimeoutMillis); + mSmartSelectionInitializingTimeout = res.getInteger( + com.android.internal.R.integer.config_smartSelectionInitializingTimeoutMillis); } /** @@ -1069,6 +1090,24 @@ public class ViewConfiguration { } /** + * @return the timeout value in milliseconds to adjust the selection span and actions for the + * selected text when TextClassifier has been initialized. + * @hide + */ + public int getSmartSelectionInitializedTimeout() { + return mSmartSelectionInitializedTimeout; + } + + /** + * @return the timeout value in milliseconds to adjust the selection span and actions for the + * selected text when TextClassifier has not been initialized. + * @hide + */ + public int getSmartSelectionInitializingTimeout() { + return mSmartSelectionInitializingTimeout; + } + + /** * @return the duration in milliseconds before an end of a long press causes a tooltip to be * hidden * @hide |
