Keyboard XML supports switch-case-default tags to select rows and keys

Change-Id: I0d92e513757e765d9de98561205754af5a143650
main
Tadashi G. Takaoka 2010-11-11 15:28:14 -08:00
parent 8b00bc4f32
commit b0465116bd
44 changed files with 1375 additions and 2480 deletions

View File

@ -112,9 +112,6 @@
<attr name="keyIcon" format="reference" />
<!-- The hint icon to display on the key in conjunction with the label -->
<attr name="keyHintIcon" format="reference" />
<!-- Mode of the keyboard. If the mode doesn't match the
requested keyboard mode, the key will be skipped. -->
<attr name="keyboardMode" />
</declare-styleable>
<declare-styleable name="BaseKeyboard_Row">
@ -125,12 +122,15 @@
<!-- Row is anchored to the bottom of the keyboard. -->
<flag name="bottom" value="8" />
</attr>
<!-- Mode of the keyboard. If the mode doesn't match the
requested keyboard mode, the row will be skipped. -->
<attr name="keyboardMode" format="reference" />
</declare-styleable>
<declare-styleable name="BaseKeyboard_Include">
<attr name="keyboardLayout" format="reference" />
</declare-styleable>
<declare-styleable name="BaseKeyboard_Case">
<attr name="mode" format="string" />
<attr name="settingsKey" format="string" />
<attr name="voiceKey" format="string" />
</declare-styleable>
</resources>

View File

@ -25,85 +25,8 @@
latin:verticalGap="@dimen/key_bottom_gap"
latin:keyHeight="@dimen/key_height"
>
<!-- This row is intentionally not marked as a top row -->
<Row>
<include latin:keyboardLayout="@xml/kbd_qwerty_row1_common" />
</Row>
<!-- TODO: We should have new attributes for <Key> to eliminate these excess duplications -->
<Row
latin:keyboardMode="@+id/mode_normal"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row2_email" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_normal"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row3_email" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
</Row>
<!-- This row is intentionally not marked as a bottom row -->
<Row
latin:keyboardMode="@+id/mode_normal"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row4_url" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row4_email" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry"
>
<include latin:keyboardLayout="@xml/kbd_qwerty_row4_common" />
</Row>
<include latin:keyboardLayout="@xml/kbd_qwerty_row1" />
<include latin:keyboardLayout="@xml/kbd_qwerty_row2" />
<include latin:keyboardLayout="@xml/kbd_qwerty_row3" />
<include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
</Keyboard>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<!-- This row is intentionally not marked as a top row -->
<Row>
<Key
latin:codes="@integer/key_tab"
latin:keyLabel="Tab"
latin:keyWidth="7.0%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="q"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_q" />
<Key
latin:keyLabel="w"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_w" />
<Key
latin:keyLabel="e"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_e" />
<Key
latin:keyLabel="r"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_r" />
<Key
latin:keyLabel="t"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_t" />
<Key
latin:keyLabel="y"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_y" />
<Key
latin:keyLabel="u"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_u" />
<Key
latin:keyLabel="i"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_i" />
<Key
latin:keyLabel="o"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_o" />
<Key
latin:keyLabel="p"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_p" />
<Key
latin:codes="@integer/key_delete"
latin:keyIcon="@drawable/sym_keyboard_delete"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:keyWidth="11.0%p"
latin:isModifier="true"
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</Row>
</merge>

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_tab"
latin:keyLabel="Tab"
latin:keyWidth="7.0%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="q"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_q" />
<Key
latin:keyLabel="w"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_w" />
<Key
latin:keyLabel="e"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_e" />
<Key
latin:keyLabel="r"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_r" />
<Key
latin:keyLabel="t"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_t" />
<Key
latin:keyLabel="y"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_y" />
<Key
latin:keyLabel="u"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_u" />
<Key
latin:keyLabel="i"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_i" />
<Key
latin:keyLabel="o"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_o" />
<Key
latin:keyLabel="p"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_p" />
<Key
latin:codes="@integer/key_delete"
latin:keyIcon="@drawable/sym_keyboard_delete"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:keyWidth="11.0%p"
latin:isModifier="true"
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="9.7%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="a"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_a" />
<Key
latin:keyLabel="s"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_s" />
<Key
latin:keyLabel="d"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_d" />
<Key
latin:keyLabel="f" />
<Key
latin:keyLabel="g"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_g" />
<Key
latin:keyLabel="h" />
<Key
latin:keyLabel="j" />
<Key
latin:keyLabel="k" />
<Key
latin:keyLabel="l"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_l" />
<switch>
<case
latin:mode="email"
>
<Key
latin:keyLabel="\@" />
</case>
<default>
<Key
latin:keyLabel="\'"
latin:temporaryShiftKeyLabel="&quot;"
latin:keyHintIcon="@drawable/key_hint_quote_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="&quot;" />
</default>
</switch>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="8.3%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
</merge>

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="9.7%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="a"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_a" />
<Key
latin:keyLabel="s"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_s" />
<Key
latin:keyLabel="d"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_d" />
<Key
latin:keyLabel="f" />
<Key
latin:keyLabel="g"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_g" />
<Key
latin:keyLabel="h" />
<Key
latin:keyLabel="j" />
<Key
latin:keyLabel="k" />
<Key
latin:keyLabel="l"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_l" />
<Key
latin:keyLabel="\'"
latin:temporaryShiftKeyLabel="&quot;"
latin:keyHintIcon="@drawable/key_hint_quote_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="&quot;" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="8.3%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="9.7%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="a"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_a" />
<Key
latin:keyLabel="s"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_s" />
<Key
latin:keyLabel="d"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_d" />
<Key
latin:keyLabel="f" />
<Key
latin:keyLabel="g"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_g" />
<Key
latin:keyLabel="h" />
<Key
latin:keyLabel="j" />
<Key
latin:keyLabel="k" />
<Key
latin:keyLabel="l"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_l" />
<Key
latin:keyLabel="\@" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="8.3%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row>
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="z"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_z" />
<Key
latin:keyLabel="x" />
<Key
latin:keyLabel="c"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_c" />
<Key
latin:keyLabel="v"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_v" />
<Key
latin:keyLabel="b" />
<Key
latin:keyLabel="n"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_n" />
<Key
latin:keyLabel="m" />
<switch>
<case
latin:mode="email"
>
<Key
latin:keyLabel="," />
<Key
latin:keyLabel="." />
</case>
<default>
<Key
latin:keyLabel=","
latin:temporaryShiftKeyLabel="!"
latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="!" />
<Key
latin:keyLabel="."
latin:temporaryShiftKeyLabel="\?"
latin:keyHintIcon="@drawable/key_hint_question_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="\?" />
</default>
</switch>
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="right" />
</Row>
</merge>

View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="z"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_z" />
<Key
latin:keyLabel="x" />
<Key
latin:keyLabel="c"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_c" />
<Key
latin:keyLabel="v"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_v" />
<Key
latin:keyLabel="b" />
<Key
latin:keyLabel="n"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_n" />
<Key
latin:keyLabel="m" />
<Key
latin:keyLabel=","
latin:temporaryShiftKeyLabel="!"
latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="!" />
<Key
latin:keyLabel="."
latin:temporaryShiftKeyLabel="\?"
latin:keyHintIcon="@drawable/key_hint_question_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="\?" />
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="z"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_z" />
<Key
latin:keyLabel="x" />
<Key
latin:keyLabel="c"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_c" />
<Key
latin:keyLabel="v"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_v" />
<Key
latin:keyLabel="b" />
<Key
latin:keyLabel="n"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="@string/alternates_for_n" />
<Key
latin:keyLabel="m" />
<Key
latin:keyLabel="," />
<Key
latin:keyLabel="." />
<Key
latin:codes="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
latin:keyWidth="13.1%p"
latin:isModifier="true"
latin:isSticky="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<!-- This row is intentionally not marked as a bottom row -->
<Row>
<Spacer
latin:horizontalGap="15.1%p" />
<switch>
<case
latin:mode="email"
>
<Key
latin:keyLabel=".com"
latin:keyOutputText=".com"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_domains"
latin:keyWidth="16.4%p" />
</case>
<!-- TODO: implement logical OR for <case> attribute -->
<case
latin:mode="url"
>
<Key
latin:keyLabel=".com"
latin:keyOutputText=".com"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_domains"
latin:keyWidth="16.4%p" />
</case>
<default>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-)"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys" />
<Key
latin:keyLabel="="
latin:temporaryShiftKeyLabel="+"
latin:keyHintIcon="@drawable/key_hint_plus_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="&gt;" />
</default>
</switch>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="37.0%p"
latin:isModifier="true" />
<switch>
<case
latin:mode="email"
>
<Key
latin:keyLabel="_" />
<Key
latin:keyLabel="-" />
</case>
<default>
<Key
latin:keyLabel="-"
latin:temporaryShiftKeyLabel="/"
latin:keyHintIcon="@drawable/key_hint_slash_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="/" />
<Key
latin:keyLabel="_"
latin:temporaryShiftKeyLabel="\@"
latin:keyHintIcon="@drawable/key_hint_at_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="\@" />
</default>
</switch>
</Row>
</merge>

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Spacer
latin:horizontalGap="15.1%p" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-)"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys" />
<Key
latin:keyLabel="="
latin:temporaryShiftKeyLabel="+"
latin:keyHintIcon="@drawable/key_hint_plus_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="&gt;" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="37.0%p"
latin:isModifier="true" />
<Key
latin:keyLabel="-"
latin:temporaryShiftKeyLabel="/"
latin:keyHintIcon="@drawable/key_hint_slash_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="/" />
<Key
latin:keyLabel="_"
latin:temporaryShiftKeyLabel="\@"
latin:keyHintIcon="@drawable/key_hint_at_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="\@" />
</merge>

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Spacer
latin:horizontalGap="15.1%p" />
<Key
latin:keyLabel=".com"
latin:keyOutputText=".com"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_domains"
latin:keyWidth="16.4%p" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="37.0%p"
latin:isModifier="true" />
<Key
latin:keyLabel="_" />
<Key
latin:keyLabel="-" />
</merge>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Spacer
latin:horizontalGap="15.1%p" />
<Key
latin:keyLabel=".com"
latin:keyOutputText=".com"
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_domains"
latin:keyWidth="16.4%p" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="37.0%p"
latin:isModifier="true" />
<Key
latin:keyLabel="-"
latin:temporaryShiftKeyLabel="/"
latin:keyHintIcon="@drawable/key_hint_slash_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters="/" />
<Key
latin:keyLabel="_"
latin:temporaryShiftKeyLabel=":"
latin:keyHintIcon="@drawable/key_hint_colon_holo"
latin:popupKeyboard="@xml/kbd_popup_template"
latin:popupCharacters=":" />
</merge>

View File

@ -22,314 +22,141 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:keyboardMode="@+id/mode_normal"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="20%p" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:keyWidth="20%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_normal_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="15%p"
latin:keyEdgeFlags="right" />
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<switch>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="20%p" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:keyWidth="20%p" />
</case>
<default>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
</default>
</switch>
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<switch>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" />
</case>
<default>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
</default>
</switch>
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</case>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="15%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -22,371 +22,159 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:keyboardMode="@+id/mode_normal"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="20%p"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:keyWidth="20%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_normal_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_url_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_email_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_im_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_webentry_with_settings_key"
latin:keyWidth="10%p"
latin:rowEdgeFlags="bottom"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<switch>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="20%p"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:keyWidth="20%p"
latin:isModifier="true" />
</case>
<default>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
</default>
</switch>
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_symbol_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<switch>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:isModifier="true" />
</case>
<default>
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
</default>
</switch>
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<case
latin:mode="web"
>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -142,64 +142,5 @@
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_im" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_im_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_row4" />
</Keyboard>

View File

@ -141,64 +141,5 @@
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_im" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_im_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_black_row4" />
</Keyboard>

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:rowEdgeFlags="bottom"
>
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:codes="@integer/key_f1" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:rowEdgeFlags="bottom"
>
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_f1"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="."
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_punctuation"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -121,64 +121,5 @@
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_im" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_im_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
</Keyboard>

View File

@ -120,64 +120,5 @@
latin:isRepeatable="true"
latin:keyEdgeFlags="right" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_im" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_im_with_settings_key" />
</Row>
<Row
latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
latin:rowEdgeFlags="bottom"
>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4" />
</Keyboard>

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:rowEdgeFlags="bottom"
>
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="…" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="…" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="…" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="…" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p" />
<Key
latin:keyLabel="…" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
<Key
latin:keyLabel="„" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p" />
<Key
latin:keyLabel="…" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:rowEdgeFlags="bottom"
>
<switch>
<case
latin:settingsKey="false"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
<case
latin:settingsKey="true"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<switch>
<case
latin:mode="im"
>
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</case>
<default>
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</default>
</switch>
</case>
</switch>
</Row>
</merge>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="40%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="20%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Key
latin:codes="@integer/key_symbol"
latin:keyLabel="@string/label_alpha_key"
latin:keyWidth="15%p"
latin:isModifier="true"
latin:keyEdgeFlags="left" />
<Key
latin:codes="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:isModifier="true" />
<Key
latin:keyLabel="„"
latin:isModifier="true" />
<Key
latin:codes="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:keyWidth="30%p"
latin:isModifier="true" />
<Key
latin:keyLabel="…"
latin:isModifier="true" />
<Key
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyHintIcon="@drawable/hint_popup"
latin:popupKeyboard="@xml/popup_smileys"
latin:keyWidth="25%p"
latin:isModifier="true"
latin:keyEdgeFlags="right" />
</merge>

View File

@ -16,6 +16,8 @@
package com.android.inputmethod.latin;
import com.android.inputmethod.latin.KeyboardSwitcher.KeyboardId;
import org.xmlpull.v1.XmlPullParserException;
import android.content.Context;
@ -103,8 +105,7 @@ public class BaseKeyboard {
/** Height of the screen */
private final int mDisplayHeight;
/** Keyboard mode, or zero, if none. */
private final int mKeyboardMode;
protected final KeyboardId mId;
// Variables for pre-computing nearest keys.
@ -139,9 +140,6 @@ public class BaseKeyboard {
*/
public int rowEdgeFlags;
/** The keyboard mode for this row */
public int mode;
private final BaseKeyboard parent;
private Row(BaseKeyboard parent) {
@ -168,7 +166,6 @@ public class BaseKeyboard {
a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.BaseKeyboard_Row);
rowEdgeFlags = a.getInt(R.styleable.BaseKeyboard_Row_rowEdgeFlags, 0);
mode = a.getResourceId(R.styleable.BaseKeyboard_Row_keyboardMode, 0);
}
}
@ -456,19 +453,32 @@ public class BaseKeyboard {
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
*/
public BaseKeyboard(Context context, int xmlLayoutResId) {
this(context, xmlLayoutResId, 0);
this(context, xmlLayoutResId, null);
}
/**
* Creates a keyboard from the given xml key layout file. Weeds out rows
* that have a keyboard mode defined but don't match the specified mode.
* Creates a keyboard from the given keyboard identifier.
* @param context the application or service context
* @param id keyboard identifier
*/
public BaseKeyboard(Context context, KeyboardId id) {
this(context, id.getXmlId(), id);
}
/**
* Creates a keyboard from the given xml key layout file.
* @param context the application or service context
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
* @param modeId keyboard mode identifier
* @param width sets width of keyboard
* @param height sets height of keyboard
* @param id keyboard identifier
*/
public BaseKeyboard(Context context, int xmlLayoutResId, int modeId, int width, int height) {
private BaseKeyboard(Context context, int xmlLayoutResId, KeyboardId id) {
this(context, xmlLayoutResId, id,
context.getResources().getDisplayMetrics().widthPixels,
context.getResources().getDisplayMetrics().heightPixels);
}
private BaseKeyboard(Context context, int xmlLayoutResId, KeyboardId id, int width,
int height) {
Resources res = context.getResources();
GRID_WIDTH = res.getInteger(R.integer.config_keyboard_grid_width);
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
@ -481,23 +491,10 @@ public class BaseKeyboard {
setKeyWidth(mDisplayWidth / 10);
mDefaultVerticalGap = 0;
mDefaultHeight = mDefaultWidth;
mKeyboardMode = modeId;
mId = id;
loadKeyboard(context, xmlLayoutResId);
}
/**
* Creates a keyboard from the given xml key layout file. Weeds out rows
* that have a keyboard mode defined but don't match the specified mode.
* @param context the application or service context
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
* @param modeId keyboard mode identifier
*/
public BaseKeyboard(Context context, int xmlLayoutResId, int modeId) {
this(context, xmlLayoutResId, modeId,
context.getResources().getDisplayMetrics().widthPixels,
context.getResources().getDisplayMetrics().heightPixels);
}
/**
* <p>Creates a blank keyboard from the given resource file and populates it with the specified
* characters in left-to-right, top-to-bottom fashion, using the specified number of columns.
@ -608,10 +605,6 @@ public class BaseKeyboard {
return mDisplayWidth;
}
public int getKeyboardMode() {
return mKeyboardMode;
}
public boolean setShifted(boolean shiftState) {
for (final Key key : mShiftKeys) {
key.on = shiftState;

View File

@ -18,6 +18,7 @@ package com.android.inputmethod.latin;
import com.android.inputmethod.latin.BaseKeyboard.Key;
import com.android.inputmethod.latin.BaseKeyboard.Row;
import com.android.inputmethod.latin.KeyboardSwitcher.KeyboardId;
import org.xmlpull.v1.XmlPullParserException;
@ -52,7 +53,7 @@ import java.util.List;
* ...
* &gt;/Keyboard&lt;
* </pre>
* The xml file which is included in other file must have &gt;merge&lt; as root element, such as:
* The XML file which is included in other file must have &gt;merge&lt; as root element, such as:
* <pre>
* &gt;!-- xml/other_keys.xml --&lt;
* &gt;merge&lt;
@ -70,6 +71,38 @@ import java.util.List;
* ...
* &gt;/merge&lt;
* </pre>
* You can also use switch-case-default tags to select Rows and Keys.
* <pre>
* &gt;switch&lt;
* &gt;case case_attribute*&lt;
* &gt;!-- Any valid tags at switch position --&lt;
* &gt;/case&lt;
* ...
* &gt;default&lt;
* &gt;!-- Any valid tags at switch position --&lt;
* &gt;/default&lt;
* &gt;/switch&lt;
* </pre>
*
* TODO: These are some random ideas to improve this parser.
* - can specify keyWidth attribute by multiplication of default keyWidth
* for example: keyWidth="200%b" ("b" stands for "base")
* - can declare style and specify styles within tags.
* for example:
* &gt;switch&lt;
* &gt;case colorScheme="white"&lt;
* &gt;declare-style name="shift-key" parentStyle="modifier-key"&lt;
* &gt;item name="keyIcon"&lt;@drawable/sym_keyboard_shift"&gt;/item&lt;
* &gt;/declare-style&lt;
* &gt;/case&lt;
* &gt;case colorScheme="black"&lt;
* &gt;declare-style name="shift-key" parentStyle="modifier-key"&lt;
* &gt;item name="keyIcon"&lt;@drawable/sym_bkeyboard_shift"&gt;/item&lt;
* &gt;/declare-style&lt;
* &gt;/case&lt;
* &gt;/switch&lt;
* ...
* &gt;Key include-style="shift-key" ... /&lt;
*/
public class BaseKeyboardParser {
private static final String TAG = "BaseKeyboardParser";
@ -83,6 +116,17 @@ public class BaseKeyboardParser {
private static final String TAG_SPACER = "Spacer";
private static final String TAG_INCLUDE = "include";
private static final String TAG_MERGE = "merge";
private static final String TAG_SWITCH = "switch";
private static final String TAG_CASE = "case";
private static final String TAG_DEFAULT = "default";
// String representation of KeyboardSwitcher.MODE_xxx.
private static final String MODE_TEXT = "text";
private static final String MODE_URL = "url";
private static final String MODE_EMAIL = "email";
private static final String MODE_IM = "im";
private static final String MODE_WEB = "web";
private static final String MODE_PHONE = "phone";
private final BaseKeyboard mKeyboard;
private final Resources mResources;
@ -143,7 +187,7 @@ public class BaseKeyboardParser {
a.recycle();
}
private void parseKeyboardContent(XmlResourceParser parser, final List<Key> keys)
private void parseKeyboardContent(XmlResourceParser parser, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseKeyboardContent", keys == null);
int event;
@ -153,14 +197,13 @@ public class BaseKeyboardParser {
if (DEBUG_TAG) debugStartTag("parseKeyboardContent", tag, keys == null);
if (TAG_ROW.equals(tag)) {
Row row = mKeyboard.createRowFromXml(mResources, parser);
if (keys != null && maybeStartRow(row)) {
parseRowContent(parser, row, keys);
} else {
// Skip entire <Row></Row>
parseRowContent(parser, row, null);
}
if (keys != null)
startRow(row);
parseRowContent(parser, row, keys);
} else if (TAG_INCLUDE.equals(tag)) {
parseIncludeKeyboardContent(parser, keys);
} else if (TAG_SWITCH.equals(tag)) {
parseSwitchKeyboardContent(parser, keys);
} else {
throw new IllegalStartTag(parser, TAG_ROW);
}
@ -170,6 +213,8 @@ public class BaseKeyboardParser {
if (TAG_KEYBOARD.equals(tag)) {
endKeyboard(mKeyboard.getVerticalGap());
break;
} else if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag)) {
break;
} else if (TAG_MERGE.equals(tag)) {
break;
} else {
@ -194,6 +239,8 @@ public class BaseKeyboardParser {
parseSpacer(parser, keys);
} else if (TAG_INCLUDE.equals(tag)) {
parseIncludeRowContent(parser, row, keys);
} else if (TAG_SWITCH.equals(tag)) {
parseSwitchRowContent(parser, row, keys);
} else {
throw new IllegalStartTag(parser, TAG_KEY);
}
@ -204,6 +251,8 @@ public class BaseKeyboardParser {
if (keys != null)
endRow();
break;
} else if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag)) {
break;
} else if (TAG_MERGE.equals(tag)) {
break;
} else {
@ -237,7 +286,7 @@ public class BaseKeyboardParser {
} else {
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.BaseKeyboard);
int gap = getDimensionOrFraction(a, R.styleable.BaseKeyboard_horizontalGap,
final int gap = getDimensionOrFraction(a, R.styleable.BaseKeyboard_horizontalGap,
mKeyboard.getKeyboardWidth(), 0);
a.recycle();
checkEndTag(TAG_SPACER, parser);
@ -247,17 +296,20 @@ public class BaseKeyboardParser {
private void parseIncludeKeyboardContent(XmlResourceParser parser, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseIncludeKeyboardContent", keys == null);
parseIncludeInternal(parser, null, keys);
if (DEBUG_PARSER) debugLeaveMethod("parseIncludeKeyboardContent", keys == null);
}
private void parseIncludeRowContent(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseIncludeRowContent", keys == null);
parseIncludeInternal(parser, row, keys);
if (DEBUG_PARSER) debugLeaveMethod("parseIncludeRowContent", keys == null);
}
private void parseIncludeInternal(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseInclude", keys == null);
if (keys == null) {
checkEndTag(TAG_INCLUDE, parser);
} else {
@ -272,7 +324,6 @@ public class BaseKeyboardParser {
throw new ParseException("No keyboardLayout attribute in <include/>", parser);
parseMerge(mResources.getLayout(keyboardLayout), row, keys);
}
if (DEBUG_PARSER) debugLeaveMethod("parseInclude", keys == null);
}
private void parseMerge(XmlResourceParser parser, Row row, List<Key> keys)
@ -281,7 +332,7 @@ public class BaseKeyboardParser {
int event;
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
if (event == XmlResourceParser.START_TAG) {
String tag = parser.getName();
final String tag = parser.getName();
if (DEBUG_TAG) debugStartTag("parseMerge", tag, keys == null);
if (TAG_MERGE.equals(tag)) {
if (row == null) {
@ -299,6 +350,113 @@ public class BaseKeyboardParser {
if (DEBUG_PARSER) debugLeaveMethod("parseMerge", keys == null);
}
private void parseSwitchKeyboardContent(XmlResourceParser parser, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseSwitchKeyboardContent", keys == null);
parseSwitchInternal(parser, null, keys);
if (DEBUG_PARSER) debugLeaveMethod("parseSwitchKeyboardContent", keys == null);
}
private void parseSwitchRowContent(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseSwitchRowContent", keys == null);
parseSwitchInternal(parser, row, keys);
if (DEBUG_PARSER) debugLeaveMethod("parseSwitchRowContent", keys == null);
}
private void parseSwitchInternal(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
boolean selected = false;
int event;
if (DEBUG_TAG) Log.d(TAG, "parseSwitchInternal: id=" + mKeyboard.mId);
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
if (event == XmlResourceParser.START_TAG) {
final String tag = parser.getName();
if (DEBUG_TAG) debugStartTag("parseSwitchInternal", tag, keys == null);
if (TAG_CASE.equals(tag)) {
selected |= parseCase(parser, row, selected ? null : keys);
} else if (TAG_DEFAULT.equals(tag)) {
selected |= parseDefault(parser, row, selected ? null : keys);
} else {
throw new IllegalStartTag(parser, TAG_KEY);
}
} else if (event == XmlResourceParser.END_TAG) {
final String tag = parser.getName();
if (DEBUG_TAG) debugEndTag("parseRowContent", tag, keys == null);
if (TAG_SWITCH.equals(tag)) {
break;
} else {
throw new IllegalEndTag(parser, TAG_KEY);
}
}
}
}
private boolean parseCase(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseCase", keys == null);
final boolean selected = parseCaseCondition(parser);
if (row == null) {
// Processing Rows.
parseKeyboardContent(parser, selected ? keys : null);
} else {
// Processing Keys.
parseRowContent(parser, row, selected ? keys : null);
}
if (DEBUG_PARSER) debugLeaveMethod("parseCase", keys == null || !selected);
return selected;
}
private boolean parseCaseCondition(XmlResourceParser parser) {
final BaseKeyboard keyboard = mKeyboard;
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.BaseKeyboard_Case);
final String mode = a.getString(R.styleable.BaseKeyboard_Case_mode);
final String settingsKey = a.getString(R.styleable.BaseKeyboard_Case_settingsKey);
final String voiceKey = a.getString(R.styleable.BaseKeyboard_Case_voiceKey);
a.recycle();
final KeyboardId id = keyboard.mId;
if (id == null)
return true;
final boolean modeMatched = (mode == null
|| id.mMode == parseModeString(mode));
final boolean settingsKeyMatched = (settingsKey == null
|| id.mHasSettingsKey == Boolean.parseBoolean(settingsKey));
final boolean voiceKeyMatched = (voiceKey == null
|| id.mHasVoiceKey == Boolean.parseBoolean(voiceKey));
final boolean selected = modeMatched && settingsKeyMatched && voiceKeyMatched;
if (DEBUG_TAG) {
Log.d(TAG, "parseCaseCondition: " + Boolean.toString(selected).toUpperCase()
+ (mode != null ? " mode=" + mode : "")
+ (settingsKey != null ? " settingsKey="+settingsKey : "")
+ (voiceKey != null ? " voiceKey=" + voiceKey : ""));
}
return selected;
}
private static int parseModeString(String mode) {
if (mode.equals(MODE_TEXT)) return KeyboardSwitcher.MODE_TEXT;
if (mode.equals(MODE_URL)) return KeyboardSwitcher.MODE_URL;
if (mode.equals(MODE_EMAIL)) return KeyboardSwitcher.MODE_EMAIL;
if (mode.equals(MODE_IM)) return KeyboardSwitcher.MODE_IM;
if (mode.equals(MODE_WEB)) return KeyboardSwitcher.MODE_WEB;
if (mode.equals(MODE_PHONE)) return KeyboardSwitcher.MODE_PHONE;
throw new RuntimeException("uknown mode attribute in Keyboard XML: " + mode);
}
private boolean parseDefault(XmlResourceParser parser, Row row, List<Key> keys)
throws XmlPullParserException, IOException {
if (DEBUG_PARSER) debugEnterMethod("parseDefault", keys == null);
if (row == null) {
parseKeyboardContent(parser, keys);
} else {
parseRowContent(parser, row, keys);
}
if (DEBUG_PARSER) debugLeaveMethod("parseDefault", keys == null);
return true;
}
private static void checkEndTag(String tag, XmlResourceParser parser)
throws XmlPullParserException, IOException {
if (parser.next() == XmlResourceParser.END_TAG && tag.equals(parser.getName()))
@ -306,18 +464,9 @@ public class BaseKeyboardParser {
throw new NonEmptyTag(tag, parser);
}
// return true if the row is valid for this keyboard mode
private boolean maybeStartRow(Row row) {
if (DEBUG_TAG)
Log.d(TAG, String.format("startRow: mode=0x%08x keyboardMode=0x%08x",
row.mode, mKeyboard.getKeyboardMode()));
if (row.mode == 0 || row.mode == mKeyboard.getKeyboardMode()) {
mCurrentX = 0;
mCurrentRow = row;
return true;
} else {
return false;
}
private void startRow(Row row) {
mCurrentX = 0;
mCurrentRow = row;
}
private void endRow() {

View File

@ -40,76 +40,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
public static final int MODE_WEB = 4;
public static final int MODE_PHONE = 5;
// Main keyboard layouts without the settings key
private static final int KEYBOARDMODE_NORMAL = R.id.mode_normal;
private static final int KEYBOARDMODE_URL = R.id.mode_url;
private static final int KEYBOARDMODE_EMAIL = R.id.mode_email;
private static final int KEYBOARDMODE_IM = R.id.mode_im;
private static final int KEYBOARDMODE_WEB = R.id.mode_webentry;
private static final int[] QWERTY_MODES = {
KEYBOARDMODE_NORMAL,
KEYBOARDMODE_URL,
KEYBOARDMODE_EMAIL,
KEYBOARDMODE_IM,
KEYBOARDMODE_WEB,
0 /* for MODE_PHONE */ };
// Main keyboard layouts with the settings key
private static final int KEYBOARDMODE_NORMAL_WITH_SETTINGS_KEY =
R.id.mode_normal_with_settings_key;
private static final int KEYBOARDMODE_URL_WITH_SETTINGS_KEY =
R.id.mode_url_with_settings_key;
private static final int KEYBOARDMODE_EMAIL_WITH_SETTINGS_KEY =
R.id.mode_email_with_settings_key;
private static final int KEYBOARDMODE_IM_WITH_SETTINGS_KEY =
R.id.mode_im_with_settings_key;
private static final int KEYBOARDMODE_WEB_WITH_SETTINGS_KEY =
R.id.mode_webentry_with_settings_key;
private static final int[] QWERTY_WITH_SETTINGS_KEY_MODES = {
KEYBOARDMODE_NORMAL_WITH_SETTINGS_KEY,
KEYBOARDMODE_URL_WITH_SETTINGS_KEY,
KEYBOARDMODE_EMAIL_WITH_SETTINGS_KEY,
KEYBOARDMODE_IM_WITH_SETTINGS_KEY,
KEYBOARDMODE_WEB_WITH_SETTINGS_KEY,
0 /* for MODE_PHONE */ };
private static final int[][] QWERTY_KEYBOARD_MODES = {
QWERTY_MODES, QWERTY_WITH_SETTINGS_KEY_MODES
};
// Symbols keyboard layouts without the settings key
private static final int KEYBOARDMODE_SYMBOLS_NORMAL = R.id.mode_symbols_normal;
private static final int KEYBOARDMODE_SYMBOLS_URL = R.id.mode_symbols_url;
private static final int KEYBOARDMODE_SYMBOLS_EMAIL = R.id.mode_symbols_email;
private static final int KEYBOARDMODE_SYMBOLS_IM = R.id.mode_symbols_im;
private static final int KEYBOARDMODE_SYMBOLS_WEB = R.id.mode_symbols_webentry;
private static final int[] SYMBOLS_MODES = {
KEYBOARDMODE_SYMBOLS_NORMAL,
KEYBOARDMODE_SYMBOLS_URL,
KEYBOARDMODE_SYMBOLS_EMAIL,
KEYBOARDMODE_SYMBOLS_IM,
KEYBOARDMODE_SYMBOLS_WEB,
0 /* for MODE_PHONE */ };
// Symbols keyboard layouts with the settings key
private static final int KEYBOARDMODE_SYMBOLS_NORMAL_WITH_SETTINGS_KEY =
R.id.mode_symbols_normal_with_settings_key;
private static final int KEYBOARDMODE_SYMBOLS_URL_WITH_SETTINGS_KEY =
R.id.mode_symbols_url_with_settings_key;
private static final int KEYBOARDMODE_SYMBOLS_EMAIL_WITH_SETTINGS_KEY =
R.id.mode_symbols_email_with_settings_key;
private static final int KEYBOARDMODE_SYMBOLS_IM_WITH_SETTINGS_KEY =
R.id.mode_symbols_im_with_settings_key;
private static final int KEYBOARDMODE_SYMBOLS_WEB_WITH_SETTINGS_KEY =
R.id.mode_symbols_webentry_with_settings_key;
private static final int[] SYMBOLS_WITH_SETTINGS_KEY_MODES = {
KEYBOARDMODE_SYMBOLS_NORMAL_WITH_SETTINGS_KEY,
KEYBOARDMODE_SYMBOLS_URL_WITH_SETTINGS_KEY,
KEYBOARDMODE_SYMBOLS_EMAIL_WITH_SETTINGS_KEY,
KEYBOARDMODE_SYMBOLS_IM_WITH_SETTINGS_KEY,
KEYBOARDMODE_SYMBOLS_WEB_WITH_SETTINGS_KEY,
0 /* for MODE_PHONE */ };
private static final int[][] SYMBOLS_KEYBOARD_MODES = {
SYMBOLS_MODES, SYMBOLS_WITH_SETTINGS_KEY_MODES
};
public static final String DEFAULT_LAYOUT_ID = "4";
public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20100902";
private static final int[] THEMES = new int [] {
@ -121,14 +51,21 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private static final int CHAR_THEME_COLOR_BLACK = 1;
// Tables which contains resource ids for each character theme color
private static final int[] KBD_PHONE = new int[] {R.xml.kbd_phone, R.xml.kbd_phone_black};
private static final int[] KBD_PHONE = new int[] {
R.xml.kbd_phone, R.xml.kbd_phone_black
};
private static final int[] KBD_PHONE_SYMBOLS = new int[] {
R.xml.kbd_phone_symbols, R.xml.kbd_phone_symbols_black};
R.xml.kbd_phone_symbols, R.xml.kbd_phone_symbols_black
};
private static final int[] KBD_SYMBOLS = new int[] {
R.xml.kbd_symbols, R.xml.kbd_symbols_black};
R.xml.kbd_symbols, R.xml.kbd_symbols_black
};
private static final int[] KBD_SYMBOLS_SHIFT = new int[] {
R.xml.kbd_symbols_shift, R.xml.kbd_symbols_shift_black};
private static final int[] KBD_QWERTY = new int[] {R.xml.kbd_qwerty, R.xml.kbd_qwerty_black};
R.xml.kbd_symbols_shift, R.xml.kbd_symbols_shift_black
};
private static final int[] KBD_QWERTY = new int[] {
R.xml.kbd_qwerty, R.xml.kbd_qwerty_black
};
private static final int SYMBOLS_MODE_STATE_NONE = 0;
private static final int SYMBOLS_MODE_STATE_BEGIN = 1;
@ -184,9 +121,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
final boolean hasSettingsKey = mHasSettingsKey;
final boolean hasVoiceKey = mVoiceButtonEnabled && !mVoiceButtonOnPrimary;
final int imeOptions = mImeOptions;
mSymbolsId = new KeyboardId(locale, orientation, SYMBOLS_KEYBOARD_MODES, mode,
mSymbolsId = new KeyboardId(locale, orientation, mode,
KBD_SYMBOLS, colorScheme, hasSettingsKey, hasVoiceKey, imeOptions, true);
mSymbolsShiftedId = new KeyboardId(locale, orientation, SYMBOLS_KEYBOARD_MODES, mode,
mSymbolsShiftedId = new KeyboardId(locale, orientation, mode,
KBD_SYMBOLS_SHIFT, colorScheme, hasSettingsKey, hasVoiceKey, imeOptions, true);
}
@ -194,10 +131,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
* Represents the parameters necessary to construct a new LatinKeyboard,
* which also serve as a unique identifier for each keyboard type.
*/
private static class KeyboardId {
public static class KeyboardId {
public final Locale mLocale;
public final int mOrientation;
public final int[][] mKeyboardModes;
public final int mMode;
public final int[] mXmlArray;
public final int mColorScheme;
@ -208,12 +144,11 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private final int mHashCode;
public KeyboardId(Locale locale, int orientation, int[][] keyboardModes, int mode,
public KeyboardId(Locale locale, int orientation, int mode,
int[] xmlArray, int colorScheme, boolean hasSettingsKey, boolean hasVoiceKey,
int imeOptions, boolean enableShiftLock) {
this.mLocale = locale;
this.mOrientation = orientation;
this.mKeyboardModes = keyboardModes;
this.mMode = mode;
this.mXmlArray = xmlArray;
this.mColorScheme = colorScheme;
@ -225,7 +160,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
this.mHashCode = Arrays.hashCode(new Object[] {
locale,
orientation,
keyboardModes,
mode,
xmlArray,
colorScheme,
@ -236,6 +170,14 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
});
}
public int getXmlId() {
return mXmlArray[mColorScheme];
}
public boolean isAlphabetMode() {
return mXmlArray == KBD_QWERTY;
}
@Override
public boolean equals(Object other) {
return other instanceof KeyboardId && equals((KeyboardId) other);
@ -244,7 +186,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private boolean equals(KeyboardId other) {
return other.mLocale.equals(this.mLocale)
&& other.mOrientation == this.mOrientation
&& other.mKeyboardModes == this.mKeyboardModes
&& other.mMode == this.mMode
&& other.mXmlArray == this.mXmlArray
&& other.mColorScheme == this.mColorScheme
@ -261,33 +202,26 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
@Override
public String toString() {
if (DEBUG) {
return String.format("[%s %s %6s %5s imeOptions=0x%08x xml=0x%08x %s%s%s%s]",
mLocale,
(mOrientation == 1 ? "port" : "land"),
(mKeyboardModes == QWERTY_KEYBOARD_MODES ? "alpha" : "symbol"),
modeName(mMode),
mImeOptions,
mXmlArray[0],
(mColorScheme == CHAR_THEME_COLOR_WHITE ? "white" : "black"),
(mHasSettingsKey ? " hasSettingsKey" : ""),
(mHasVoiceKey ? " hasVoiceKey" : ""),
(mEnableShiftLock ? " enableShiftLock" : ""));
} else {
return super.toString();
}
return String.format("[%s %s %5s imeOptions=0x%08x xml=0x%08x %s%s%s%s]",
mLocale,
(mOrientation == 1 ? "port" : "land"),
modeName(mMode),
mImeOptions,
mXmlArray[0],
(mColorScheme == CHAR_THEME_COLOR_WHITE ? "white" : "black"),
(mHasSettingsKey ? " hasSettingsKey" : ""),
(mHasVoiceKey ? " hasVoiceKey" : ""),
(mEnableShiftLock ? " enableShiftLock" : ""));
}
private static String modeName(int mode) {
if (DEBUG) {
switch (mode) {
case MODE_TEXT: return "text";
case MODE_URL: return "url";
case MODE_EMAIL: return "email";
case MODE_IM: return "im";
case MODE_WEB: return "web";
case MODE_PHONE: return "phone";
}
switch (mode) {
case MODE_TEXT: return "text";
case MODE_URL: return "url";
case MODE_EMAIL: return "email";
case MODE_IM: return "im";
case MODE_WEB: return "web";
case MODE_PHONE: return "phone";
}
return null;
}
@ -304,6 +238,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
loadKeyboardInternal(mode, imeOptions, voiceButtonEnabled, voiceButtonOnPrimary,
false);
} catch (RuntimeException e) {
Log.w(TAG, e);
LatinImeLogger.logOnException(mode + "," + imeOptions, e);
}
}
@ -345,10 +280,8 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
conf.locale = mLanguageSwitcher.getInputLocale();
res.updateConfiguration(conf, null);
final int keyboardMode = id.mKeyboardModes[id.mHasSettingsKey ? 1 : 0][id.mMode];
final int xml = id.mXmlArray[id.mColorScheme];
keyboard = new LatinKeyboard(mInputMethodService, xml, keyboardMode, id.mColorScheme,
id.mHasSettingsKey, id.mHasVoiceKey, id.mImeOptions);
final int xml = id.getXmlId();
keyboard = new LatinKeyboard(mInputMethodService, id);
keyboard.setVoiceMode(
hasVoiceKey(xml == R.xml.kbd_symbols || xml == R.xml.kbd_symbols_black),
mVoiceButtonEnabled);
@ -383,20 +316,17 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
final int charColorId = getCharColorId();
final int[] xmlArray;
final boolean enableShiftLock;
final int[][] keyboardModes;
if (isSymbols) {
keyboardModes = SYMBOLS_KEYBOARD_MODES;
xmlArray = mode == MODE_PHONE ? KBD_PHONE_SYMBOLS : KBD_SYMBOLS;
enableShiftLock = false;
} else { // QWERTY
keyboardModes = QWERTY_KEYBOARD_MODES;
xmlArray = mode == MODE_PHONE ? KBD_PHONE : KBD_QWERTY;
enableShiftLock = mode == MODE_PHONE ? false : true;
}
final int orientation = mInputMethodService.getResources().getConfiguration().orientation;
final Locale locale = mLanguageSwitcher.getInputLocale();
return new KeyboardId(locale, orientation, keyboardModes, mode, xmlArray,
return new KeyboardId(locale, orientation, mode, xmlArray,
charColorId, mHasSettingsKey, hasVoiceKey, imeOptions, enableShiftLock);
}
@ -405,7 +335,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
public boolean isAlphabetMode() {
return mCurrentId != null && mCurrentId.mKeyboardModes == QWERTY_KEYBOARD_MODES;
return mCurrentId != null && mCurrentId.isAlphabetMode();
}
public void setShifted(boolean shifted) {

View File

@ -70,7 +70,7 @@ public class LatinKeyboard extends BaseKeyboard {
private LanguageSwitcher mLanguageSwitcher;
private final Resources mRes;
private final Context mContext;
private int mMode; // TODO: remove this and use the corresponding mode in the parent class
private int mMode; // TODO: remove this and use the corresponding mode in the parent class
// Whether this keyboard has voice icon on it
private boolean mHasVoiceButton;
// Whether voice icon is enabled at all
@ -113,14 +113,12 @@ public class LatinKeyboard extends BaseKeyboard {
private static int sSpacebarVerticalCorrection;
public LatinKeyboard(Context context, int xmlLayoutResId, int mode, int colorScheme,
boolean hasSettingsKey, boolean hasVoiceKey, int imeOptions) {
// TODO: to be used: colorScheme, hasSettingsKey, hasVoiceKey, imeOptions.
super(context, xmlLayoutResId, mode);
public LatinKeyboard(Context context, KeyboardSwitcher.KeyboardId id) {
super(context, id);
final Resources res = context.getResources();
mContext = context;
mRes = res;
mMode = mode;
mMode = id.mMode;
mShiftLockIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
mShiftLockPreviewIcon = res.getDrawable(R.drawable.sym_keyboard_feedback_shift_locked);
setDefaultBounds(mShiftLockPreviewIcon);
@ -138,6 +136,7 @@ public class LatinKeyboard extends BaseKeyboard {
setDefaultBounds(m123MicPreviewIcon);
sSpacebarVerticalCorrection = res.getDimensionPixelOffset(
R.dimen.spacebar_vertical_correction);
final int xmlLayoutResId = id.getXmlId();
mIsAlphaKeyboard = xmlLayoutResId == R.xml.kbd_qwerty
|| xmlLayoutResId == R.xml.kbd_qwerty_black;
mSpaceKeyIndex = indexOf(LatinIME.KEYCODE_SPACE);