Swap parenthesis-like character code on RTL keyboard
Bug: 5047217 Change-Id: I1b88484825f5c035401cf083522bf95bbee30edbmain
parent
bdf3789811
commit
7139335dcd
|
@ -150,6 +150,8 @@
|
|||
<attr name="popupKeyboardTemplate" format="reference" />
|
||||
<!-- Locale of the keyboard layout -->
|
||||
<attr name="keyboardLocale" format="string" />
|
||||
<!-- True if the keyboard is Right-To-Left -->
|
||||
<attr name="isRtlKeyboard" format="boolean" />
|
||||
<!-- Icon set for key top and key preview. -->
|
||||
<attr name="iconShiftKey" format="reference" />
|
||||
<attr name="iconToSymbolKey" format="reference" />
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:isRtlKeyboard="true"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols" />
|
||||
</Keyboard>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:isRtlKeyboard="true"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols_shift" />
|
||||
</Keyboard>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:isRtlKeyboard="true"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols" />
|
||||
</Keyboard>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:isRtlKeyboard="true"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols_shift" />
|
||||
</Keyboard>
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
<merge
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<include
|
||||
|
@ -170,4 +170,4 @@
|
|||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_f2" />
|
||||
</Row>
|
||||
</Keyboard>
|
||||
</merge>
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
<merge
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<include
|
||||
|
@ -147,4 +147,4 @@
|
|||
<include
|
||||
latin:keyboardLayout="@xml/kbd_qwerty_f2" />
|
||||
</Row>
|
||||
</Keyboard>
|
||||
</merge>
|
|
@ -2,7 +2,7 @@
|
|||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2010, The Android Open Source Project
|
||||
** Copyright 2011, 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.
|
||||
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
<merge
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<include
|
||||
|
@ -189,4 +189,4 @@
|
|||
</case>
|
||||
</switch>
|
||||
</Row>
|
||||
</Keyboard>
|
||||
</merge>
|
|
@ -2,7 +2,7 @@
|
|||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2010, The Android Open Source Project
|
||||
** Copyright 2011, 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.
|
||||
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
<merge
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<include
|
||||
|
@ -164,4 +164,4 @@
|
|||
</case>
|
||||
</switch>
|
||||
</Row>
|
||||
</Keyboard>
|
||||
</merge>
|
|
@ -0,0 +1,130 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, 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"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_currency_key_styles" />
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_1"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_1" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_2"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_2" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_3"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_3" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_4"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_4" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_5"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_5" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_6"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_6" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_7"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_7" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_8"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_8" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_9"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_9" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_0"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_0"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel="\@" />
|
||||
<Key
|
||||
latin:keyLabel="\#" />
|
||||
<Key
|
||||
latin:keyStyle="currencyKeyStyle" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_percent"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_percent" />
|
||||
<Key
|
||||
latin:keyLabel="&" />
|
||||
<Key
|
||||
latin:keyLabel="*"
|
||||
latin:popupCharacters="†,‡,★" />
|
||||
<Key
|
||||
latin:keyLabel="-"
|
||||
latin:popupCharacters="_,–,—" />
|
||||
<Key
|
||||
latin:keyLabel="+"
|
||||
latin:popupCharacters="±" />
|
||||
<Key
|
||||
latin:keyLabel="("
|
||||
latin:popupCharacters="[,{,<" />
|
||||
<Key
|
||||
latin:keyLabel=")"
|
||||
latin:popupCharacters="],},>"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="altKeyStyle"
|
||||
latin:keyWidth="15%p"
|
||||
latin:visualInsetsRight="1%p" />
|
||||
<Key
|
||||
latin:keyLabel="!"
|
||||
latin:popupCharacters="¡" />
|
||||
<!-- Note: DroidSans doesn't have double-high-reversed-quotation '\u201f' glyph. -->
|
||||
<!-- latin:popupCharacters="“,”,„,‟,«,»" -->
|
||||
<Key
|
||||
latin:keyLabel="""
|
||||
latin:popupCharacters="“,”,«,»"
|
||||
latin:maxPopupKeyboardColumn="6" />
|
||||
<Key
|
||||
latin:keyLabel="\'"
|
||||
latin:popupCharacters="‘,’,‚,‛" />
|
||||
<Key
|
||||
latin:keyLabel=":" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_semicolon"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_semicolon" />
|
||||
<Key
|
||||
latin:keyLabel="/" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_question"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_question" />
|
||||
<Key
|
||||
latin:keyStyle="deleteKeyStyle"
|
||||
latin:keyWidth="fillRight"
|
||||
latin:visualInsetsLeft="1%p" />
|
||||
</Row>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_symbols_row4" />
|
||||
</merge>
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2008, 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"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel="~" />
|
||||
<Key
|
||||
latin:keyLabel="`" />
|
||||
<Key
|
||||
latin:keyLabel="|" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="•"
|
||||
latin:popupCharacters="♪,♥,♠,♦,♣" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="√" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="π"
|
||||
latin:popupCharacters="Π" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="÷" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="×" />
|
||||
<Key
|
||||
latin:keyLabel="{" />
|
||||
<Key
|
||||
latin:keyLabel="}"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="nonSpecialBackgroundTabKeyStyle" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="¢" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="€" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="°"
|
||||
latin:popupCharacters="′,″" />
|
||||
<Key
|
||||
latin:keyLabel="^"
|
||||
latin:popupCharacters="↑,↓,←,→" />
|
||||
<Key
|
||||
latin:keyLabel="_" />
|
||||
<Key
|
||||
latin:keyLabel="="
|
||||
latin:popupCharacters="≠,≈,∞" />
|
||||
<Key
|
||||
latin:keyLabel="[" />
|
||||
<Key
|
||||
latin:keyLabel="]"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="altKeyStyle"
|
||||
latin:keyWidth="15%p"
|
||||
latin:visualInsetsRight="1%p" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="™" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="®" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="©" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="¶"
|
||||
latin:popupCharacters="§" />
|
||||
<Key
|
||||
latin:keyLabel="\\" />
|
||||
<Key
|
||||
latin:keyLabel="<"
|
||||
latin:popupCharacters="≤,«,‹" />
|
||||
<Key
|
||||
latin:keyLabel=">"
|
||||
latin:popupCharacters="≥,»,›" />
|
||||
<Key
|
||||
latin:keyStyle="deleteKeyStyle"
|
||||
latin:keyWidth="fillRight"
|
||||
latin:visualInsetsLeft="1%p" />
|
||||
</Row>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
|
||||
</merge>
|
|
@ -1,125 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
/*
|
||||
**
|
||||
** Copyright 2008, 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
|
||||
** 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
|
||||
** 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
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_currency_key_styles" />
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_1"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_1" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_2"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_2" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_3"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_3" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_4"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_4" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_5"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_5" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_6"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_6" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_7"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_7" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_8"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_8" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_9"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_9" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_0"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_0"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyLabel="\@" />
|
||||
<Key
|
||||
latin:keyLabel="\#" />
|
||||
<Key
|
||||
latin:keyStyle="currencyKeyStyle" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_percent"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_percent" />
|
||||
<Key
|
||||
latin:keyLabel="&" />
|
||||
<Key
|
||||
latin:keyLabel="*"
|
||||
latin:popupCharacters="†,‡,★" />
|
||||
<Key
|
||||
latin:keyLabel="-"
|
||||
latin:popupCharacters="_,–,—" />
|
||||
<Key
|
||||
latin:keyLabel="+"
|
||||
latin:popupCharacters="±" />
|
||||
<Key
|
||||
latin:keyLabel="("
|
||||
latin:popupCharacters="[,{,<" />
|
||||
<Key
|
||||
latin:keyLabel=")"
|
||||
latin:popupCharacters="],},>"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyStyle="altKeyStyle"
|
||||
latin:keyWidth="15%p"
|
||||
latin:visualInsetsRight="1%p" />
|
||||
<Key
|
||||
latin:keyLabel="!"
|
||||
latin:popupCharacters="¡" />
|
||||
<!-- Note: DroidSans doesn't have double-high-reversed-quotation '\u201f' glyph. -->
|
||||
<!-- latin:popupCharacters="“,”,„,‟,«,»" -->
|
||||
<Key
|
||||
latin:keyLabel="""
|
||||
latin:popupCharacters="“,”,«,»"
|
||||
latin:maxPopupKeyboardColumn="6" />
|
||||
<Key
|
||||
latin:keyLabel="\'"
|
||||
latin:popupCharacters="‘,’,‚,‛" />
|
||||
<Key
|
||||
latin:keyLabel=":" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_semicolon"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_semicolon" />
|
||||
<Key
|
||||
latin:keyLabel="/" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_question"
|
||||
latin:popupCharacters="@string/alternates_for_symbols_question" />
|
||||
<Key
|
||||
latin:keyStyle="deleteKeyStyle"
|
||||
latin:keyWidth="fillRight"
|
||||
latin:visualInsetsLeft="1%p" />
|
||||
</Row>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_symbols_row4" />
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols" />
|
||||
</Keyboard>
|
||||
|
|
|
@ -1,119 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
/*
|
||||
**
|
||||
** Copyright 2008, 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
|
||||
** 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
|
||||
** 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
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<Keyboard
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
latin:keyWidth="10%p"
|
||||
>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/kbd_key_styles" />
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyLabel="~" />
|
||||
<Key
|
||||
latin:keyLabel="`" />
|
||||
<Key
|
||||
latin:keyLabel="|" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="•"
|
||||
latin:popupCharacters="♪,♥,♠,♦,♣" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="√" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="π"
|
||||
latin:popupCharacters="Π" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="÷" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="×" />
|
||||
<Key
|
||||
latin:keyLabel="{" />
|
||||
<Key
|
||||
latin:keyLabel="}"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyStyle="nonSpecialBackgroundTabKeyStyle" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="¢" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="€" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="°"
|
||||
latin:popupCharacters="′,″" />
|
||||
<Key
|
||||
latin:keyLabel="^"
|
||||
latin:popupCharacters="↑,↓,←,→" />
|
||||
<Key
|
||||
latin:keyLabel="_" />
|
||||
<Key
|
||||
latin:keyLabel="="
|
||||
latin:popupCharacters="≠,≈,∞" />
|
||||
<Key
|
||||
latin:keyLabel="[" />
|
||||
<Key
|
||||
latin:keyLabel="]"
|
||||
latin:keyWidth="fillRight" />
|
||||
</Row>
|
||||
<Row>
|
||||
<Key
|
||||
latin:keyStyle="altKeyStyle"
|
||||
latin:keyWidth="15%p"
|
||||
latin:visualInsetsRight="1%p" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="™" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="®" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="©" />
|
||||
<Key
|
||||
latin:keyStyle="nonPasswordSymbolKeyStyle"
|
||||
latin:keyLabel="¶"
|
||||
latin:popupCharacters="§" />
|
||||
<Key
|
||||
latin:keyLabel="\\" />
|
||||
<Key
|
||||
latin:keyLabel="<"
|
||||
latin:popupCharacters="≤,«,‹" />
|
||||
<Key
|
||||
latin:keyLabel=">"
|
||||
latin:popupCharacters="≥,»,›" />
|
||||
<Key
|
||||
latin:keyStyle="deleteKeyStyle"
|
||||
latin:keyWidth="fillRight"
|
||||
latin:visualInsetsLeft="1%p" />
|
||||
</Row>
|
||||
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
|
||||
latin:keyboardLayout="@xml/kbd_rows_symbols_shift" />
|
||||
</Keyboard>
|
||||
|
|
|
@ -34,6 +34,8 @@ import com.android.inputmethod.keyboard.internal.Row;
|
|||
import com.android.inputmethod.latin.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Class for describing the position and characteristics of a single key in the keyboard.
|
||||
|
@ -153,6 +155,38 @@ public class Key {
|
|||
android.R.attr.state_pressed
|
||||
};
|
||||
|
||||
// RTL parenthesis character swapping map.
|
||||
private static final Map<Integer, Integer> sRtlParenthesisMap = new HashMap<Integer, Integer>();
|
||||
|
||||
static {
|
||||
addRtlParenthesisPair('(', ')');
|
||||
addRtlParenthesisPair('[', ']');
|
||||
addRtlParenthesisPair('{', '}');
|
||||
addRtlParenthesisPair('<', '>');
|
||||
// \u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
// \u00bb: RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
addRtlParenthesisPair('\u00ab', '\u00bb');
|
||||
// \u2039: SINGLE LEFT-POINTING ANGLE QUOTATION MARK
|
||||
// \u203a: SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
||||
addRtlParenthesisPair('\u2039', '\u203a');
|
||||
// \u2264: LESS-THAN OR EQUAL TO
|
||||
// \u2265: GREATER-THAN OR EQUAL TO
|
||||
addRtlParenthesisPair('\u2264', '\u2265');
|
||||
}
|
||||
|
||||
private static void addRtlParenthesisPair(int left, int right) {
|
||||
sRtlParenthesisMap.put(left, right);
|
||||
sRtlParenthesisMap.put(right, left);
|
||||
}
|
||||
|
||||
private static int getRtlParenthesisCode(int code) {
|
||||
if (sRtlParenthesisMap.containsKey(code)) {
|
||||
return sRtlParenthesisMap.get(code);
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is being used only for key in popup mini keyboard.
|
||||
*/
|
||||
|
@ -174,7 +208,8 @@ public class Key {
|
|||
final String popupSpecification = popupCharacter.toString();
|
||||
mLabel = PopupCharactersParser.getLabel(popupSpecification);
|
||||
mOutputText = PopupCharactersParser.getOutputText(popupSpecification);
|
||||
mCode = PopupCharactersParser.getCode(res, popupSpecification);
|
||||
final int code = PopupCharactersParser.getCode(res, popupSpecification);
|
||||
mCode = keyboard.isRtlKeyboard() ? getRtlParenthesisCode(code) : code;
|
||||
mIcon = keyboard.mIconsSet.getIcon(PopupCharactersParser.getIconId(popupSpecification));
|
||||
// Horizontal gap is divided equally to both sides of the key.
|
||||
mX = x + mGap / 2;
|
||||
|
@ -298,7 +333,8 @@ public class Key {
|
|||
final int code = style.getInt(keyAttr, R.styleable.Keyboard_Key_code,
|
||||
Keyboard.CODE_UNSPECIFIED);
|
||||
if (code == Keyboard.CODE_UNSPECIFIED && !TextUtils.isEmpty(mLabel)) {
|
||||
mCode = mLabel.charAt(0);
|
||||
final int firstChar = mLabel.charAt(0);
|
||||
mCode = mKeyboard.isRtlKeyboard() ? getRtlParenthesisCode(firstChar) : firstChar;
|
||||
} else if (code != Keyboard.CODE_UNSPECIFIED) {
|
||||
mCode = code;
|
||||
} else {
|
||||
|
|
|
@ -110,6 +110,9 @@ public class Keyboard {
|
|||
/** Maximum column for popup keyboard */
|
||||
private int mMaxPopupColumn;
|
||||
|
||||
/** True if Right-To-Left keyboard */
|
||||
private boolean mIsRtlKeyboard;
|
||||
|
||||
/** List of shift keys in this keyboard and its icons and state */
|
||||
private final List<Key> mShiftKeys = new ArrayList<Key>();
|
||||
private final HashMap<Key, Drawable> mShiftedIcons = new HashMap<Key, Drawable>();
|
||||
|
@ -257,6 +260,14 @@ public class Keyboard {
|
|||
mKeyboardHeight = height;
|
||||
}
|
||||
|
||||
public boolean isRtlKeyboard() {
|
||||
return mIsRtlKeyboard;
|
||||
}
|
||||
|
||||
public void setRtlKeyboard(boolean isRtl) {
|
||||
mIsRtlKeyboard = isRtl;
|
||||
}
|
||||
|
||||
public int getPopupKeyboardResId() {
|
||||
return mPopupKeyboardResId;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ public class MiniKeyboard extends Keyboard {
|
|||
// revert the above hacks and uncomment the following lines.
|
||||
//setHorizontalGap(parentKeyboard.getHorizontalGap());
|
||||
//setVerticalGap(parentKeyboard.getVerticalGap());
|
||||
|
||||
setRtlKeyboard(parentKeyboard.isRtlKeyboard());
|
||||
}
|
||||
|
||||
public void setDefaultCoordX(int pos) {
|
||||
|
|
|
@ -222,8 +222,9 @@ public class KeyboardParser {
|
|||
final int height = Math.max(
|
||||
Math.min(keyboardHeight, maxKeyboardHeight), minKeyboardHeight);
|
||||
|
||||
|
||||
keyboard.setKeyboardHeight(height);
|
||||
keyboard.setRtlKeyboard(keyboardAttr.getBoolean(
|
||||
R.styleable.Keyboard_isRtlKeyboard, false));
|
||||
keyboard.setKeyWidth(getDimensionOrFraction(keyboardAttr,
|
||||
R.styleable.Keyboard_keyWidth, displayWidth, displayWidth / 10));
|
||||
keyboard.setRowHeight(getDimensionOrFraction(keyboardAttr,
|
||||
|
|
Loading…
Reference in New Issue