b7edebc8adc1aeb1063afc4b6726a46f87aff6e4 |
|
11-Apr-2016 |
Yohei Yukawa <yukawa@google.com> |
Fix inefficient CursorAnchorInfo#hashCode(). It turns out that the current CursorAnchorInfo#equals() is quite inefficient because our CursorAnchorInfo#hashCode() tries to use almost all the fields. Even worse, as Matrix#hashCode() is hard-coded to 44, we get the same hashCode() when comparing two CursorAnchorInfo objects that are different only in transformation Matrix after such a complex hash calculation. In the real world scenarios, most likely calculation hash code only from Matrix and composing text would be good enough for our use case, because the former can cover UI scrolling scenario and the latter can cover the text typing scenario. More complex hash calculation is probably inefficient. With this CL, CursorAnchorInfo#hashCode() is pre-calculated only from those two fields, and carefully reorder comparisons in CursorAnchorInfo#equals() to improve the likelihood of returning false with fewer comparisons. Bug: 28105733 Change-Id: Id896adeab5ffe87ceddb2c2762d6d91475e28ec4
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
3fadee479107f0494e1e190aba2a1eea12cb0a75 |
|
08-Sep-2014 |
Yohei Yukawa <yukawa@google.com> |
API Review: Clean up removed APIs This CL removes old API signatures marked as @removed in the follow CLs. - Ic8c6fab58c01206872a34e7ee604cdda1581364d - Ia8cbb9f6b41cd9509fc0147fd68763dfde593ffc - I772c48ff18918e48a81e807b48ff907614485c09 This is just a clean-up CL. No behavior change is intended. BUG: 17200900 BUG: 17320996 BUG: 17365414 Change-Id: Ibfbd5cc1cdebb8851c73477cff55c9b2d631fdea
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
5f183f0671dfa1d87ca6d741deb457170c432493 |
|
02-Sep-2014 |
Yohei Yukawa <yukawa@google.com> |
L API proposal: Introduce IS_RTL flag This CL introduces CursorAnchorInfo.FLAG_IS_RTL for better RTL support. This CL also renames *CharacterRect() with *CharacterBounds() so that they can look more consistent with other existing APIs. Rationale: CursorAnchorInfo.FLAG_IS_RTL addresses following issues. 1. There is no way to associate the RTL information with the insertion marker. 2. Returning mirrored (right < left) RectF for RTL in CursorAnchorInfo#getCharacterRect() is turned out to be bug-prone. Such usage of RectF is not fully supported. For example, RectF#isEmpty() always returns false when right < left. 3. There is no reliable to provide the RTL information when CursorAnchorInfo#getCharacterRect() returns an empty (right == left) RectF. Perhaps we could use +0.0 and -0.0, but I'm afraid that it is also bug-prone. BUG: 17365414 BUG: 17335734 Change-Id: Ic8c6fab58c01206872a34e7ee604cdda1581364d
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
cc24e2b6a2a429d70b75c6810a5cfd8816ce03ad |
|
30-Aug-2014 |
Yohei Yukawa <yukawa@google.com> |
API Review: CursorAnchorInfo This CL introduces following combinable flags as a replacement of CHARACTER_RECT_TYPE_* constants. - CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION - CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION This CL also replaces #isInsertionMarkerClipped() with flags. Rationale: getCharacterRectFlags() should return a set of flags, rather than enum-like types. getInsertionMarkerFlags() is more consistent with getCharacterRectFlags() than isInsertionMarkerClipped(). It is also open for future extension. BUG: 17200900 Change-Id: Ia8cbb9f6b41cd9509fc0147fd68763dfde593ffc
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
e05d4ca4dc13f2e92d6fa5ec437d6b2e8de0adde |
|
01-Sep-2014 |
Yohei Yukawa <yukawa@google.com> |
Get rid of one redundant comparison of #mComposingTextStart The code in question is not only redundant but also harmful because it causes unnecessary integer boxing. BUG: 17340578 Change-Id: Ife6e48889db80394d224297c53806105dc41d56e
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
bb9f624252174afa49359ed2a90ec06113adff35 |
|
11-Jul-2014 |
Yohei Yukawa <yukawa@google.com> |
Use a bit more descriptive name for a parameter The current parameter name "index" in CursorAnchorInfo.Builder#setComposingText is a bit hard to understand. This CL names it with "composingTextStart" to clarify its usage. Change-Id: I504939b8d2b48875d8baa9630b5a4f04a5d66dbe
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
0b01e7fc58cdde00d8350285a3386c4209b72d78 |
|
08-Jul-2014 |
Yohei Yukawa <yukawa@google.com> |
Polish new IME API for L: CursorAnchorInfo This CL allows application authors and input method authors to communicate with each other more precisely on the visibility of insertion marker and composing characters. Now we can describe the situation where the coordinates of them are available but they are overlapped by other UI elements. This change is based on feedbacks from internal customers of this preview API. Change-Id: I82eba0e844a6f8b99ba11a68fad272399034cc24 BUG: 16118303
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
eea0b8b051e916051d0d09da3f41f9ec4d508bff |
|
08-Jul-2014 |
Yohei Yukawa <yukawa@google.com> |
Fix inconsistencies in CursorAnchorInfo#equals This CL addresses some inconsistencies found in CursorAnchorInfo#equals. - #mComposingText is now taken into consideration when compared with other instances. - NaN is now treated as if it was just a number in CursorAnchorInfo#equals if and only if NaN is used in -- #mInsertionMarkerHorizontal -- #mInsertionMarkerTop -- #mInsertionMarkerBaseline -- #mInsertionMarkerBottom. This is useful if we want to use NaN as a marker to indicate that no value is specified. Change-Id: Ibff31bc34b9d488731b294ad38240c567a06b627
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
b5268dcc17cd9ecb540b06ad59bd74188b57a069 |
|
27-Jun-2014 |
Yohei Yukawa <yukawa@google.com> |
Require coordinate transformation matrix if necessary With this CL, CursorAnchorInfo.Builder#build() raises IllegalArgumentException when an application author attempts to instantiate CursorAnchorInfo without the coordinate transformation matrix but with specifying some positional parameters such as composing character rectangle. Since any other positional members in CursorAnchorInfo are supposed to be specified in local coordinates, the application author must provide the coordinate transformation matrix for such positional data. Change-Id: I2b0fd0f146a2b95fe4fa1324837d8cfee667208c
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
a1fda005f9583486f4372ecbb0eec503ee9cece8 |
|
26-Jun-2014 |
Yohei Yukawa <yukawa@google.com> |
Use CharSequence instead of String in CursorAnchorInfo This might be useful if we need to pass some spans from the application to the input method through CursorAnchorInfo. This change makes CursorAnchorInfo more consistent with other input method APIs where CharSequence is preferred over String. BUG: 15088391 Change-Id: Ie04e8a27050849fee1c93ef14b9944acc70fafe4
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
c46b5f04aa2a9fd292c117d2824f70fcf06e86ba |
|
09-Jun-2014 |
Yohei Yukawa <yukawa@google.com> |
Rename CursorAnchorInfoBuilder with Builder Inner Builder class should not inherit full class name of outer class. BUG: 15516230 Change-Id: I2d56edebb0c85639db57ca5b2aadb22c67fc5926
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
419b1b0498e33a556780be1702b444d54fcaa7dd |
|
15-May-2014 |
Yohei Yukawa <yukawa@google.com> |
Make a copy of Matrix in CursorAnchorInfoBuilder This CL fixes a bug that CursorAnchorInfoBuilder does't make a copy if the Matrix specified with #setMatrix. Without this fix, IMM#updateCursorAnchorInfo could fail to detect duplicated events when the same instances of CursorAnchorInfoBuilder and Matrix are reused to optimize performance. Change-Id: I50c50a12a06d3cda4dec445b171b61ceb78da21a
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
81f4cb3f858f46a4d9b793c4d326b9bf6aca868d |
|
13-May-2014 |
Yohei Yukawa <yukawa@google.com> |
Enable CursorAnchorInfo to contain composing string This CL adds one more functionality to CursorAnchorInfo that enables applications to associate the composition string with its positional information. This is useful for an IME to handle CursorAnchorInfo asynchronously. This is also useful for the framework to detect if the application is unnecessarily calling IMM#updateCursorAnchroInfo with duplicate event. BUG: 14579622 Change-Id: Ie75c17b523dad33e97b08c15f5f5267573ce2063
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|
c2ddd6023688db5ecf6c586e05f55e262b4a802e |
|
06-May-2014 |
Yohei Yukawa <yukawa@google.com> |
Introduce new API for floating window support This CL introduces a new API IMM#updateCursorAnchorInfo for floating window support. BUG: 14579622 Change-Id: I61dec2f8fa671ba891da1d4af08975750e3acb04
/frameworks/base/core/java/android/view/inputmethod/CursorAnchorInfo.java
|