[
DESCRIPTION]Current status: 使用android 自带输入法,切换到西班牙语,进入编辑短信息界面,弹出键盘输入框,空格按键上显示当前的语言(Espanol)我司希望改变空格按键的显示,不显示当前语言,而是显示空格.
[SOLUTION]
JB版本修改方式:
1:修改MainKeyboardView.java (alps\packages\inputmethods\latinime\java\src\com\android\inputmethod\keyboard)
中drawSpacebar函数,将绘制语言text的部分注释掉.
//canvas.drawText(language, width / 2, baseline - descent - 1, paint);
paint.setColor(mSpacebarTextColor);
paint.setAlpha(mLanguageOnSpacebarAnimAlpha);
//canvas.drawText(language, width / 2, baseline - descent, paint);
2:修改
Key_styles_common.xml
(alps\packages\inputmethods\latinime\java\res\xml)
中spaceKeyStyle的实现为
<key-style
latin:styleName="spaceKeyStyle"
latin:keyIcon="!icon/space_key"
latin:code="!code/key_space"
latin:keyActionFlags="noKeyPreview|enableLongPress" />
3:修改Keyboard-icons-ics.xml (alps\packages\inputmethods\latinime\java\res\values)中 iconSpaceKey的实现为
<item name="iconSpaceKey">@drawable/sym_keyboard_space_holo</item>
重新编译LatinIME后并push到手机替换验证.L版本和M版本修改方式:
1:修改MainKeyboardView.java (alps\packages\inputmethods\latinime\java\src\com\android\inputmethod\keyboard)
中函数drawLanguageOnSpacebar函数, 将绘制语言text的部分注释掉。
paint.setColor(mLanguageOnSpacebarTextColor);
paint.setAlpha(mLanguageOnSpacebarAnimAlpha);
//canvas.drawText(language, width / 2, baseline - descent, paint);
paint.clearShadowLayer();
paint.setTextScaleX(1.0f);
2、重新编译LatinIME后并push到手机替换验证.
转载于:https://blog.51cto.com/132588761/1966913