Pass the locale to the native code
Change-Id: I8f73b9b33cca56b3fa44ec6259c0896be22f4a47
This commit is contained in:
parent
5eec574cf0
commit
7ef1dabd92
2 changed files with 12 additions and 4 deletions
|
@ -154,7 +154,7 @@ public class Keyboard {
|
||||||
mIconsSet = params.mIconsSet;
|
mIconsSet = params.mIconsSet;
|
||||||
mAdditionalProximityChars = params.mAdditionalProximityChars;
|
mAdditionalProximityChars = params.mAdditionalProximityChars;
|
||||||
|
|
||||||
mProximityInfo = new ProximityInfo(
|
mProximityInfo = new ProximityInfo(params.mId.mLocale.toString(),
|
||||||
params.GRID_WIDTH, params.GRID_HEIGHT, mOccupiedWidth, mOccupiedHeight,
|
params.GRID_WIDTH, params.GRID_HEIGHT, mOccupiedWidth, mOccupiedHeight,
|
||||||
mMostCommonKeyWidth, mMostCommonKeyHeight, mKeys, params.mTouchPositionCorrection,
|
mMostCommonKeyWidth, mMostCommonKeyHeight, mKeys, params.mTouchPositionCorrection,
|
||||||
params.mAdditionalProximityChars);
|
params.mAdditionalProximityChars);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
package com.android.inputmethod.keyboard;
|
package com.android.inputmethod.keyboard;
|
||||||
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.Keyboard.Params.TouchPositionCorrection;
|
import com.android.inputmethod.keyboard.Keyboard.Params.TouchPositionCorrection;
|
||||||
import com.android.inputmethod.latin.JniUtils;
|
import com.android.inputmethod.latin.JniUtils;
|
||||||
|
@ -46,10 +47,17 @@ public class ProximityInfo {
|
||||||
private final int mKeyboardHeight;
|
private final int mKeyboardHeight;
|
||||||
private final int mMostCommonKeyWidth;
|
private final int mMostCommonKeyWidth;
|
||||||
private final Key[][] mGridNeighbors;
|
private final Key[][] mGridNeighbors;
|
||||||
|
private final String mLocaleStr;
|
||||||
|
|
||||||
ProximityInfo(int gridWidth, int gridHeight, int minWidth, int height, int mostCommonKeyWidth,
|
ProximityInfo(String localeStr, int gridWidth, int gridHeight, int minWidth, int height,
|
||||||
|
int mostCommonKeyWidth,
|
||||||
int mostCommonKeyHeight, Set<Key> keys, TouchPositionCorrection touchPositionCorrection,
|
int mostCommonKeyHeight, Set<Key> keys, TouchPositionCorrection touchPositionCorrection,
|
||||||
Map<Integer, List<Integer>> additionalProximityChars) {
|
Map<Integer, List<Integer>> additionalProximityChars) {
|
||||||
|
if (TextUtils.isEmpty(localeStr)) {
|
||||||
|
mLocaleStr = "";
|
||||||
|
} else {
|
||||||
|
mLocaleStr = localeStr;
|
||||||
|
}
|
||||||
mGridWidth = gridWidth;
|
mGridWidth = gridWidth;
|
||||||
mGridHeight = gridHeight;
|
mGridHeight = gridHeight;
|
||||||
mGridSize = mGridWidth * mGridHeight;
|
mGridSize = mGridWidth * mGridHeight;
|
||||||
|
@ -69,7 +77,7 @@ public class ProximityInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ProximityInfo createDummyProximityInfo() {
|
public static ProximityInfo createDummyProximityInfo() {
|
||||||
return new ProximityInfo(1, 1, 1, 1, 1, 1, Collections.<Key> emptySet(),
|
return new ProximityInfo("", 1, 1, 1, 1, 1, 1, Collections.<Key> emptySet(),
|
||||||
null, Collections.<Integer, List<Integer>> emptyMap());
|
null, Collections.<Integer, List<Integer>> emptyMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +163,7 @@ public class ProximityInfo {
|
||||||
calculateSweetSpotParams = false;
|
calculateSweetSpotParams = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mNativeProximityInfo = setProximityInfoNative("", MAX_PROXIMITY_CHARS_SIZE,
|
mNativeProximityInfo = setProximityInfoNative(mLocaleStr, MAX_PROXIMITY_CHARS_SIZE,
|
||||||
keyboardWidth, keyboardHeight, mGridWidth, mGridHeight, mMostCommonKeyWidth,
|
keyboardWidth, keyboardHeight, mGridWidth, mGridHeight, mMostCommonKeyWidth,
|
||||||
proximityCharsArray,
|
proximityCharsArray,
|
||||||
keyCount, keyXCoordinates, keyYCoordinates, keyWidths, keyHeights, keyCharCodes,
|
keyCount, keyXCoordinates, keyYCoordinates, keyWidths, keyHeights, keyCharCodes,
|
||||||
|
|
Loading…
Reference in a new issue