Making a Virtual Keyboard scrollable in android -


i've created ims(inputmangerservice) virtual keyboard , want make scroll-able, google emoji keyboard.

it possible using candidate views @ least, , google have pulled off own emoji keyboard.

but have no idea how it. ideas?

edit 1: further testing , research has yielded no results. in fact, example of scrollable keyboards can find google's own candidate view , 1 example made using dialog view in activity rather softkeyboard.

so new question is: possible create scrollable virtual keyboard?

i found solution:

you need create virtual keyboard no buttons or rows, set keyboard's candidate view new scrollview, show candidate view. there can add views scrollview programically create keyboard want.

public class mykeyboardservice extends inputmethodservice implements keyboardview.onkeyboardactionlistener {     private keyboardview viewofkeyboard;     private keyboard thekeyboardlayout;     private horizontalscrollview scrollingkeyboard;       @override     public view oncreateinputview()     {        viewofkeyboard =  keyboardview)getlayoutinflater().inflate(r.layout.keyboard1, null);        thekeyboardlayout = new keyboard(this, r.xml.keyboardlayout);        //keyboardlayout.xml contains no rows or keys.        viewofkeyboard.setkeyboard(thekeyboardlayout);          setcandidatesviewshown(true);        //sets candidate view shown.        return viewofkeyboard;     }      public view oncreatecandidatesview()     {        scrollingkeyboard = new horizontalscrollview(this);        scrollingkeyboard.addview(new button(this));        return scrollingkeyboard;     } } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -