aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/accessibility
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-04-02 23:13:09 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-04-03 16:51:02 +0900
commitc6435f92a80c6664870f9d1a4bb2a1c5153ef2c3 (patch)
tree2774b2851b42082fb75e810de9053681d33308c6 /java/src/com/android/inputmethod/accessibility
parent244c825c4b72a5446fce96b9c3a609c9f07bb6be (diff)
downloadlatinime-c6435f92a80c6664870f9d1a4bb2a1c5153ef2c3.tar.gz
latinime-c6435f92a80c6664870f9d1a4bb2a1c5153ef2c3.tar.xz
latinime-c6435f92a80c6664870f9d1a4bb2a1c5153ef2c3.zip
Remove AccessibilityManagerCompatUtils and MorionEventCompatUtils
Bug: 6129704 Change-Id: Icb7e80588536066c4fe5b4a1afc100a724b43e7b
Diffstat (limited to 'java/src/com/android/inputmethod/accessibility')
-rw-r--r--java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java11
-rw-r--r--java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java18
-rw-r--r--java/src/com/android/inputmethod/accessibility/FlickGestureDetector.java20
3 files changed, 20 insertions, 29 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
index 41da2aa4c..af10e75bf 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java
@@ -21,17 +21,14 @@ import android.inputmethodservice.InputMethodService;
import android.media.AudioManager;
import android.os.SystemClock;
import android.provider.Settings;
-import android.support.v4.view.MotionEventCompat;
import android.util.Log;
import android.view.MotionEvent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.EditorInfo;
-import com.android.inputmethod.compat.AccessibilityManagerCompatUtils;
import com.android.inputmethod.compat.AudioManagerCompatWrapper;
import com.android.inputmethod.compat.InputTypeCompatUtils;
-import com.android.inputmethod.compat.MotionEventCompatUtils;
import com.android.inputmethod.compat.SettingsSecureCompatUtils;
import com.android.inputmethod.latin.R;
@@ -93,7 +90,7 @@ public class AccessibilityUtils {
public boolean isTouchExplorationEnabled() {
return ENABLE_ACCESSIBILITY
&& mAccessibilityManager.isEnabled()
- && AccessibilityManagerCompatUtils.isTouchExplorationEnabled(mAccessibilityManager);
+ && mAccessibilityManager.isTouchExplorationEnabled();
}
/**
@@ -107,9 +104,9 @@ public class AccessibilityUtils {
public boolean isTouchExplorationEvent(MotionEvent event) {
final int action = event.getAction();
- return action == MotionEventCompatUtils.ACTION_HOVER_ENTER
- || action == MotionEventCompatUtils.ACTION_HOVER_EXIT
- || action == MotionEventCompat.ACTION_HOVER_MOVE;
+ return action == MotionEvent.ACTION_HOVER_ENTER
+ || action == MotionEvent.ACTION_HOVER_EXIT
+ || action == MotionEvent.ACTION_HOVER_MOVE;
}
/**
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
index 2401d93c6..083cb2203 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
@@ -21,14 +21,12 @@ import android.graphics.Color;
import android.graphics.Paint;
import android.inputmethodservice.InputMethodService;
import android.support.v4.view.AccessibilityDelegateCompat;
-import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.accessibility.AccessibilityEventCompat;
import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
-import com.android.inputmethod.compat.MotionEventCompatUtils;
import com.android.inputmethod.compat.ViewParentCompatUtils;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
@@ -136,10 +134,10 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
mLastHoverKey = key;
switch (event.getAction()) {
- case MotionEventCompatUtils.ACTION_HOVER_ENTER:
- case MotionEventCompatUtils.ACTION_HOVER_EXIT:
+ case MotionEvent.ACTION_HOVER_ENTER:
+ case MotionEvent.ACTION_HOVER_EXIT:
return onHoverKey(key, event);
- case MotionEventCompat.ACTION_HOVER_MOVE:
+ case MotionEvent.ACTION_HOVER_MOVE:
if (key != previousKey) {
return onTransitionKey(key, previousKey, event);
} else {
@@ -163,13 +161,13 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
private boolean onTransitionKey(Key currentKey, Key previousKey, MotionEvent event) {
final int savedAction = event.getAction();
- event.setAction(MotionEventCompatUtils.ACTION_HOVER_EXIT);
+ event.setAction(MotionEvent.ACTION_HOVER_EXIT);
onHoverKey(previousKey, event);
- event.setAction(MotionEventCompatUtils.ACTION_HOVER_ENTER);
+ event.setAction(MotionEvent.ACTION_HOVER_ENTER);
onHoverKey(currentKey, event);
- event.setAction(MotionEventCompat.ACTION_HOVER_MOVE);
+ event.setAction(MotionEvent.ACTION_HOVER_MOVE);
final boolean handled = onHoverKey(currentKey, event);
event.setAction(savedAction);
@@ -192,10 +190,10 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
}
switch (event.getAction()) {
- case MotionEventCompatUtils.ACTION_HOVER_ENTER:
+ case MotionEvent.ACTION_HOVER_ENTER:
sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER);
break;
- case MotionEventCompatUtils.ACTION_HOVER_EXIT:
+ case MotionEvent.ACTION_HOVER_EXIT:
sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_HOVER_EXIT);
break;
}
diff --git a/java/src/com/android/inputmethod/accessibility/FlickGestureDetector.java b/java/src/com/android/inputmethod/accessibility/FlickGestureDetector.java
index eaa4ddff6..e8ec37600 100644
--- a/java/src/com/android/inputmethod/accessibility/FlickGestureDetector.java
+++ b/java/src/com/android/inputmethod/accessibility/FlickGestureDetector.java
@@ -18,11 +18,9 @@ package com.android.inputmethod.accessibility;
import android.content.Context;
import android.os.Message;
-import android.support.v4.view.MotionEventCompat;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
-import com.android.inputmethod.compat.MotionEventCompatUtils;
import com.android.inputmethod.keyboard.PointerTracker;
import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
@@ -32,10 +30,10 @@ import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
* A flick gesture is defined as a stream of hover events with the following
* properties:
* <ul>
- * <li>Begins with a {@link MotionEventCompatUtils#ACTION_HOVER_ENTER} event
- * <li>Contains any number of {@link MotionEventCompat#ACTION_HOVER_MOVE}
+ * <li>Begins with a {@link MotionEvent#ACTION_HOVER_ENTER} event
+ * <li>Contains any number of {@link MotionEvent#ACTION_HOVER_MOVE}
* events
- * <li>Ends with a {@link MotionEventCompatUtils#ACTION_HOVER_EXIT} event
+ * <li>Ends with a {@link MotionEvent#ACTION_HOVER_EXIT} event
* <li>Maximum duration of 250 milliseconds
* <li>Minimum distance between enter and exit points must be at least equal to
* scaled double tap slop (see
@@ -113,7 +111,7 @@ public abstract class FlickGestureDetector {
public boolean onHoverEvent(MotionEvent event, AccessibleKeyboardViewProxy view,
PointerTracker tracker) {
// Always cache and consume the first hover event.
- if (event.getAction() == MotionEventCompatUtils.ACTION_HOVER_ENTER) {
+ if (event.getAction() == MotionEvent.ACTION_HOVER_ENTER) {
mCachedView = view;
mCachedTracker = tracker;
mCachedHoverEnter = MotionEvent.obtain(event);
@@ -129,10 +127,10 @@ public abstract class FlickGestureDetector {
final float distanceSquare = calculateDistanceSquare(mCachedHoverEnter, event);
switch (event.getAction()) {
- case MotionEventCompat.ACTION_HOVER_MOVE:
+ case MotionEvent.ACTION_HOVER_MOVE:
// Consume all valid move events before timeout.
return true;
- case MotionEventCompatUtils.ACTION_HOVER_EXIT:
+ case MotionEvent.ACTION_HOVER_EXIT:
// Ignore exit events outside the flick radius.
if (distanceSquare < mFlickRadiusSquare) {
clearFlick(true);
@@ -171,10 +169,8 @@ public abstract class FlickGestureDetector {
* Computes the direction of a flick gesture and forwards it to
* {@link #onFlick(MotionEvent, MotionEvent, int)} for handling.
*
- * @param e1 The {@link MotionEventCompatUtils#ACTION_HOVER_ENTER} event
- * where the flick started.
- * @param e2 The {@link MotionEventCompatUtils#ACTION_HOVER_EXIT} event
- * where the flick ended.
+ * @param e1 The {@link MotionEvent#ACTION_HOVER_ENTER} event where the flick started.
+ * @param e2 The {@link MotionEvent#ACTION_HOVER_EXIT} event where the flick ended.
* @return {@code true} if the flick event was handled.
*/
private boolean dispatchFlick(MotionEvent e1, MotionEvent e2) {