This CL fixes the following compiler warnings.
- Indirect access to static member
- Access to a non-accessible member of an enclosing type
- Parameter assignment
- Method can be static
- Local variable declaration hides another field or variable
- Value of local variable is not used
- Unused import
- Unused private member
- Unnecessary 'else' statement
- Unnecessary declaration of throw exception
- Redundant type arguments
- Missing '@Override' annotation
- Unused '@SuppressWarning' annotations
Bug: 18003991
Change-Id: Icfebe753e53a2cc621848f769d6a3d7ce501ebc7
We should reset the composition state when moving the cursor inside
the word after a gesture when the text field specifies no suggestions.
Bug: 17959921
Change-Id: I977fea775f7b7e145e343636f0fb94266a40953a
That is, when auto-correcting or when manually picking.
This is not great, but it's a good starting point.
Bug: 11230254
Change-Id: I07627f48e2de1c28053d6572c7c72625808ec79c
We can now start relying on L APIs even in unbundled release.
This means ENABLE_CURSOR_ANCHOR_INFO_CALLBACK can be always true.
Hence we simply remove it.
Change-Id: I0353e992e97e252059f83accea100504594bf171
In ICS factory rom and MR0, there was a bug where calling the
constructor for SuggestionSpan that doesn't take a context as
an argument would always return in a crash. Don't call it,
and pass an explicit context instead.
Bug: 13552505
Change-Id: I5c919499b9d086c2cf283795b2af5b91cb425933
In chat clients, the last committed word is not committed via
rich input connection. This will handle those missed out cases.
Change-Id: If3f1f6e1927cdf56a09d3e9124f05c66ca75de53
With this CL, the previously used commit indicator was reverted.
Instead we use the add-to-dictionary indicator only at the moment.
This CL also fixes the indicator position in bidi context.
BUG: 17335734
Change-Id: I5f7cf173ddc30876e2b01320acaff8ba4265edf6
This is a follow up CL for API signature change in
I772c48ff18918e48a81e807b48ff907614485c09
BUG: 17320996
Change-Id: Ic8b6162bda12bf74fae79af212c5d81c400eb9e8
With this CL, the text highlight color is applied
when the commit indicator is displayed.
Note that the underline is not rendered when the
background color is enabled. This is a known issue.
Change-Id: Ia19355e1303e3a10e8a7d69bc47c779feb70248a
When CursorAnchorInfo is unavailable, we shouldn't try to show
the commit indicator and set the text highlight color.
With this CL, RichInputConnection can be used to track if the
application responded that it does support CursorAnchorInfo or
not. This result will be taken into consideration when
InputLogic needs to determine whether the commit indicator
should be displayed or not.
Change-Id: I945d70eeb02a7a5f3d9b22459b23d7028508910f
This is an optional optimization to reduce the UI latency.
Imagine that the commit indicator is now displayed and the
composing text is being updated, it is highly likely that
the commit indicator will disappear unless the application
rejects the setComposingText request.
If we assume that the application will accept the new
composing text without any modifications, we can hide the
indicator without waiting for the arrival of new
CursorAnchorInfo event.
This optimization isn't dangerous because we can show the
indicator again when we receive new CursorAnchorInfo event
and the assumption is turned out to be invalid.
Change-Id: Id59c6607a1029782410611e768791af9984f14ac
This CL introduces commit/add-to-dictionary indicators.
Note that the text is not yet highlighted when the commit
indicator is displayed. It will be addressed in subsequent
CLs.
Change-Id: I7e9b0fcfdc0776a50a1d8cfb41ee0add813317dd
This is because prediction can't be easily distinguished in
style. This fixes the bug by simulating the right members,
but some refactoring should be done to remove useless
booleans.
Bug: 17271923
Change-Id: Ib88f3fb95678021624e59535492926dd315d26fb
This is a groundwork for subsequent CLs where we need to
call this method from multiple places. This CL does not
change any existing behaviors.
Change-Id: Id8fa0360305d7383571edffab6752b2240367cf9
This CL slightly extends the condition when "Add to dictionary"
hint is dismissed.
With this CL, "Add to dictionary hint" will be dismissed by any
non-special char event. This is more comfortable especially if
we start using more intrusive UIs such as indicator and/or
background color with the text hint in the suggestion strip.
Change-Id: I2ea0fa40d9c6663ebf5d5439be3eca2a2cbd5166
This is a groundwork for subsequent CLs where we need to
add/remove background color to/from the commited text.
In this CL, we use Spanned#SPAN_COMPOSING so that we can easily
remove such a background color by calling
InputConnection#finishComposingText. To make this operation easy
and realiable, we need to track whether we have specified the
background color to the commited text or not at one place. Here
we use RichInputConnection for this purpose.
Change-Id: I5f9bc4425c5d1b80a719a20e5baf336729ec08d2
There is a bug in ICS where the input connection won't take
any writing commands after rotation until the cursor moves.
This fixes it by wiggling the cursor position once before trying
to do anything.
Bug: 16810766
Change-Id: Ib14c70bd0550420cecfa86dea501d13a1a91e296
It's probably cleaner to just pass the events rather than read
them from a transaction, especially when a transaction may be
associated with several events in a chain.
Change-Id: I27830f0f3f3f32fe77ea8b9cad505b7ebee648af
Do away with the didAutoCorrect local variables which are
unnatural to return out of all these functions.
Change-Id: I22024004d2c489de018beff812c2c589bfd8ca32
Formerly "Show correction suggestions" had three options, "always
show", "show in portrait mode", and "always hide". The reason behind
"show in portrait mode" was that there may not be enough screen estate
in landscape mode to show suggestions. Because recent phone devices
have relatively large screen, we decide to remove "show in portrait
mode" option.
Bug: 15780939
Change-Id: I896d737452c3893d43ce20bd88127f10c1eb3d83
...otherwise we can't recompute the composition when we
change scripts.
This also fixes when we register that we need to take note
that the current subtype was used. Luckily this is a good
occasion for some cleanup that I've wanted to do for some
time: use InputTransaction for onTextInput (with the goal
to ultimately remove it entirely)
Bug: 15840116
Change-Id: Ie4f4f9157b66b79237eeb3db75535803124d3e19
With hardware events, we do have some events that
have both a keycode and a code point, so we need
a better way of distinguishing between auto-insert
keystrokes and others.
Change-Id: Ia23042989b4dca9d3a7d4a4c06bcebdabe324a7a
Also, this double tests for CODE_SPACE in the path going through
maybeDoubleSpacePeriod, but that's temporary.
Bug: 15740318
Change-Id: I0a6ace09cc791f0009157d3017675b9b3eb92145
We need to update them after separator-space, and also when
the user presses shift and they are displayed.
Bug: 15554503
Change-Id: I5596163d5cd94d3cc5f6af10a1ab2cc74b6d4279
This member has outlived its usefulness. It's not clear now that it
makes things really faster, but it does bring a lot of complexity
that we can avoid by removing it.
Change-Id: Ifbc8094a45b56b958fe165b1930f4cc358a97721
This change also includes a fix that has suggestions re-computed
when the typed word is included but no prior suggestions were
found in spans.
Bug: 2349475
Change-Id: Ic06e6ac492507126ffc1e96a5f396c971b567272
The symptom : when text is selected and the device is rotated,
sometimes the keyboard sets the word as being composed around
the start of the selection. Upon the next rotation this ends up
with the keyboard committing some text in place of the selection.
The cause : another bug in the framework with rotation >.>
The keyboard receives a call to startInput with a wrong cursor
position, namely one that does not represent a selection. The
keyboard sets a composition according to this wrong data. When
the keyboard is rotated again, it commits the text, which takes
the place of the selection.
The solution : actually when restarting input the keyboard
realizes that the cursor position is wrong. We cancel composition
at that time.
For robustness, this change also implements two other defensive
changes : upon call to onUpdateSelection, we actually realize
that the previous values were wrong, so we also fix it at that
time, and in addition, when rotating, we finishComposingText()
instead of commitText() which is less dangerous. Implementing
this later change also allows us to let less internal variables
from InputLogic escape to LatinIME, so it's also a good change
for design.
Bug: 14140799
Change-Id: Ib10de18e53e376ac1bbc8487e13d969828483346
Rename `initialize' to `start' and `deactivate' to `stop' for ease
of understanding. It's completely bizarre that you can "deactivate"
a recapitalization and that will just restart a new one the next time
you press shift. Start and stop are easier to understand.
Change-Id: I455175aebfcfe11198c6c61bf2c6b19efc3f82df