Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
78527e4d
Commit
78527e4d
authored
12 years ago
by
Charles Chen
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Adjust accessibility edge slop." into jb-mr1-dev
parents
263caae3
e76a9b36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/values/dimens.xml
+3
-0
3 additions, 0 deletions
java/res/values/dimens.xml
java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+11
-5
11 additions, 5 deletions
...nputmethod/accessibility/AccessibleKeyboardViewProxy.java
with
14 additions
and
5 deletions
java/res/values/dimens.xml
+
3
−
0
View file @
78527e4d
...
...
@@ -101,4 +101,7 @@
<dimen
name=
"gesture_floating_preview_text_shadow_border"
>
17.5dp
</dimen>
<dimen
name=
"gesture_floating_preview_text_shading_border"
>
7.5dp
</dimen>
<dimen
name=
"gesture_floating_preview_text_connector_width"
>
1.0dp
</dimen>
<!-- Inset used in Accessibility mode to avoid accidental key presses when a finger slides off the screen. -->
<dimen
name=
"accessibility_edge_slop"
>
8dp
</dimen>
</resources>
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+
11
−
5
View file @
78527e4d
...
...
@@ -24,7 +24,6 @@ import android.support.v4.view.accessibility.AccessibilityEventCompat;
import
android.support.v4.view.accessibility.AccessibilityNodeInfoCompat
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.ViewConfiguration
;
import
com.android.inputmethod.keyboard.Key
;
import
com.android.inputmethod.keyboard.Keyboard
;
...
...
@@ -44,7 +43,7 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
/**
* Inset in pixels to look for keys when the user's finger exits the
* keyboard area.
See {@link ViewConfiguration#getScaledEdgeSlop()}.
* keyboard area.
*/
private
int
mEdgeSlop
;
...
...
@@ -62,7 +61,8 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
private
void
initInternal
(
InputMethodService
inputMethod
)
{
mInputMethod
=
inputMethod
;
mEdgeSlop
=
ViewConfiguration
.
get
(
inputMethod
).
getScaledEdgeSlop
();
mEdgeSlop
=
inputMethod
.
getResources
().
getDimensionPixelSize
(
R
.
dimen
.
accessibility_edge_slop
);
}
/**
...
...
@@ -114,8 +114,14 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
public
boolean
dispatchHoverEvent
(
MotionEvent
event
,
PointerTracker
tracker
)
{
final
int
x
=
(
int
)
event
.
getX
();
final
int
y
=
(
int
)
event
.
getY
();
final
Key
key
=
tracker
.
getKeyOn
(
x
,
y
);
final
Key
previousKey
=
mLastHoverKey
;
final
Key
key
;
if
(
pointInView
(
x
,
y
))
{
key
=
tracker
.
getKeyOn
(
x
,
y
);
}
else
{
key
=
null
;
}
mLastHoverKey
=
key
;
...
...
@@ -123,7 +129,7 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
case
MotionEvent
.
ACTION_HOVER_EXIT
:
// Make sure we're not getting an EXIT event because the user slid
// off the keyboard area, then force a key press.
if
(
pointInView
(
x
,
y
)
&&
(
key
!=
null
)
)
{
if
(
key
!=
null
)
{
getAccessibilityNodeProvider
().
simulateKeyPress
(
key
);
}
//$FALL-THROUGH$
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment