xml - how to make custom key in soft keyboard in android -


i trying develope custome soft keyboard in android, want change color of outptut text of key when press on th key, idea make class extends key code:

public class k extends key{     private paint mtextpaint;      public k(resources arg0, row arg1, int arg2, int arg3,xmlresourceparser arg4) {         super(arg0, arg1, arg2, arg3, arg4);         initlabelview();         attributeset attributes = xml.asattributeset(arg4);         typedarray =arg0.obtainattributes(attributes, r.styleable.labelview);         settextcolor(a.getcolor(r.styleable.labelview_textcolor, 0xff000000));          a.recycle();          initlabelview();     }   private final void initlabelview() {         mtextpaint = new paint();         mtextpaint.setantialias(true);         mtextpaint.settextsize(16);         mtextpaint.setcolor(0xff000000);        } public void settextcolor(int color) {     mtextpaint.setcolor(color);  }      } 

and set attrs xml file in value folder (like custom view)

and in xml folder i made xml file keyboard consist row , keys code:

<keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keywidth="14.28%p"              xmlns:app="http://schemas.android.com/apk/res/com.szlosek.keying"     android:horizontalgap="0px" android:verticalgap="0px" android:keyheight="@dimen/key_height">      <row>           <key android:codes="121"             android:textcolor="#26e80c"              android:keylabel="d"/>          <com.szlosek.keying.k              android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:codes="117"              app:textcolor="#26e80c"             android:keylabel="u"  />   -->     </row>   </keyboard> 

my problem key customed (that has lable u) not appear in keyboard , and other appear( has labled) please 1 me , edit on code thanks


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -