summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAbodunrinwa Toki <toki@google.com>2015-06-05 02:46:57 +0100
committerAbodunrinwa Toki <toki@google.com>2015-06-05 03:35:15 +0100
commit9e211282d3ee54c9840947951593554c3bd5a77c (patch)
treeb66ce0e50997a498c8fb3ec5194500309b3abe53 /core/java/android
parent6b717c66a70663ea9d8b972289a8d4d74d90bc5a (diff)
downloadframeworks_base-9e211282d3ee54c9840947951593554c3bd5a77c.zip
frameworks_base-9e211282d3ee54c9840947951593554c3bd5a77c.tar.gz
frameworks_base-9e211282d3ee54c9840947951593554c3bd5a77c.tar.bz2
Fix ActionMode.snooze API
Bug: 21572677 Change-Id: If9fdb8ace3773b983418b0148082712644fd1fa5
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/ActionMode.java18
-rw-r--r--core/java/android/view/ViewConfiguration.java10
-rw-r--r--core/java/android/widget/Editor.java4
3 files changed, 16 insertions, 16 deletions
diff --git a/core/java/android/view/ActionMode.java b/core/java/android/view/ActionMode.java
index 4b9b590..80dcecc 100644
--- a/core/java/android/view/ActionMode.java
+++ b/core/java/android/view/ActionMode.java
@@ -45,10 +45,10 @@ public abstract class ActionMode {
public static final int TYPE_FLOATING = 1;
/**
- * Default snooze time.
+ * Default value to hide the action mode for
+ * {@link ViewConfiguration#getDefaultActionModeHideDuration()}.
*/
- public static final int SNOOZE_TIME_DEFAULT =
- ViewConfiguration.getDefaultActionModeSnoozeTime();
+ public static final int DEFAULT_HIDE_DURATION = -1;
private Object mTag;
private boolean mTitleOptionalHint;
@@ -213,17 +213,17 @@ public abstract class ActionMode {
public void invalidateContentRect() {}
/**
- * Hide the action mode view from obstructing the content below for a short period.
+ * Hide the action mode view from obstructing the content below for a short duration.
* This only makes sense for action modes that support dynamic positioning on the screen.
- * If this method is called again before the snooze time expires, the later snooze will
+ * If this method is called again before the hide duration expires, the later hide call will
* cancel the former and then take effect.
- * NOTE that there is an internal limit to how long the mode can be snoozed for. It's typically
+ * NOTE that there is an internal limit to how long the mode can be hidden for. It's typically
* about a few seconds.
*
- * @param snoozeTime The number of milliseconds to snooze for.
- * @see #SNOOZE_TIME_DEFAULT
+ * @param duration The number of milliseconds to hide for.
+ * @see #DEFAULT_HIDE_DURATION
*/
- public void snooze(int snoozeTime) {}
+ public void hide(long duration) {}
/**
* Finish and close this action mode. The action mode's {@link ActionMode.Callback} will
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 8c6fa3f..4d584a3 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -213,9 +213,9 @@ public class ViewConfiguration {
private static final int OVERFLING_DISTANCE = 6;
/**
- * Default time to snooze an action mode for.
+ * Default duration to hide an action mode for.
*/
- private static final int ACTION_MODE_SNOOZE_TIME_DEFAULT = 2000;
+ private static final long ACTION_MODE_HIDE_DURATION_DEFAULT = 2000;
/**
* Configuration values for overriding {@link #hasPermanentMenuKey()} behavior.
@@ -737,10 +737,10 @@ public class ViewConfiguration {
}
/**
- * @return the default duration in milliseconds for {@link ActionMode#snooze(int)}.
+ * @return the default duration in milliseconds for {@link ActionMode#hide(long)}.
*/
- public static int getDefaultActionModeSnoozeTime() {
- return ACTION_MODE_SNOOZE_TIME_DEFAULT;
+ public static long getDefaultActionModeHideDuration() {
+ return ACTION_MODE_HIDE_DURATION_DEFAULT;
}
/**
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 4c98abf..54dadfa 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -239,7 +239,7 @@ public class Editor {
@Override
public void run() {
if (mTextActionMode != null) {
- mTextActionMode.snooze(ActionMode.SNOOZE_TIME_DEFAULT);
+ mTextActionMode.hide(ActionMode.DEFAULT_HIDE_DURATION);
}
}
};
@@ -248,7 +248,7 @@ public class Editor {
@Override
public void run() {
if (mTextActionMode != null) {
- mTextActionMode.snooze(0); // snooze off.
+ mTextActionMode.hide(0); // hide off.
}
}
};