修改Android 自带输入法(LatinIME)空格键的显示
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
Current status] 使用android 自带输入法,切换到西班牙语,进入编辑短信息界面,弹出键盘输入框,空格按键上显
示当前的语言(Espanol)
我司希望改变空格按键的显示,不显示当前语言,而是显示空格.
[SOLUTION]
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到手机替换验证.
Current status] 使用android 自带输入法,切换到西班牙语,进入编辑短信息界面,弹出键盘输入框,空格按键上显
示当前的语言(Espanol)
我司希望改变空格按键的显示,不显示当前语言,而是显示空格.
[SOLUTION]
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到手机替换验证.