2ND ROW OF KEYBOARD COLOUR CHANGE

648 Views Asked by At

I would like to make my keyboard like this

enter image description here

these are my xml for keyboard

Input.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout      xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

   <com.keyboard.KeyboardView
    android:id="@+id/keyboard"
    android:keyPreviewLayout="@layout/preview_layout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:focusable="true"
    android:focusableInTouchMode="true"

    />

</LinearLayout>

Qwerty.xml

<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
   android:horizontalGap="0px"
   android:keyHeight="@dimen/key_height"
   android:keyWidth="20%p"
   android:verticalGap="0px" >

<Row>
    <Key
        android:codes="113"
        android:keyEdgeFlags="left"
        android:keyLabel="q"
        android:keyWidth="10%p"/>
    <Key
        android:codes="119"
        android:keyLabel="w"
        android:keyWidth="10%p"/>
    <Key
        android:codes="101"
        android:keyLabel="e"
        android:keyWidth="10%p"/>
    <Key
        android:codes="114"
        android:keyLabel="r"
        android:keyWidth="10%p"/>
    <Key
        android:codes="116"
        android:keyLabel="t"
        android:keyWidth="10%p"/>
    <Key
        android:codes="121"
        android:keyLabel="y"
        android:keyWidth="10%p"/>
    <Key
        android:codes="117"
        android:keyLabel="u"
        android:keyWidth="10%p"/>
    <Key
        android:codes="105"
        android:keyLabel="i"
        android:keyWidth="10%p"/>
    <Key
        android:codes="111"
        android:keyLabel="o"
        android:keyWidth="10%p"/>
    <Key
        android:codes="112"
        android:keyEdgeFlags="right"
        android:keyLabel="p"
        android:keyWidth="10%p"/>
</Row>
<Row>
    <Key
        android:codes="97"
        android:keyEdgeFlags="left"
        android:keyLabel="a"
        android:keyWidth="10%p"/>
    <Key
        android:codes="115"
        android:keyLabel="s"
        android:keyWidth="10%p"/>
    <Key
        android:codes="100"
        android:keyLabel="d"
        android:keyWidth="10%p"/>
    <Key
        android:codes="102"
        android:keyLabel="f"
        android:keyWidth="10%p"/>
    <Key
        android:codes="103"
        android:keyLabel="g"
        android:keyWidth="10%p"/>
    <Key
        android:codes="104"
        android:keyLabel="h"
        android:keyWidth="10%p"/>
    <Key
        android:codes="106"
        android:keyLabel="j"
        android:keyWidth="10%p"/>
    <Key
        android:codes="107"
        android:keyLabel="k"
        android:keyWidth="10%p"/>
    <Key
        android:codes="108"
        android:keyLabel="l"
        android:keyWidth="10%p"/>
    <Key
        android:codes="-25"
        android:keyIcon="@drawable/on_roman"
        android:keyEdgeFlags="right"
        android:isModifier="true"
        android:keyWidth="10%p">
    </Key>
</Row>
<Row>
    <Key
        android:codes="-1"
        android:isModifier="true"
        android:isSticky="true"
        android:keyEdgeFlags="left"
        android:keyIcon="@drawable/sym_keyboard_shift"
        android:keyWidth="15%p" />
    <Key
        android:codes="122"
        android:keyLabel="z"
        android:keyWidth="10%p"/>
    <Key
        android:codes="120"
        android:keyLabel="x"
        android:keyWidth="10%p"/>
    <Key
        android:codes="99"
        android:keyLabel="c"
        android:keyWidth="10%p" />
    <Key
        android:codes="118"
        android:keyLabel="v"
        android:keyWidth="10%p" />
    <Key
        android:codes="98"
        android:keyLabel="b"
        android:keyWidth="10%p"/>
    <Key
        android:codes="110"
        android:keyLabel="n"
        android:keyWidth="10%p"/>
    <Key
        android:codes="109"
        android:keyLabel="m"
        android:keyWidth="10%p"/>
    <Key
        android:codes="-5"
        android:isRepeatable="true"
        android:keyEdgeFlags="right"
        android:keyIcon="@drawable/sym_keyboard_delete"
        android:keyWidth="15%p" />
</Row>
<Row android:rowEdgeFlags="bottom" >
    <Key
        android:codes="-2"
        android:keyEdgeFlags="left"
        android:keyLabel="123"
        android:keyWidth="12%p" />

    <Key
        android:codes="-7"
        android:keyWidth="12%p"
        />
    <Key
        android:codes="32"
        android:isRepeatable="true"
        android:keyWidth="51%p"

        />
    <Key
        android:codes="46"
        android:keyLabel="۔"
        android:keyWidth="10%p" />

    <Key
        android:codes="10"
        android:keyEdgeFlags="right"
        android:keyIcon="@drawable/sym_keyboard_return"
        android:keyWidth="15%p" />
</Row>

</Keyboard>

so please help me that how can I change the background color of the row ? but I m implementing this xml so its just making black color keyboard, so please help me out and I have added background color in input view but its changing the background color of the keyboard but its not changing the color of the row.

1

There are 1 best solutions below

0
On

use android:backgroundTint="@color/your color code here" in your keyboardview like :

 <android.inputmethodservice.KeyboardView
        android:id="@+id/keyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:keyBackground="@color/your color code here"
       android:backgroundTint="@color/your color code here"
        android:keyTextColor="@color/white"
        android:scrollbars="horizontal" />

hope it will help you. Happy coding!!