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
afed0567
Commit
afed0567
authored
12 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Performance improvements - Avoid using iterators
Change-Id: Iab604aa1ef67acf5d54208a6bc44635632845ae0
parent
52873834
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+21
-7
21 additions, 7 deletions
.../src/com/android/inputmethod/keyboard/PointerTracker.java
with
21 additions
and
7 deletions
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+
21
−
7
View file @
afed0567
...
@@ -238,13 +238,17 @@ public class PointerTracker {
...
@@ -238,13 +238,17 @@ public class PointerTracker {
}
}
public
static
void
setKeyboardActionListener
(
KeyboardActionListener
listener
)
{
public
static
void
setKeyboardActionListener
(
KeyboardActionListener
listener
)
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
mListener
=
listener
;
tracker
.
mListener
=
listener
;
}
}
}
}
public
static
void
setKeyDetector
(
KeyDetector
keyDetector
)
{
public
static
void
setKeyDetector
(
KeyDetector
keyDetector
)
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
setKeyDetectorInner
(
keyDetector
);
tracker
.
setKeyDetectorInner
(
keyDetector
);
// Mark that keyboard layout has been changed.
// Mark that keyboard layout has been changed.
tracker
.
mKeyboardLayoutHasBeenChanged
=
true
;
tracker
.
mKeyboardLayoutHasBeenChanged
=
true
;
...
@@ -254,7 +258,9 @@ public class PointerTracker {
...
@@ -254,7 +258,9 @@ public class PointerTracker {
}
}
public
static
void
dismissAllKeyPreviews
()
{
public
static
void
dismissAllKeyPreviews
()
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
getKeyPreviewText
().
setVisibility
(
View
.
INVISIBLE
);
tracker
.
getKeyPreviewText
().
setVisibility
(
View
.
INVISIBLE
);
tracker
.
setReleasedKeyGraphics
(
tracker
.
mCurrentKey
);
tracker
.
setReleasedKeyGraphics
(
tracker
.
mCurrentKey
);
}
}
...
@@ -263,7 +269,9 @@ public class PointerTracker {
...
@@ -263,7 +269,9 @@ public class PointerTracker {
// TODO: To handle multi-touch gestures we may want to move this method to
// TODO: To handle multi-touch gestures we may want to move this method to
// {@link PointerTrackerQueue}.
// {@link PointerTrackerQueue}.
private
static
InputPointers
getIncrementalBatchPoints
()
{
private
static
InputPointers
getIncrementalBatchPoints
()
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
mGestureStroke
.
appendIncrementalBatchPoints
(
sAggregratedPointers
);
tracker
.
mGestureStroke
.
appendIncrementalBatchPoints
(
sAggregratedPointers
);
}
}
return
sAggregratedPointers
;
return
sAggregratedPointers
;
...
@@ -272,7 +280,9 @@ public class PointerTracker {
...
@@ -272,7 +280,9 @@ public class PointerTracker {
// TODO: To handle multi-touch gestures we may want to move this method to
// TODO: To handle multi-touch gestures we may want to move this method to
// {@link PointerTrackerQueue}.
// {@link PointerTrackerQueue}.
private
static
InputPointers
getAllBatchPoints
()
{
private
static
InputPointers
getAllBatchPoints
()
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
mGestureStroke
.
appendAllBatchPoints
(
sAggregratedPointers
);
tracker
.
mGestureStroke
.
appendAllBatchPoints
(
sAggregratedPointers
);
}
}
return
sAggregratedPointers
;
return
sAggregratedPointers
;
...
@@ -281,7 +291,9 @@ public class PointerTracker {
...
@@ -281,7 +291,9 @@ public class PointerTracker {
// TODO: To handle multi-touch gestures we may want to move this method to
// TODO: To handle multi-touch gestures we may want to move this method to
// {@link PointerTrackerQueue}.
// {@link PointerTrackerQueue}.
public
static
void
clearBatchInputPointsOfAllPointerTrackers
()
{
public
static
void
clearBatchInputPointsOfAllPointerTrackers
()
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
mGestureStroke
.
reset
();
tracker
.
mGestureStroke
.
reset
();
}
}
sAggregratedPointers
.
reset
();
sAggregratedPointers
.
reset
();
...
@@ -290,7 +302,9 @@ public class PointerTracker {
...
@@ -290,7 +302,9 @@ public class PointerTracker {
// TODO: To handle multi-touch gestures we may want to move this method to
// TODO: To handle multi-touch gestures we may want to move this method to
// {@link PointerTrackerQueue}.
// {@link PointerTrackerQueue}.
public
static
void
drawGestureTrailForAllPointerTrackers
(
Canvas
canvas
,
Paint
paint
)
{
public
static
void
drawGestureTrailForAllPointerTrackers
(
Canvas
canvas
,
Paint
paint
)
{
for
(
final
PointerTracker
tracker
:
sTrackers
)
{
final
int
trackersSize
=
sTrackers
.
size
();
for
(
int
i
=
0
;
i
<
trackersSize
;
++
i
)
{
final
PointerTracker
tracker
=
sTrackers
.
get
(
i
);
tracker
.
mGestureStroke
.
drawGestureTrail
(
canvas
,
paint
,
tracker
.
getLastX
(),
tracker
.
mGestureStroke
.
drawGestureTrail
(
canvas
,
paint
,
tracker
.
getLastX
(),
tracker
.
getLastY
());
tracker
.
getLastY
());
}
}
...
...
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