Don't count Spacer into histograms
Change-Id: I202a25da4e1a722aa35c57665d73bc5990404c4e
This commit is contained in:
parent
27d9c6f795
commit
97eaa543d5
1 changed files with 9 additions and 4 deletions
|
@ -84,11 +84,16 @@ public class KeyboardParams {
|
||||||
|
|
||||||
public void onAddKey(final Key newKey) {
|
public void onAddKey(final Key newKey) {
|
||||||
final Key key = (mKeysCache != null) ? mKeysCache.get(newKey) : newKey;
|
final Key key = (mKeysCache != null) ? mKeysCache.get(newKey) : newKey;
|
||||||
final boolean zeroWidthSpacer = key.isSpacer() && key.mWidth == 0;
|
final boolean isSpacer = key.isSpacer();
|
||||||
if (!zeroWidthSpacer) {
|
if (isSpacer && key.mWidth == 0) {
|
||||||
mKeys.add(key);
|
// Ignore zero width {@link Spacer}.
|
||||||
updateHistogram(key);
|
return;
|
||||||
}
|
}
|
||||||
|
mKeys.add(key);
|
||||||
|
if (isSpacer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateHistogram(key);
|
||||||
if (key.mCode == Constants.CODE_SHIFT) {
|
if (key.mCode == Constants.CODE_SHIFT) {
|
||||||
mShiftKeys.add(key);
|
mShiftKeys.add(key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue