Commit Graph

74 Commits (9ebba46c775f37abeb0451602cb323fd45adf33b)

Author SHA1 Message Date
Mohammadinamul Sheik d543984d2e Create a new KeyboardLayout class to represent the layout.
Change-Id: Ia08c8194f460271c831702675cfb687ab9f6678b
2015-01-30 17:24:09 -08:00
Tadashi G. Takaoka 9d5d01a543 Add null analysis annotations to keyboard package
Change-Id: I6f020ece3c45d584d413e4265d6d3fbdf1ea8bd8
2014-11-27 12:37:38 +09:00
Ken Wakasa 9342484e8d Move Constants.java to the latin.common package
Our intention is to have classes of latinime-common under the common
package as much as we can.

Change-Id: I76efbbbe7bebf1a4aa943715cdff64f91675e20d
2014-10-23 20:27:37 +09:00
Tadashi G. Takaoka 5f00fe09e9 Fix some compiler warnings
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
2014-10-21 19:28:37 +09:00
Jean Chalard 4ef27c0358 [ML13] Fix the locale passing in ProximityInfo
The locale is used to determine additional proximity characters. This
is dependent on the dictionary language, but was passed as a function
of the layout, which is wrong and would have given bad suggestions in
multi-lingual mode.

Ideally, additional proximity characters should be inserted in the
dictionary header, but for now it's a rather simple change to get
it from the dictionary's locale instead of the proximity info locale.

Also, that allows us to remove completely the locale parameter from
proximity info, which is a much needed change.

This change has zero effect on unit tests and on regression tests.

Bug: 11230254
Change-Id: If95157155db7dccd1f00b8ba55ccb3600283f9e4
2014-10-03 18:16:34 +09:00
Tadashi G. Takaoka a91561aa58 Use Java 7 diamond operator
Change-Id: If16ef50ae73147594615d0f49d6a22621eaf1aef
2014-05-24 01:05:42 +09:00
Tadashi G. Takaoka 9d84d67b44 Fix typo of local variable name
Change-Id: I09c0aeee979e883af199f5c533d526a089064987
2014-04-22 14:25:53 -07:00
Tadashi G. Takaoka c13c1adfa7 Sort keys from top-left to bottom-right order
Change-Id: I228748824de62e9e46fa43db200d23f41eb6d2ce
2014-04-21 18:36:11 -07:00
Tadashi G. Takaoka 5326dcfb7d Use unmodifiable list to return keys from Keyboard
Change-Id: I85a0b18d2d78632e9a9f074eda1de9225001f876
2014-04-21 14:31:27 -07:00
Tadashi G. Takaoka 58d4e610ac Use unmodifiable list to return the nearest keys
Change-Id: Ic9084b08fa9a1f25b7f4b98c627350583c401c12
2014-04-21 14:30:59 -07:00
Jean Chalard a7d0ab80a0 Fix an off-by-one error.
These variables were meant to represent the (x,y) coordinate of the
last pixel of the grid, to avoid going one pixel too far. But the last
pixel of the grid, of course, has coord (width - 1, height - 1).

This bug only ever happens in a rare case because to reproduce,
it needs the right (resp. bottom) coordinate of the rightmost
(resp. bottommost) plus the threshold plus half the grid width
(resp. height) to be exactly the number of pixels of the grid,
which is pretty unlikely... unless there are more tiles in the
grid than pixels on the screen, in which case the grid width is
1 and this becomes likely.

This fixes the fencepost error and renames the variables to
clarify their meaning.

Bug: 10537485
Change-Id: Iecfe2c0f29ee17776ee2cceaa4b1db722276b1f3
2013-09-19 13:43:09 +09:00
Satoshi Kataoka 4994e1f2ba Workaround for AIOOB exception in ProximityInfo
Bug: 10537485
Change-Id: I185f17dcb2cd9e3af17a1eafefaa487804d5cce9
2013-08-29 15:47:47 +09:00
Tadashi G. Takaoka 7dc60f9db7 Add getters and copy constructor to Key class
Change-Id: I78eb96dcc26378926dc63acbfeb4828cbd44435d
2013-08-15 20:12:46 +09:00
Ken Wakasa e28eba5074 Move util classes to the latin/utils directory
Change-Id: I1c5b27c8edf231680edb8d96f63b9d04cfc6a6fa
2013-06-24 17:04:40 +09:00
Jean Chalard d55baf06d9 Optimize ProximityInfo#computeNearestNeighbors()
This cuts the time spent in computeNearestNeigbors by
a factor of 6 to 20, with an average at about 8.
This method representing about 25% of the total time
spent when switching keyboards, this change is a
20% improvement in layout switching time.

Bug: 8689779
Change-Id: Icb465f6010b317c7156057891c3341e51a198688
2013-06-18 20:33:52 +09:00
Satoshi Kataoka 244a24e368 Consolidate dummy proximity info to the spell checker info
Bug: 8783170

Change-Id: I067486e5ec1ae7cdef8e2121392464ba71ee8add
2013-05-08 11:49:12 +09:00
Keisuke Kuroynagi 87fdde6ec4 Typing double letters via a 'circle' on the key.
Bug: 8550980
Change-Id: I5e432dea0e025ccea196f80e90a6bf945488e130
2013-04-10 12:43:13 +09:00
Tadashi G. Takaoka 6e3f307266 Refactor SpellCheckerProximityInfo as extending ProximityInfo
Change-Id: I544eec9d661796d57749dbaa2163bc1e2a891353
2013-04-02 19:06:32 +09:00
Ken Wakasa 6c22439bf8 Remove MAX_PROXIMITY_CHARS_SIZE_INTERNAL
Change-Id: I18a997503de4033b5341b564145bca862a872098
2013-01-22 13:18:49 +09:00
Tadashi G. Takaoka 8aa9963a89 Fix Apache license comment
Change-Id: Ic56167f952a7f4449da366e1e81610e72c966086
2013-01-21 22:23:37 +09:00
Ken Wakasa 5db594abba Remove MAX_WORD_LENGTH_INTERNAL
Change-Id: Ie11ff000675601acff5fbb00e9e9f48eb32c5071
2013-01-15 12:39:08 +09:00
Tadashi G. Takaoka 308aaff80c Get rid of special keys from ProximityInfo
Bug: 7601672
Change-Id: I15faa4829b98f7b4dd07013fdd58bc2c527bcd6f
2012-12-03 18:50:58 +09:00
Tadashi G. Takaoka 240871ecaf Move code point constants from Keyboard to Constants class
Change-Id: Iee01d4d2b916d0b584531104ac865ae6e6370a3d
2012-10-29 16:04:20 +09:00
Tadashi G. Takaoka f9aa99c1c9 Disable touch position correction of MoreKeysKeyboard
Change-Id: Ieec33894a348602fd71d6fe473142b43eb2551b6
2012-10-09 19:20:28 +09:00
Tadashi G. Takaoka 1775201671 Calculate default touch position correction data for keys on 4th row
This change also disables touch position correction for Phone/Dvorak
keyboard.

Bug: 7243101
Change-Id: Idfcc7ad1feabbe6a81635dceba5be087401fa18b
2012-09-27 17:55:58 +09:00
Tadashi G. Takaoka 6ca50d9920 Fix touch position correction data passing
Bug: 7225811
Change-Id: I3dcc0385ed633585d6810fdb742e0f88c2efbbd2
2012-09-25 14:24:15 +09:00
Tadashi G. Takaoka 35ff94547c Separate inner classes of keyboard package out under internal package
Change-Id: Ia3969bd5ddec5aa5d81d05ad4cf676d818587922
2012-08-30 15:37:55 +09:00
Tadashi G. Takaoka ac78633be2 Rename and consolidate some constants
Change-Id: I7863936cca18b28bf0117afcbcf544a5fd7f185d
2012-08-21 17:54:53 +09:00
Ken Wakasa bcec82de66 Clean up constructors
And, use C++ style casts and use float math functions rather than double ones to save memory space.

Also, stop using FloatMath and NativeUtils as standard Math methods are faster now.
See http://code.google.com/p/android/issues/detail?id=36199 and https://android-review.googlesource.com/40700

multi-project commit with I4259fb5ab8a15ac5760a7f04fc8f4c860529f04a

Change-Id: I0b81cff8c91769f7559a59b9528c75a5aabb4211
2012-08-13 10:48:37 +09:00
Tadashi G. Takaoka 56853c1e48 Use SparseArray<E> instead of HashMap<Integer,E>
Change-Id: Id962e670ee1a5164e6c69deb84625139bf5e7974
2012-06-29 17:56:31 +09:00
Tadashi G. Takaoka 9f42140ae2 Remove useless copy constructor of ProximityInfo
Change-Id: I56b4a99f670ad38708ad83d76b93a631295e3333
2012-06-12 15:13:07 -07:00
Satoshi Kataoka 3e8c58f68d Separate state from proximity_info step1
Bug: 6548943

Change-Id: I7b4fbe20615a28151a74875be43b9f4a20e0dce9
2012-06-07 13:35:34 +09:00
Tadashi G. Takaoka 60ee192b07 Utilize Rect's method
Change-Id: Ia3df1baae4b92eca828c53c17f68ff26b25e525c
2012-05-31 14:05:34 +09:00
Tadashi G. Takaoka 2866da88a7 Make ProximityInfo copy constructor for test
Change-Id: I94a29784591208af1849d4941a3b4789b93782de
2012-05-23 17:45:19 +09:00
satok 0028ed3627 Use "float" instead of "double"
Change-Id: I93ed4d88ede4058f081dd8d634b00dfff4e96d07
2012-05-16 20:45:05 +09:00
Ken Wakasa 88794b24c0 Remove the dependency to SpellCheckerProximityInfo from ProximityInfo.
In conjunction with I596b2deb

Change-Id: I42f059158ae78e1c1c807ed4d3688edbcf18c006
2012-05-11 17:03:06 +09:00
satok 209dd09e5a Come back the proximity correction to ExpandableDictionary
Bug: 6242539
Change-Id: Ic0467d54c9d85d0653812d4e127328878ef15b94
2012-04-02 15:01:21 +09:00
Jean Chalard 081616cd2f Send correct coordinates for the spell checker
This results in the computation being done in native code
and the correct proximity being used.
Bug: 6181080

Change-Id: I08fa05c781d607e4feca2caeda353ec19c133a3d
2012-03-23 13:02:58 +09:00
Jean Chalard 330cd291fa Make some constants more explicit.
This wasn't very obvious, but the actual values are critical, so
make it more readable
Bug: 6181080

Change-Id: I07461d2df4c796dad0cb6f5283e41a28036d023c
2012-03-22 14:28:05 +09:00
satok 728d1c884e Cleanup proximity related code
Bug: 4343280
Change-Id: I57c0f9e20d9d8911009ea97057251a7f7a81512f
2012-03-19 18:33:59 +09:00
satok 2d5c40d873 Send key information even when the touch position correction is not triggered.
Bug: 4343280
Change-Id: Id24935f9f0f66ebaa799bb92537d842033427c4c
2012-03-14 19:01:08 +09:00
Tadashi G. Takaoka b4fbbe57f5 Avoid using collection interface, using array instead
Change-Id: Ie0554362b73967bfcbbab6ad19c24683066a608e
2012-03-13 20:53:15 +09:00
satok 7ef1dabd92 Pass the locale to the native code
Change-Id: I8f73b9b33cca56b3fa44ec6259c0896be22f4a47
2012-03-13 19:16:33 +09:00
satok 552c3c27f0 Implement additional proximity characters in the native code
Bug: 4343280

Change-Id: I9bbc5cab2fef1ee80c1fe32017df811ef8af10bc
2012-03-13 17:38:50 +09:00
Tadashi G. Takaoka f686211183 Merge "Split Utils class to StringUtils, SubtypeUtils, and JniUtils" 2012-03-08 03:59:59 -08:00
Tadashi G. Takaoka cc8c8b99bd Split Utils class to StringUtils, SubtypeUtils, and JniUtils
Change-Id: I09e91675fe7d573dad8c933ad513b21d7e409144
2012-03-08 20:30:38 +09:00
satok a70ee6e3b3 Add functions to calculate proximity characters in the native code
Bug: 4343280

Change-Id: I17f8f6295b01900948b98680d0267753f33a46cf
2012-03-08 12:55:15 +09:00
satok 370674422a Refactor to suppress null worning
Change-Id: I4b4dc6f86d659491d8b9a74ed120092eab964345
2012-03-05 18:15:29 +09:00
Tadashi G. Takaoka 2affaf91a0 Rename mini keyboard to more keys keyboard
Change-Id: Ie4c85e8ca5a1f41a420aae5c1cd9c1cb07e237e5
2012-02-08 16:12:31 +09:00
satok e05b3f4b3a Support additional proximity characters
Change-Id: Ifbe0d7e4eafea1926bbce968eae4724dd5769689
2012-02-02 16:07:16 +09:00