Remove BIDI mirroring hack from Key

This change also removes isRtlKeyboard attribute from <Keyboard/>

Bug: 5948247
Change-Id: I85998f17ae146a4c8cd0f419ab820b746cb8974f
This commit is contained in:
Tadashi G. Takaoka 2012-02-01 19:43:58 +09:00
parent 40e9012276
commit 71c695da22
24 changed files with 203 additions and 170 deletions

View file

@ -102,8 +102,43 @@
<string name="more_keys_for_bullet"></string> <string name="more_keys_for_bullet"></string>
<!-- \u066d: ARABIC FIVE POINTED STAR --> <!-- \u066d: ARABIC FIVE POINTED STAR -->
<string name="more_keys_for_star">★,\u066d</string> <string name="more_keys_for_star">★,\u066d</string>
<!-- \ufd3e: ORNATE LEFT PARENTHESIS --> <!-- The all letters need to be mirrored are found at
<string name="more_keys_for_left_parenthesis">[,{,&lt;,\ufd3e</string> http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
<!-- \ufd3f: ORNATE RIGHT PARENTHESIS --> <string name="output_text_for_left_parenthesis">)</string>
<string name="more_keys_for_right_parenthesis">],},&gt;,\ufd3f</string> <string name="output_text_for_right_parenthesis">(</string>
<!-- \ufd3e: ORNATE LEFT PARENTHESIS
\ufd3f: ORNATE RIGHT PARENTHESIS -->
<string name="more_keys_for_left_parenthesis">[|],{|},&lt;|&gt;,\ufd3e|\ufd3f</string>
<string name="more_keys_for_right_parenthesis">]|[,}|{,&gt;|&lt;,\ufd3f|\ufd3e</string>
<string name="output_text_for_less_than">&gt;</string>
<string name="output_text_for_greater_than">&lt;</string>
<!-- \u2264: LESS-THAN OR EQUAL TO
\u2265: GREATER-THAN EQUAL TO
\u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
\u00bb: RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\u2039: SINGLE LEFT-POINTING ANGLE QUOTATION MARK
\u203a: SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
The following characters don't need BIDI mirroring.
\u2018: LEFT SINGLE QUOTATION MARK
\u2019: RIGHT SINGLE QUOTATION MARK
\u201a: SINGLE LOW-9 QUOTATION MARK
\u201b: SINGLE HIGH-REVERSED-9 QUOTATION MARK
\u201c: LEFT DOUBLE QUOTATION MARK
\u201d: RIGHT DOUBLE QUOTATION MARK
\u201e: DOUBLE LOW-9 QUOTATION MARK
\u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<string name="more_keys_for_less_than">\u2264|\u2265,\u00ab|\u00bb,\u2039|\u203a</string>
<string name="more_keys_for_greater_than">\u2265|\u2264,\u00bb|\u00ab,\u203a|\u2039</string>
<string name="output_text_for_left_square_bracket">]</string>
<string name="output_text_for_right_square_bracket">[</string>
<string name="output_text_for_left_curly_bracket">}</string>
<string name="output_text_for_right_curly_bracket">{</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb</string> -->
<!-- The 4-more keys will be displayed in order of "3,1,2,4". -->
<string name="more_keys_for_double_quote">\u201d,\u00ab|\u00bb,\u201c,\u00bb|\u00ab</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_tablet_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb,\u2018,\u2019,\u201a,\u201b</string> -->
<!-- The 8-more keys with maxMoreKeysColumn=4 will be displayed in order of "3,1,2,4|7,5,6,8". -->
<string name="more_keys_for_tablet_double_quote">\u201d,\u00ab|\u00bb,\u201c,\u00bb|\u00ab,\u2019,\u201a,\u2018,\u201b</string>
</resources> </resources>

View file

@ -19,7 +19,7 @@
--> -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The all letters need to be mirrored are found at <!-- The all letters need to be mirrored are found at
http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt --> http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
<!-- Symbols that are suggested between words --> <!-- Symbols that are suggested between words -->
<string name="suggested_punctuations">!,?,\\,,:,;,\u0022,(|),)|(,\u0027,-,/,@,_</string> <string name="suggested_punctuations">!,?,\\,,:,;,\u0022,(|),)|(,\u0027,-,/,@,_</string>
</resources> </resources>

View file

@ -20,4 +20,41 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="more_keys_for_star"></string> <string name="more_keys_for_star"></string>
<string name="more_keys_for_plus">±,﬩</string> <string name="more_keys_for_plus">±,﬩</string>
<!-- The all letters need to be mirrored are found at
http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
<string name="output_text_for_left_parenthesis">)</string>
<string name="output_text_for_right_parenthesis">(</string>
<string name="more_keys_for_left_parenthesis">[|],{|},&lt;|&gt;</string>
<string name="more_keys_for_right_parenthesis">]|[,}|{,&gt;|&lt;</string>
<string name="output_text_for_less_than">&gt;</string>
<string name="output_text_for_greater_than">&lt;</string>
<!-- \u2264: LESS-THAN OR EQUAL TO
\u2265: GREATER-THAN EQUAL TO
\u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
\u00bb: RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\u2039: SINGLE LEFT-POINTING ANGLE QUOTATION MARK
\u203a: SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
The following characters don't need BIDI mirroring.
\u2018: LEFT SINGLE QUOTATION MARK
\u2019: RIGHT SINGLE QUOTATION MARK
\u201a: SINGLE LOW-9 QUOTATION MARK
\u201b: SINGLE HIGH-REVERSED-9 QUOTATION MARK
\u201c: LEFT DOUBLE QUOTATION MARK
\u201d: RIGHT DOUBLE QUOTATION MARK
\u201e: DOUBLE LOW-9 QUOTATION MARK
\u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<string name="more_keys_for_less_than">\u2264|\u2265,\u00ab|\u00bb,\u2039|\u203a</string>
<string name="more_keys_for_greater_than">\u2265|\u2264,\u00bb|\u00ab,\u203a|\u2039</string>
<string name="output_text_for_left_square_bracket">]</string>
<string name="output_text_for_right_square_bracket">[</string>
<string name="output_text_for_left_curly_bracket">}</string>
<string name="output_text_for_right_curly_bracket">{</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb</string> -->
<!-- The 4-more keys will be displayed in order of "3,1,2,4". -->
<string name="more_keys_for_double_quote">\u201d,\u00ab|\u00bb,\u201c,\u00bb|\u00ab</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_tablet_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb,\u2018,\u2019,\u201a,\u201b</string> -->
<!-- The 8-more keys with maxMoreKeysColumn=4 will be displayed in order of "3,1,2,4|7,5,6,8". -->
<string name="more_keys_for_tablet_double_quote">\u201d,\u00ab|\u00bb,\u201c,\u00bb|\u00ab,\u2019,\u201a,\u2018,\u201b</string>
</resources> </resources>

View file

@ -19,7 +19,7 @@
--> -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- The all letters need to be mirrored are found at <!-- The all letters need to be mirrored are found at
http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt --> http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
<!-- Symbols that are suggested between words --> <!-- Symbols that are suggested between words -->
<string name="suggested_punctuations">!,?,\\,,:,;,\u0022,(|),)|(,\u0027,-,/,@,_</string> <string name="suggested_punctuations">!,?,\\,,:,;,\u0022,(|),)|(,\u0027,-,/,@,_</string>
</resources> </resources>

View file

@ -202,8 +202,6 @@
<attr name="verticalGap" format="dimension|fraction" /> <attr name="verticalGap" format="dimension|fraction" />
<!-- More keys keyboard layout template --> <!-- More keys keyboard layout template -->
<attr name="moreKeysTemplate" format="reference" /> <attr name="moreKeysTemplate" format="reference" />
<!-- True if the keyboard is Right-To-Left -->
<attr name="isRtlKeyboard" format="boolean" />
<!-- Icon set for key top and key preview. --> <!-- Icon set for key top and key preview. -->
<attr name="iconShiftKey" format="reference" /> <attr name="iconShiftKey" format="reference" />
<attr name="iconDeleteKey" format="reference" /> <attr name="iconDeleteKey" format="reference" />

View file

@ -112,6 +112,43 @@
<string name="more_keys_for_bullet">♪,♥,♠,♦,♣</string> <string name="more_keys_for_bullet">♪,♥,♠,♦,♣</string>
<string name="more_keys_for_star">†,‡,★</string> <string name="more_keys_for_star">†,‡,★</string>
<string name="more_keys_for_plus">±</string> <string name="more_keys_for_plus">±</string>
<!-- The all letters need to be mirrored are found at
http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
<string name="output_text_for_left_parenthesis">(</string>
<string name="output_text_for_right_parenthesis">)</string>
<string name="more_keys_for_left_parenthesis">[,{,&lt;</string> <string name="more_keys_for_left_parenthesis">[,{,&lt;</string>
<string name="more_keys_for_right_parenthesis">],},&gt;</string> <string name="more_keys_for_right_parenthesis">],},&gt;</string>
<string name="output_text_for_less_than">&lt;</string>
<string name="output_text_for_greater_than">&gt;</string>
<!-- \u2264: LESS-THAN OR EQUAL TO
\u2265: GREATER-THAN EQUAL TO
\u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
\u00bb: RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\u2039: SINGLE LEFT-POINTING ANGLE QUOTATION MARK
\u203a: SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
The following characters don't need BIDI mirroring.
\u2018: LEFT SINGLE QUOTATION MARK
\u2019: RIGHT SINGLE QUOTATION MARK
\u201a: SINGLE LOW-9 QUOTATION MARK
\u201b: SINGLE HIGH-REVERSED-9 QUOTATION MARK
\u201c: LEFT DOUBLE QUOTATION MARK
\u201d: RIGHT DOUBLE QUOTATION MARK
\u201e: DOUBLE LOW-9 QUOTATION MARK
\u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<string name="more_keys_for_less_than">\u2264,\u00ab,\u2039</string>
<string name="more_keys_for_greater_than">\u2265,\u00bb,\u203a</string>
<string name="output_text_for_left_square_bracket">[</string>
<string name="output_text_for_right_square_bracket">]</string>
<string name="output_text_for_left_curly_bracket">{</string>
<string name="output_text_for_right_curly_bracket">}</string>
<!-- The 4-more keys will be displayed in order of "3,1,2,4". -->
<string name="more_keys_for_single_quote">\u2019,\u201a,\u2018,\u201b</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb</string> -->
<!-- The 4-more keys will be displayed in order of "3,1,2,4". -->
<string name="more_keys_for_double_quote">\u201d,\u00ab,\u201c,\u00bb</string>
<!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- <string name="more_keys_for_tablet_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb,\u2018,\u2019,\u201a,\u201b</string> -->
<!-- The 8-more keys with maxMoreKeysColumn=4 will be displayed in order of "3,1,2,4|7,5,6,8". -->
<string name="more_keys_for_tablet_double_quote">\u201d,\u00ab,\u201c,\u00bb,\u2019,\u201a,\u2018,\u201b</string>
</resources> </resources>

View file

@ -116,7 +116,10 @@
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="@string/more_keys_for_n" />
<Key <Key
latin:keyLabel="\'" /> latin:keyLabel="\'"
latin:keyHintLabel=":"
latin:moreKeys=":"
latin:keyStyle="hasShiftedLetterHintStyle" />
<include <include
latin:keyboardLayout="@xml/keys_comma_period" /> latin:keyboardLayout="@xml/keys_comma_period" />
<include <include

View file

@ -95,12 +95,8 @@
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="@string/more_keys_for_plus" /> latin:moreKeys="@string/more_keys_for_plus" />
<Key <include
latin:keyLabel="(" latin:keyboardLayout="@xml/keys_parentheses" />
latin:moreKeys="[,{,&lt;" />
<Key
latin:keyLabel=")"
latin:moreKeys="],},&gt;" />
<Key <Key
latin:keyStyle="returnKeyStyle" latin:keyStyle="returnKeyStyle"
latin:keyXPos="-14.6%p" latin:keyXPos="-14.6%p"
@ -112,12 +108,8 @@
<Key <Key
latin:keyStyle="toMoreSymbolKeyStyle" latin:keyStyle="toMoreSymbolKeyStyle"
latin:keyWidth="10.0%p" /> latin:keyWidth="10.0%p" />
<Key <include
latin:keyLabel="&lt;" latin:keyboardLayout="@xml/keys_less_greater" />
latin:moreKeys="≤,«," />
<Key
latin:keyLabel="&gt;"
latin:moreKeys="≥,»," />
<Key <Key
latin:keyLabel="=" latin:keyLabel="="
latin:moreKeys="≠,≈" /> latin:moreKeys="≠,≈" />
@ -126,8 +118,7 @@
latin:mode="url" latin:mode="url"
> >
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'" />
latin:moreKeys=",,," />
</case> </case>
<default> <default>
<Key <Key
@ -166,11 +157,10 @@
latin:keyStyle="spaceKeyStyle" latin:keyStyle="spaceKeyStyle"
latin:keyXPos="30.750%p" latin:keyXPos="30.750%p"
latin:keyWidth="39.750%p" /> latin:keyWidth="39.750%p" />
<!-- Note: DroidSans doesn't have double-high-reversed-quotation '\u201f' glyph. -->
<!-- latin:moreKeys="“,”,„,‟,«,»,,,," -->
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="“,”,«,»,,,," /> latin:moreKeys="@string/more_keys_for_tablet_double_quote"
latin:maxMoreKeysColumn="4" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<Spacer <Spacer

View file

@ -77,10 +77,8 @@
<Key <Key
latin:keyLabel="±" latin:keyLabel="±"
latin:moreKeys="∞" /> latin:moreKeys="∞" />
<Key <include
latin:keyLabel="{" /> latin:keyboardLayout="@xml/keys_curly_brackets" />
<Key
latin:keyLabel="}" />
<Key <Key
latin:keyStyle="returnKeyStyle" latin:keyStyle="returnKeyStyle"
latin:keyXPos="-14.6%p" latin:keyXPos="-14.6%p"
@ -102,10 +100,8 @@
latin:keyLabel="™" /> latin:keyLabel="™" />
<Key <Key
latin:keyLabel="℅" /> latin:keyLabel="℅" />
<Key <include
latin:keyLabel="[" /> latin:keyboardLayout="@xml/keys_square_brackets" />
<Key
latin:keyLabel="]" />
<Key <Key
latin:keyLabel="¡" /> latin:keyLabel="¡" />
<Key <Key

View file

@ -124,9 +124,9 @@
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="@string/more_keys_for_n" />
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:keyLabelFlags="hasShiftedLetterHint"
latin:keyHintLabel=":" latin:keyHintLabel=":"
latin:moreKeys=":" /> latin:moreKeys=":"
latin:keyStyle="hasShiftedLetterHintStyle" />
<include <include
latin:keyboardLayout="@xml/keys_comma_period" /> latin:keyboardLayout="@xml/keys_comma_period" />
<Key <Key

View file

@ -102,12 +102,8 @@
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="@string/more_keys_for_plus" /> latin:moreKeys="@string/more_keys_for_plus" />
<Key <include
latin:keyLabel="(" latin:keyboardLayout="@xml/keys_parentheses" />
latin:moreKeys="[,{,&lt;" />
<Key
latin:keyLabel=")"
latin:moreKeys="],},&gt;" />
<Key <Key
latin:keyStyle="returnKeyStyle" latin:keyStyle="returnKeyStyle"
latin:keyXPos="-15.704%p" latin:keyXPos="-15.704%p"
@ -119,12 +115,8 @@
<Key <Key
latin:keyStyle="toMoreSymbolKeyStyle" latin:keyStyle="toMoreSymbolKeyStyle"
latin:keyWidth="13.829%p" /> latin:keyWidth="13.829%p" />
<Key <include
latin:keyLabel="&lt;" latin:keyboardLayout="@xml/keys_less_greater" />
latin:moreKeys="≤,«," />
<Key
latin:keyLabel="&gt;"
latin:moreKeys="≥,»," />
<Key <Key
latin:keyLabel="=" latin:keyLabel="="
latin:moreKeys="≠,≈" /> latin:moreKeys="≠,≈" />
@ -133,8 +125,7 @@
latin:mode="url" latin:mode="url"
> >
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'" />
latin:moreKeys=",,," />
</case> </case>
<default> <default>
<Key <Key
@ -181,11 +172,10 @@
latin:keyStyle="spaceKeyStyle" latin:keyStyle="spaceKeyStyle"
latin:keyXPos="31.250%p" latin:keyXPos="31.250%p"
latin:keyWidth="37.500%p" /> latin:keyWidth="37.500%p" />
<!-- Note: DroidSans doesn't have double-high-reversed-quotation '\u201f' glyph. -->
<!-- latin:moreKeys="“,”,„,‟,«,»,,,," -->
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="“,”,«,»,,,," /> latin:moreKeys="@string/more_keys_for_tablet_double_quote"
latin:maxMoreKeysColumn="4" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<switch> <switch>

View file

@ -84,10 +84,8 @@
<Key <Key
latin:keyLabel="±" latin:keyLabel="±"
latin:moreKeys="∞" /> latin:moreKeys="∞" />
<Key <include
latin:keyLabel="{" /> latin:keyboardLayout="@xml/keys_curly_brackets" />
<Key
latin:keyLabel="}" />
<Key <Key
latin:keyStyle="returnKeyStyle" latin:keyStyle="returnKeyStyle"
latin:keyXPos="-15.704%p" latin:keyXPos="-15.704%p"
@ -109,10 +107,8 @@
latin:keyLabel="™" /> latin:keyLabel="™" />
<Key <Key
latin:keyLabel="℅" /> latin:keyLabel="℅" />
<Key <include
latin:keyLabel="[" /> latin:keyboardLayout="@xml/keys_square_brackets" />
<Key
latin:keyLabel="]" />
<Key <Key
latin:keyLabel="¡" /> latin:keyLabel="¡" />
<Key <Key

View file

@ -20,7 +20,6 @@
<Keyboard <Keyboard
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <include
latin:keyboardLayout="@xml/rows_arabic" /> latin:keyboardLayout="@xml/rows_arabic" />

View file

@ -20,7 +20,6 @@
<Keyboard <Keyboard
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <include
latin:keyboardLayout="@xml/rows_hebrew" /> latin:keyboardLayout="@xml/rows_hebrew" />

View file

@ -2,7 +2,7 @@
<!-- <!--
/* /*
** **
** Copyright 2011, The Android Open Source Project ** Copyright 2012, The Android Open Source Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -18,10 +18,13 @@
*/ */
--> -->
<Keyboard <merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <Key
latin:keyboardLayout="@xml/rows_symbols" /> latin:keyLabel="{"
</Keyboard> latin:keyOutputText="@string/output_text_for_left_curly_bracket" />
<Key
latin:keyLabel="}"
latin:keyOutputText="@string/output_text_for_right_curly_bracket" />
</merge>

View file

@ -2,7 +2,7 @@
<!-- <!--
/* /*
** **
** Copyright 2011, The Android Open Source Project ** Copyright 2012, The Android Open Source Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -18,10 +18,15 @@
*/ */
--> -->
<Keyboard <merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <Key
latin:keyboardLayout="@xml/rows_symbols" /> latin:keyLabel="&lt;"
</Keyboard> latin:keyOutputText="@string/output_text_for_less_than"
latin:moreKeys="@string/more_keys_for_less_than" />
<Key
latin:keyLabel="&gt;"
latin:keyOutputText="@string/output_text_for_greater_than"
latin:moreKeys="@string/more_keys_for_greater_than" />
</merge>

View file

@ -2,7 +2,7 @@
<!-- <!--
/* /*
** **
** Copyright 2011, The Android Open Source Project ** Copyright 2012, The Android Open Source Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -18,10 +18,15 @@
*/ */
--> -->
<Keyboard <merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <Key
latin:keyboardLayout="@xml/rows_symbols_shift" /> latin:keyLabel="("
</Keyboard> latin:keyOutputText="@string/output_text_for_left_parenthesis"
latin:moreKeys="@string/more_keys_for_left_parenthesis" />
<Key
latin:keyLabel=")"
latin:keyOutputText="@string/output_text_for_right_parenthesis"
latin:moreKeys="@string/more_keys_for_right_parenthesis" />
</merge>

View file

@ -2,7 +2,7 @@
<!-- <!--
/* /*
** **
** Copyright 2011, The Android Open Source Project ** Copyright 2012, The Android Open Source Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -18,10 +18,13 @@
*/ */
--> -->
<Keyboard <merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
latin:isRtlKeyboard="true"
> >
<include <Key
latin:keyboardLayout="@xml/rows_symbols_shift" /> latin:keyLabel="["
</Keyboard> latin:keyOutputText="@string/output_text_for_left_square_bracket" />
<Key
latin:keyLabel="]"
latin:keyOutputText="@string/output_text_for_right_square_bracket" />
</merge>

View file

@ -130,9 +130,13 @@
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="@string/more_keys_for_n" />
<!-- TODO: Introduce a flag, such as strinctMoreKeysOrder, to control moreKeys display
order more precisely. -->
<!-- This key is close enough to right edge, so that the 4-more keys will be displayed in
order of "4,3,1,2". See @string/more_keys_for_single_quote -->
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys=",,," /> latin:moreKeys="\u2018,\u2019,\u201b,\u201a" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" latin:keyWidth="fillRight"

View file

@ -93,13 +93,8 @@
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="@string/more_keys_for_plus" /> latin:moreKeys="@string/more_keys_for_plus" />
<Key <include
latin:keyLabel="(" latin:keyboardLayout="@xml/keys_parentheses" />
latin:moreKeys="@string/more_keys_for_left_parenthesis" />
<Key
latin:keyLabel=")"
latin:moreKeys="@string/more_keys_for_right_parenthesis"
latin:keyWidth="fillRight" />
</Row> </Row>
<Row <Row
latin:keyWidth="10%p" latin:keyWidth="10%p"
@ -111,15 +106,13 @@
<Key <Key
latin:keyLabel="!" latin:keyLabel="!"
latin:moreKeys="¡" /> latin:moreKeys="¡" />
<!-- Note: Neither DroidSans nor Roboto have a glyph for ‟ Double high-reversed-9 quotation mark U+201F. -->
<!-- latin:moreKeys="“,”,„,‟,«,»" -->
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="“,”,«,»" latin:moreKeys="@string/more_keys_for_double_quote"
latin:maxMoreKeysColumn="6" /> latin:maxMoreKeysColumn="4" />
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys=",,," /> latin:moreKeys="@string/more_keys_for_single_quote" />
<Key <Key
latin:keyLabel=":" /> latin:keyLabel=":" />
<Key <Key

View file

@ -46,11 +46,8 @@
latin:keyLabel="÷" /> latin:keyLabel="÷" />
<Key <Key
latin:keyLabel="×" /> latin:keyLabel="×" />
<Key <include
latin:keyLabel="{" /> latin:keyboardLayout="@xml/keys_curly_brackets" />
<Key
latin:keyLabel="}"
latin:keyWidth="fillRight" />
</Row> </Row>
<Row <Row
latin:keyWidth="10%p" latin:keyWidth="10%p"
@ -74,11 +71,8 @@
<Key <Key
latin:keyLabel="=" latin:keyLabel="="
latin:moreKeys="≠,≈,∞" /> latin:moreKeys="≠,≈,∞" />
<Key <include
latin:keyLabel="[" /> latin:keyboardLayout="@xml/keys_square_brackets" />
<Key
latin:keyLabel="]"
latin:keyWidth="fillRight" />
</Row> </Row>
<Row <Row
latin:keyWidth="10%p" latin:keyWidth="10%p"
@ -98,12 +92,8 @@
latin:moreKeys="§" /> latin:moreKeys="§" />
<Key <Key
latin:keyLabel="\\" /> latin:keyLabel="\\" />
<Key <include
latin:keyLabel="&lt;" latin:keyboardLayout="@xml/keys_less_greater" />
latin:moreKeys="≤,«," />
<Key
latin:keyLabel="&gt;"
latin:moreKeys="≥,»," />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" latin:keyWidth="fillRight"

View file

@ -36,8 +36,6 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
* Class for describing the position and characteristics of a single key in the keyboard. * Class for describing the position and characteristics of a single key in the keyboard.
@ -129,45 +127,6 @@ public class Key {
/** Key is enabled and responds on press */ /** Key is enabled and responds on press */
private boolean mEnabled = true; private boolean mEnabled = true;
// RTL parenthesis character swapping map.
private static final Map<Integer, Integer> sRtlParenthesisMap = new HashMap<Integer, Integer>();
static {
// The all letters need to be mirrored are found at
// http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt
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);
}
public static int getRtlParenthesisCode(int code, boolean isRtl) {
if (isRtl && sRtlParenthesisMap.containsKey(code)) {
return sRtlParenthesisMap.get(code);
} else {
return code;
}
}
private static int getCode(Resources res, Keyboard.Params params, String moreKeySpec) {
return getRtlParenthesisCode(
MoreKeySpecParser.getCode(res, moreKeySpec), params.mIsRtlKeyboard);
}
private static Drawable getIcon(Keyboard.Params params, String moreKeySpec) { private static Drawable getIcon(Keyboard.Params params, String moreKeySpec) {
final int iconAttrId = MoreKeySpecParser.getIconAttrId(moreKeySpec); final int iconAttrId = MoreKeySpecParser.getIconAttrId(moreKeySpec);
if (iconAttrId == KeyboardIconsSet.ICON_UNDEFINED) { if (iconAttrId == KeyboardIconsSet.ICON_UNDEFINED) {
@ -183,7 +142,8 @@ public class Key {
public Key(Resources res, Keyboard.Params params, String moreKeySpec, public Key(Resources res, Keyboard.Params params, String moreKeySpec,
int x, int y, int width, int height) { int x, int y, int width, int height) {
this(params, MoreKeySpecParser.getLabel(moreKeySpec), null, getIcon(params, moreKeySpec), this(params, MoreKeySpecParser.getLabel(moreKeySpec), null, getIcon(params, moreKeySpec),
getCode(res, params, moreKeySpec), MoreKeySpecParser.getOutputText(moreKeySpec), MoreKeySpecParser.getCode(res, moreKeySpec),
MoreKeySpecParser.getOutputText(moreKeySpec),
x, y, width, height); x, y, width, height);
} }
@ -311,16 +271,14 @@ public class Key {
if (code == Keyboard.CODE_UNSPECIFIED && TextUtils.isEmpty(outputText) if (code == Keyboard.CODE_UNSPECIFIED && TextUtils.isEmpty(outputText)
&& !TextUtils.isEmpty(mLabel)) { && !TextUtils.isEmpty(mLabel)) {
if (mLabel.codePointCount(0, mLabel.length()) == 1) { if (mLabel.codePointCount(0, mLabel.length()) == 1) {
final int activatedCode;
// Use the first letter of the hint label if shiftedLetterActivated flag is // Use the first letter of the hint label if shiftedLetterActivated flag is
// specified. // specified.
if (hasShiftedLetterHint() && isShiftedLetterActivated() if (hasShiftedLetterHint() && isShiftedLetterActivated()
&& !TextUtils.isEmpty(mHintLabel)) { && !TextUtils.isEmpty(mHintLabel)) {
activatedCode = mHintLabel.codePointAt(0); mCode = mHintLabel.codePointAt(0);
} else { } else {
activatedCode = mLabel.codePointAt(0); mCode = mLabel.codePointAt(0);
} }
mCode = getRtlParenthesisCode(activatedCode, params.mIsRtlKeyboard);
} else { } else {
// In some locale and case, the character might be represented by multiple code // In some locale and case, the character might be represented by multiple code
// points, such as upper case Eszett of German alphabet. // points, such as upper case Eszett of German alphabet.

View file

@ -121,9 +121,6 @@ public class Keyboard {
/** Maximum column for mini keyboard */ /** Maximum column for mini keyboard */
public final int mMaxMiniKeyboardColumn; public final int mMaxMiniKeyboardColumn;
/** True if Right-To-Left keyboard */
public final boolean mIsRtlKeyboard;
/** List of keys and icons in this keyboard */ /** List of keys and icons in this keyboard */
public final Set<Key> mKeys; public final Set<Key> mKeys;
public final Set<Key> mShiftKeys; public final Set<Key> mShiftKeys;
@ -140,7 +137,6 @@ public class Keyboard {
mOccupiedWidth = params.mOccupiedWidth; mOccupiedWidth = params.mOccupiedWidth;
mMostCommonKeyHeight = params.mMostCommonKeyHeight; mMostCommonKeyHeight = params.mMostCommonKeyHeight;
mMostCommonKeyWidth = params.mMostCommonKeyWidth; mMostCommonKeyWidth = params.mMostCommonKeyWidth;
mIsRtlKeyboard = params.mIsRtlKeyboard;
mMoreKeysTemplate = params.mMoreKeysTemplate; mMoreKeysTemplate = params.mMoreKeysTemplate;
mMaxMiniKeyboardColumn = params.mMaxMiniKeyboardColumn; mMaxMiniKeyboardColumn = params.mMaxMiniKeyboardColumn;
@ -222,7 +218,6 @@ public class Keyboard {
public int mHorizontalGap; public int mHorizontalGap;
public int mVerticalGap; public int mVerticalGap;
public boolean mIsRtlKeyboard;
public int mMoreKeysTemplate; public int mMoreKeysTemplate;
public int mMaxMiniKeyboardColumn; public int mMaxMiniKeyboardColumn;
@ -739,8 +734,6 @@ public class Keyboard {
R.styleable.Keyboard_rowHeight, params.mBaseHeight, R.styleable.Keyboard_rowHeight, params.mBaseHeight,
params.mBaseHeight / DEFAULT_KEYBOARD_ROWS); params.mBaseHeight / DEFAULT_KEYBOARD_ROWS);
params.mIsRtlKeyboard = keyboardAttr.getBoolean(
R.styleable.Keyboard_isRtlKeyboard, false);
params.mMoreKeysTemplate = keyboardAttr.getResourceId( params.mMoreKeysTemplate = keyboardAttr.getResourceId(
R.styleable.Keyboard_moreKeysTemplate, 0); R.styleable.Keyboard_moreKeysTemplate, 0);
params.mMaxMiniKeyboardColumn = keyAttr.getInt( params.mMaxMiniKeyboardColumn = keyAttr.getInt(

View file

@ -210,7 +210,6 @@ public class MiniKeyboard extends Keyboard {
// TODO: Mini keyboard's vertical gap is currently calculated heuristically. // TODO: Mini keyboard's vertical gap is currently calculated heuristically.
// Should revise the algorithm. // Should revise the algorithm.
mParams.mVerticalGap = parentKeyboard.mVerticalGap / 2; mParams.mVerticalGap = parentKeyboard.mVerticalGap / 2;
mParams.mIsRtlKeyboard = parentKeyboard.mIsRtlKeyboard;
mMoreKeys = parentKey.mMoreKeys; mMoreKeys = parentKey.mMoreKeys;
final int previewWidth = view.mKeyPreviewDrawParams.mPreviewBackgroundWidth; final int previewWidth = view.mKeyPreviewDrawParams.mPreviewBackgroundWidth;