커스텀 키보드를 만드는 중입니다.
현재 전체 키보드가 같은 레이아웃으로 같은이미지 배경만 쓰고있는데 개별로 지정하는 방법을 알고 싶습니다..
keyboard.xml을 만들어서 전체 레이아웃을 잡고
<com.abc.minikeyboard.MiniKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:keyBackground="@drawable/change_image"
android:keyTextColor="#000"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:background="@mipmap/backgorund"
/>
Service에서 이런식으로 코드를넣어 만들었습니다.
@Override
public void onInitializeInterface(){
if(mEnglish != null){
int displayWidth = getMaxWidth();
if(displayWidth == mLastDisplayWidth) return;
mLastDisplayWidth = displayWidth;
}
mEnglish = new MiniKeyboard(this, R.xml.english);
mNumber = new MiniKeyboard(this, R.xml.number);
mSymbol = new MiniKeyboard(this, R.xml.symbol);
}
english.xml
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyHeight="10%p"
android:keyWidth="16.66%p"
android:keyBackground="@mipmap/ic_launcher"
>
<Row android:keyBackground="@mipmap/ic_launcher">
<Key android:codes="97" android:keyIcon="@drawable/change_image" android:keyEdgeFlags="left" />
<Key android:codes="98" android:keyLabel="b" />
<Key android:codes="99" android:keyLabel="c" android:horizontalGap = "5%p" />
<Key android:codes="100" android:keyLabel="d" />
<Key android:codes="101" android:keyLabel="e" />
<Key android:codes="103" android:keyLabel="g" android:keyEdgeFlags="right" />
</Row>
...
헌대 키보드마다 다른 키보드 배경을 넣고싶은데 방법을 찾기가 힘드네요
<Row> 안의 <key>에 배경을 줘도 들어가지않고
참조할 만한 사이트나 고수분들의 조언 부탁드립니다.