Fix popup mini keyboard for smiley and .com key
Change-Id: Idd156b14a4a259bc7dcaf498fbc8a121a069cbe9main
parent
9f01ed51d7
commit
4a734aa21e
|
@ -202,25 +202,27 @@ public class Key {
|
||||||
this.mX = x + mGap / 2;
|
this.mX = x + mGap / 2;
|
||||||
this.mY = y;
|
this.mY = y;
|
||||||
|
|
||||||
mPreviewIcon = style.getDrawable(a, R.styleable.Keyboard_Key_iconPreview);
|
|
||||||
Keyboard.setDefaultBounds(mPreviewIcon);
|
|
||||||
final CharSequence popupCharacters = style.getText(a,
|
final CharSequence popupCharacters = style.getText(a,
|
||||||
R.styleable.Keyboard_Key_popupCharacters);
|
R.styleable.Keyboard_Key_popupCharacters);
|
||||||
final int popupResId = style.getResourceId(a, R.styleable.Keyboard_Key_popupKeyboard, 0);
|
final int popupResId = style.getResourceId(a, R.styleable.Keyboard_Key_popupKeyboard, 0);
|
||||||
// Set popup keyboard resource and characters only when both are specified.
|
// We should not display mini keyboard when both popupResId and popupCharacters are
|
||||||
if (popupResId != 0 && !TextUtils.isEmpty(popupCharacters)) {
|
// specified but popupCharacters is empty string.
|
||||||
mPopupResId = popupResId;
|
if (popupResId != 0 && popupCharacters != null && popupCharacters.length() == 0) {
|
||||||
mPopupCharacters = popupCharacters;
|
|
||||||
} else {
|
|
||||||
mPopupResId = 0;
|
mPopupResId = 0;
|
||||||
mPopupCharacters = null;
|
mPopupCharacters = null;
|
||||||
|
} else {
|
||||||
|
mPopupResId = popupResId;
|
||||||
|
mPopupCharacters = popupCharacters;
|
||||||
}
|
}
|
||||||
|
|
||||||
mRepeatable = style.getBoolean(a, R.styleable.Keyboard_Key_isRepeatable, false);
|
mRepeatable = style.getBoolean(a, R.styleable.Keyboard_Key_isRepeatable, false);
|
||||||
mModifier = style.getBoolean(a, R.styleable.Keyboard_Key_isModifier, false);
|
mModifier = style.getBoolean(a, R.styleable.Keyboard_Key_isModifier, false);
|
||||||
mSticky = style.getBoolean(a, R.styleable.Keyboard_Key_isSticky, false);
|
mSticky = style.getBoolean(a, R.styleable.Keyboard_Key_isSticky, false);
|
||||||
mEdgeFlags = style.getFlag(a, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
|
mEdgeFlags = style.getFlag(a, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
|
||||||
| row.mRowEdgeFlags;
|
| row.mRowEdgeFlags;
|
||||||
|
|
||||||
|
mPreviewIcon = style.getDrawable(a, R.styleable.Keyboard_Key_iconPreview);
|
||||||
|
Keyboard.setDefaultBounds(mPreviewIcon);
|
||||||
mIcon = style.getDrawable(a, R.styleable.Keyboard_Key_keyIcon);
|
mIcon = style.getDrawable(a, R.styleable.Keyboard_Key_keyIcon);
|
||||||
Keyboard.setDefaultBounds(mIcon);
|
Keyboard.setDefaultBounds(mIcon);
|
||||||
mHintIcon = style.getDrawable(a, R.styleable.Keyboard_Key_keyHintIcon);
|
mHintIcon = style.getDrawable(a, R.styleable.Keyboard_Key_keyHintIcon);
|
||||||
|
|
Loading…
Reference in New Issue