Android的自定义键盘 [英] Android Custom keyboard

查看:487
本文介绍了Android的自定义键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个链接的创建自定义键盘 HTTP:// WWW .fampennings.nl /马腾/安卓/ 09keyboard / index.htm的,但我想有这么多的话这个键盘,上面的链接键盘看起来像follwing:

I creating custom keyboard using this link "http://www.fampennings.nl/maarten/android/09keyboard/index.htm" but i want to include so many word into this keyboard,above link keyboard looks like follwing :

我有三个XML文件:1)hexkbd:有一个到N 2)hexkbd2:M至Z 3)hexkbd3)额外的字,我展示一个XML文件,但是我想提出一个额外的按钮,这个键盘变化最重要的三个XML改变键盘为n M到Z,但我不知道如何做到这一点在这一习俗keyboard.for例如,在上面的图片,我把一些在其他XM文件,字母在另一个XML文档,以及其他在另一个文件中多余的话,我们把所有这些XML文件相同的一个按钮来改变所有这三个连续的,在第一次点击同一按钮,屏幕上只有数字键盘,第二次点击字母键盘的所有,我有什么做这个按钮,怎么样,任何一个请帮助我快?提前致谢。

i have three xml file : 1) hexkbd : have A to N 2) hexkbd2 : M to Z 3) hexkbd3) extra word, i display first xml file well, but i want to put one extra button into this keyboard to change above all three xml to change keyboard a to n to m to z, but i dont know how to do this in this custom keyboard.for example in above image i put number in another xm file,alphabet in another xml file, and other extra word in another file, we put same one button in all this xml file to change all three sequential,in first click on this same button display only number keyboard,second click alpha keyboard as all,what i have to do in this button and how, any one please help me quick ? thanks in advance.

我想以下类型:

i want following type :

推荐答案

我发现我自己的答案,简单 我只是像所有的XML文件,添加一个相同的按钮

I find my own answers,it simple i just to add one same button in all xml file like

在hexkbd:在关键的标签

in hexkbd : in key tag

        android:keyEdgeFlags="right"
        android:codes="35"
        android:isRepeatable="true"
        android:keyIcon="@drawable/img_change_key" 

在hexkbd2

        android:keyEdgeFlags="right"
        android:codes="38"
        android:isRepeatable="true"
        android:keyIcon="@drawable/img_change_key" 

在CustomKeyboard类KeyboardActionListener decalare:

and in CustomKeyboard class KeyboardActionListener decalare :

        public final static int ChangeKey1 = 35;
        public final static int ChangeKey2 = 38;

在CustomKeyboard类onKey()事件:

and in CustomKeyboard class onKey() event :

        ...else if (primaryCode == ChangeKey1) {

            mKeyboardView.setKeyboard(new Keyboard(mHostActivity,
                    R.xml.hexkbd2));

        } else if (primaryCode == ChangeKey2) {

            mKeyboardView.setKeyboard(new Keyboard(mHostActivity,
                    R.xml.hexkbd));

        }

做的,简单的,但我的困惑需要时间,我分享我的想法,以帮助其他persons.i认为这帮助他人。

done,it simple,but my confusion take time,i share my idea to help to other persons.i think this helpful to others.

这篇关于Android的自定义键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆