Android Custom keyboard

后端 未结 1 1766
情深已故
情深已故 2021-01-15 19:13

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 k

相关标签:
1条回答
  • 2021-01-15 20:07

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

    in hexkbd : in key tag

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

    in hexkbd2

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

    and in CustomKeyboard class KeyboardActionListener decalare :

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

    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));
    
            }
    

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

    0 讨论(0)
提交回复
热议问题