mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Remove PointerTracker reference from accessibility package"
This commit is contained in:
commit
ce9c7d7511
@ -29,10 +29,10 @@ import android.view.ViewParent;
|
|||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.Key;
|
import com.android.inputmethod.keyboard.Key;
|
||||||
|
import com.android.inputmethod.keyboard.KeyDetector;
|
||||||
import com.android.inputmethod.keyboard.Keyboard;
|
import com.android.inputmethod.keyboard.Keyboard;
|
||||||
import com.android.inputmethod.keyboard.KeyboardId;
|
import com.android.inputmethod.keyboard.KeyboardId;
|
||||||
import com.android.inputmethod.keyboard.MainKeyboardView;
|
import com.android.inputmethod.keyboard.MainKeyboardView;
|
||||||
import com.android.inputmethod.keyboard.PointerTracker;
|
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
|
||||||
public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
|
public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
|
||||||
@ -220,9 +220,11 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp
|
|||||||
* Receives hover events when touch exploration is turned on in SDK versions ICS and higher.
|
* Receives hover events when touch exploration is turned on in SDK versions ICS and higher.
|
||||||
*
|
*
|
||||||
* @param event The hover event.
|
* @param event The hover event.
|
||||||
|
* @param keyDetector The {@link KeyDetector} to determine on which key the <code>event</code>
|
||||||
|
* is hovering.
|
||||||
* @return {@code true} if the event is handled
|
* @return {@code true} if the event is handled
|
||||||
*/
|
*/
|
||||||
public boolean dispatchHoverEvent(final MotionEvent event, final PointerTracker tracker) {
|
public boolean dispatchHoverEvent(final MotionEvent event, final KeyDetector keyDetector) {
|
||||||
if (mView == null) {
|
if (mView == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -233,7 +235,7 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp
|
|||||||
final Key key;
|
final Key key;
|
||||||
|
|
||||||
if (pointInView(x, y)) {
|
if (pointInView(x, y)) {
|
||||||
key = tracker.getKeyOn(x, y);
|
key = keyDetector.detectHitKey(x, y);
|
||||||
} else {
|
} else {
|
||||||
key = null;
|
key = null;
|
||||||
}
|
}
|
||||||
|
@ -1039,8 +1039,8 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
|||||||
@Override
|
@Override
|
||||||
public boolean dispatchHoverEvent(final MotionEvent event) {
|
public boolean dispatchHoverEvent(final MotionEvent event) {
|
||||||
if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
|
if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
|
||||||
final PointerTracker tracker = PointerTracker.getPointerTracker(0);
|
return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent(
|
||||||
return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent(event, tracker);
|
event, mKeyDetector);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reflection doesn't support calling superclass methods.
|
// Reflection doesn't support calling superclass methods.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user