1

Hello I am working on Custom KEYBOARD for my app.

i.e

<Keyboard
         android:keyWidth="%10p"
         android:keyHeight="50px"
         android:horizontalGap="2px"
         android:verticalGap="2px" >
     <Row android:keyWidth="32px" >
         <Key android:keyLabel="A" />
         ...
     </Row>
     ...
 </Keyboard>

I want to know is there any method or android tag available for set invisible or visible the keyboard board key.

like android:visibility="gone" or setVisibility(View.GONE) for Keyboard layout.

Cause in my app there are many variation in Keyboard.

any information regarding this.

ASP
  • 3,645
  • 1
  • 31
  • 45
Monty
  • 3,205
  • 8
  • 36
  • 61
  • ya its good link..i ll give it try. thanks .but i don't know i ll get my requirement or not. but thanks again. – Monty Jun 21 '13 at 10:59
  • Absolutely it is possible to make like this. you must to modified your LatinKeyboard behavior of that key which one you want to visibility mode. – Avanish Singh Oct 12 '15 at 06:11

1 Answers1

0

It is possible to hide a key by changing the width of a key.

The following is an example of hiding language-switch key:

void setLanguageSwitchKeyVisibility(boolean visible) {
    if (visible) {
        // The language switch key should be visible. Restore the size of the mode change key
        // and language switch key using the saved layout.
        mModeChangeKey.width = mSavedModeChangeKey.width;
        mModeChangeKey.x = mSavedModeChangeKey.x;
        mLanguageSwitchKey.width = mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.icon = mSavedLanguageSwitchKey.icon;
        mLanguageSwitchKey.iconPreview = mSavedLanguageSwitchKey.iconPreview;
    } else {
        // The language switch key should be hidden. Change the width of the mode change key
        // to fill the space of the language key so that the user will not see any strange gap.
        mModeChangeKey.width = mSavedModeChangeKey.width + mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.width = 0;
        mLanguageSwitchKey.icon = null;
        mLanguageSwitchKey.iconPreview = null;
    }
}

Edit LatinKeyboard to hide a key.

Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110