From 78173bdf535e38a4f9c3bcc8038151de86071728 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Thu, 19 Apr 2012 20:16:35 +0900
Subject: [PATCH] Support Dvorak layout

Bug: 4460018
Change-Id: I08a9b556720f6c4f7089a8838c0869c9f88f479c
---
 java/res/values/donottranslate.xml            |  2 +
 .../xml-sw600dp/key_question_exclamation.xml  | 48 ++++++++++
 java/res/xml-sw600dp/keys_dvorak_123.xml      | 40 +++++++++
 java/res/xml-sw600dp/row_dvorak4.xml          | 46 ++++++++++
 java/res/xml-sw600dp/rowkeys_dvorak3.xml      | 47 ++++++++++
 java/res/xml-sw600dp/rows_dvorak.xml          | 63 +++++++++++++
 java/res/xml-sw768dp/row_dvorak4.xml          | 51 +++++++++++
 java/res/xml-sw768dp/rows_dvorak.xml          | 69 ++++++++++++++
 java/res/xml/kbd_dvorak.xml                   | 26 ++++++
 java/res/xml/keyboard_layout_set_dvorak.xml   | 42 +++++++++
 java/res/xml/keys_dvorak_123.xml              | 60 +++++++++++++
 java/res/xml/row_dvorak4.xml                  | 89 +++++++++++++++++++
 java/res/xml/rowkeys_dvorak1.xml              | 57 ++++++++++++
 java/res/xml/rowkeys_dvorak2.xml              | 54 +++++++++++
 java/res/xml/rowkeys_dvorak3.xml              | 42 +++++++++
 java/res/xml/rows_dvorak.xml                  | 56 ++++++++++++
 .../inputmethod/latin/AdditionalSubtype.java  |  5 +-
 .../inputmethod/latin/SubtypeLocale.java      |  7 +-
 18 files changed, 802 insertions(+), 2 deletions(-)
 create mode 100644 java/res/xml-sw600dp/key_question_exclamation.xml
 create mode 100644 java/res/xml-sw600dp/keys_dvorak_123.xml
 create mode 100644 java/res/xml-sw600dp/row_dvorak4.xml
 create mode 100644 java/res/xml-sw600dp/rowkeys_dvorak3.xml
 create mode 100644 java/res/xml-sw600dp/rows_dvorak.xml
 create mode 100644 java/res/xml-sw768dp/row_dvorak4.xml
 create mode 100644 java/res/xml-sw768dp/rows_dvorak.xml
 create mode 100644 java/res/xml/kbd_dvorak.xml
 create mode 100644 java/res/xml/keyboard_layout_set_dvorak.xml
 create mode 100644 java/res/xml/keys_dvorak_123.xml
 create mode 100644 java/res/xml/row_dvorak4.xml
 create mode 100644 java/res/xml/rowkeys_dvorak1.xml
 create mode 100644 java/res/xml/rowkeys_dvorak2.xml
 create mode 100644 java/res/xml/rowkeys_dvorak3.xml
 create mode 100644 java/res/xml/rows_dvorak.xml

diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index 892c72aeca..b97d4d7d45 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -152,6 +152,8 @@
     <string name="subtype_generic_qwertz">%s (QWERTZ)</string>
     <!-- Description for generic AZERTY keyboard subtype -->
     <string name="subtype_generic_azerty">%s (AZERTY)</string>
+    <!-- Description for generic Dvorak keyboard subtype -->
+    <string name="subtype_generic_dvorak">%s (Dvorak)</string>
 
     <!-- dictionary pack package name /settings activity (for shared prefs and settings) -->
     <string name="dictionary_pack_package_name">com.google.android.inputmethod.latin.dictionarypack</string>
diff --git a/java/res/xml-sw600dp/key_question_exclamation.xml b/java/res/xml-sw600dp/key_question_exclamation.xml
new file mode 100644
index 0000000000..f1495de49d
--- /dev/null
+++ b/java/res/xml-sw600dp/key_question_exclamation.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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"
+>
+    <switch>
+        <case
+            latin:mode="email"
+        >
+            <Key
+                latin:keyLabel="-" />
+        </case>
+        <case
+            latin:mode="url"
+        >
+            <Key
+                latin:keyLabel="/"
+                latin:keyHintLabel=":"
+                latin:moreKeys=":"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </case>
+        <default>
+            <Key
+                latin:keyLabel="\?"
+                latin:keyHintLabel="!"
+                latin:moreKeys="!"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml-sw600dp/keys_dvorak_123.xml b/java/res/xml-sw600dp/keys_dvorak_123.xml
new file mode 100644
index 0000000000..635ea04767
--- /dev/null
+++ b/java/res/xml-sw600dp/keys_dvorak_123.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyLabel="\'"
+        latin:keyHintLabel="&quot;"
+        latin:moreKeys="!"
+        latin:keyStyle="hasShiftedLetterHintStyle" />
+    <Key
+        latin:keyLabel=","
+        latin:keyHintLabel="&lt;"
+        latin:moreKeys="\?"
+        latin:keyStyle="hasShiftedLetterHintStyle" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintLabel="&gt;"
+        latin:keyLabelFlags="hasPopupHint|preserveCase"
+        latin:moreKeys="!text/more_keys_for_punctuation"
+        latin:keyStyle="hasShiftedLetterHintStyle" />
+</merge>
diff --git a/java/res/xml-sw600dp/row_dvorak4.xml b/java/res/xml-sw600dp/row_dvorak4.xml
new file mode 100644
index 0000000000..7d365883a7
--- /dev/null
+++ b/java/res/xml-sw600dp/row_dvorak4.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyWidth="8.9%p"
+    >
+        <Key
+            latin:keyStyle="toSymbolKeyStyle"
+            latin:keyWidth="13.0%p" />
+        <Key
+            latin:keyStyle="tabKeyStyle" />
+        <include
+            latin:keyboardLayout="@xml/key_f1" />
+        <include
+            latin:keyboardLayout="@xml/key_space" />
+        <include
+            latin:keyboardLayout="@xml/key_question_exclamation" />
+        <include
+            latin:keyboardLayout="@xml/key_dash" />
+        <Spacer
+            latin:keyXPos="-10.00%p"
+            latin:keyWidth="0%p" />
+        <include
+            latin:keyboardLayout="@xml/key_shortcut" />
+    </Row>
+</merge>
diff --git a/java/res/xml-sw600dp/rowkeys_dvorak3.xml b/java/res/xml-sw600dp/rowkeys_dvorak3.xml
new file mode 100644
index 0000000000..2148bb2c7f
--- /dev/null
+++ b/java/res/xml-sw600dp/rowkeys_dvorak3.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyLabel="q" />
+    <Key
+        latin:keyLabel="j"
+        latin:moreKeys="!text/more_keys_for_j" />
+    <Key
+        latin:keyLabel="k"
+        latin:moreKeys="!text/more_keys_for_k" />
+    <Key
+        latin:keyLabel="x" />
+    <Key
+        latin:keyLabel="b" />
+    <Key
+        latin:keyLabel="m" />
+    <Key
+        latin:keyLabel="w"
+        latin:moreKeys="!text/more_keys_for_w" />
+    <Key
+        latin:keyLabel="v"
+        latin:moreKeys="!text/more_keys_for_v" />
+    <Key
+        latin:keyLabel="z"
+        latin:moreKeys="!text/more_keys_for_z" />
+</merge>
diff --git a/java/res/xml-sw600dp/rows_dvorak.xml b/java/res/xml-sw600dp/rows_dvorak.xml
new file mode 100644
index 0000000000..aec4a5cf5c
--- /dev/null
+++ b/java/res/xml-sw600dp/rows_dvorak.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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/key_styles_common" />
+    <Row
+        latin:keyWidth="8.5%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/keys_dvorak_123" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak1"
+            latin:keyLabelFlags="disableAdditionalMoreKeys|disableKeyHintLabel" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillBoth" />
+    </Row>
+    <Row
+        latin:keyWidth="8.5%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak2"
+            latin:keyXPos="4.5%p" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillBoth" />
+    </Row>
+    <Row
+        latin:keyWidth="8.5%p"
+    >
+        <Key
+            latin:keyStyle="shiftKeyStyle"
+            latin:keyWidth="10.0%p" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak3" />
+        <include
+            latin:keyboardLayout="@xml/key_smiley"
+            latin:keyXPos="-8.5%p"
+            latin:keyWidth="fillRight" />
+    </Row>
+    <include
+        latin:keyboardLayout="@xml/row_dvorak4" />
+</merge>
diff --git a/java/res/xml-sw768dp/row_dvorak4.xml b/java/res/xml-sw768dp/row_dvorak4.xml
new file mode 100644
index 0000000000..b98ce84907
--- /dev/null
+++ b/java/res/xml-sw768dp/row_dvorak4.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyWidth="8.047%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/key_settings" />
+        <Spacer
+            latin:keyXPos="15.157%p"
+            latin:keyWidth="0%p" />
+        <include
+            latin:keyboardLayout="@xml/keys_f1f2" />
+        <include
+            latin:keyboardLayout="@xml/key_space" />
+        <include
+            latin:keyboardLayout="@xml/key_question_exclamation" />
+        <include
+            latin:keyboardLayout="@xml/key_dash" />
+        <switch>
+            <case
+                latin:shortcutKeyEnabled="true"
+            >
+                <Key
+                    latin:keyStyle="shortcutKeyStyle"
+                    latin:keyXPos="-8.047%p"
+                    latin:keyWidth="fillRight" />
+            </case>
+        </switch>
+    </Row>
+</merge>
diff --git a/java/res/xml-sw768dp/rows_dvorak.xml b/java/res/xml-sw768dp/rows_dvorak.xml
new file mode 100644
index 0000000000..91d0f1bce5
--- /dev/null
+++ b/java/res/xml-sw768dp/rows_dvorak.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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/key_styles_common" />
+    <Row
+        latin:keyWidth="8.282%p"
+    >
+        <Key
+            latin:keyStyle="tabKeyStyle"
+            latin:keyLabelFlags="alignLeft"
+            latin:keyWidth="7.969%p" />
+        <include
+            latin:keyboardLayout="@xml/keys_dvorak_123" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak1"
+            latin:keyLabelFlags="disableAdditionalMoreKeys|disableKeyHintLabel" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillBoth" />
+    </Row>
+    <Row
+        latin:keyWidth="8.125%p"
+    >
+        <Key
+            latin:keyStyle="toSymbolKeyStyle"
+            latin:keyLabelFlags="alignLeft"
+            latin:keyWidth="10.167%p" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak2" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillBoth" />
+    </Row>
+    <Row
+        latin:keyWidth="8.047%p"
+    >
+        <Key
+            latin:keyStyle="shiftKeyStyle"
+            latin:keyWidth="13.829%p" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak3" />
+        <Key
+            latin:keyStyle="shiftKeyStyle"
+            latin:keyWidth="fillBoth" />
+    </Row>
+    <include
+        latin:keyboardLayout="@xml/row_dvorak4" />
+</merge>
diff --git a/java/res/xml/kbd_dvorak.xml b/java/res/xml/kbd_dvorak.xml
new file mode 100644
index 0000000000..27c6a50847
--- /dev/null
+++ b/java/res/xml/kbd_dvorak.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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"
+>
+    <include
+        latin:keyboardLayout="@xml/rows_dvorak" />
+</Keyboard>
diff --git a/java/res/xml/keyboard_layout_set_dvorak.xml b/java/res/xml/keyboard_layout_set_dvorak.xml
new file mode 100644
index 0000000000..eb8e0c5399
--- /dev/null
+++ b/java/res/xml/keyboard_layout_set_dvorak.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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.
+*/
+-->
+
+<KeyboardLayoutSet
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
+    <Element
+        latin:elementName="alphabet"
+        latin:elementKeyboard="@xml/kbd_dvorak"
+        latin:enableProximityCharsCorrection="true" />
+    <Element
+        latin:elementName="symbols"
+        latin:elementKeyboard="@xml/kbd_10_10_7_symbols" />
+    <Element
+        latin:elementName="symbolsShifted"
+        latin:elementKeyboard="@xml/kbd_10_10_7_symbols_shift" />
+    <Element
+        latin:elementName="phone"
+        latin:elementKeyboard="@xml/kbd_phone" />
+    <Element
+        latin:elementName="phoneSymbols"
+        latin:elementKeyboard="@xml/kbd_phone_symbols" />
+    <Element
+        latin:elementName="number"
+        latin:elementKeyboard="@xml/kbd_number" />
+</KeyboardLayoutSet>
diff --git a/java/res/xml/keys_dvorak_123.xml b/java/res/xml/keys_dvorak_123.xml
new file mode 100644
index 0000000000..0de2dd6288
--- /dev/null
+++ b/java/res/xml/keys_dvorak_123.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted"
+        >
+            <Key
+                latin:keyLabel="&quot;"
+                latin:keyHintLabel="1"
+                latin:additionalMoreKeys="1" />
+            <Key
+                latin:keyLabel="&lt;"
+                latin:keyHintLabel="2"
+                latin:additionalMoreKeys="2" />
+            <Key
+                latin:keyLabel="&gt;"
+                latin:keyHintLabel="3"
+                latin:additionalMoreKeys="3" />
+        </case>
+        <default>
+            <Key
+                latin:keyLabel="\'"
+                latin:keyHintLabel="1"
+                latin:additionalMoreKeys="1"
+                latin:moreKeys="!" />
+            <Key
+                latin:keyLabel=","
+                latin:keyHintLabel="2"
+                latin:additionalMoreKeys="2"
+                latin:moreKeys="\?" />
+            <Key
+                latin:keyLabel="."
+                latin:keyHintLabel="3"
+                latin:additionalMoreKeys="3"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="!text/more_keys_for_punctuation,%" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml/row_dvorak4.xml b/java/res/xml/row_dvorak4.xml
new file mode 100644
index 0000000000..7b9a59cde6
--- /dev/null
+++ b/java/res/xml/row_dvorak4.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyWidth="10%p"
+    >
+        <Key
+            latin:keyStyle="toSymbolKeyStyle"
+            latin:keyWidth="15%p" />
+        <switch>
+            <case
+                latin:mode="url"
+            >
+                <Key
+                    latin:keyLabel="/"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <case
+                latin:mode="email"
+            >
+                <Key
+                    latin:keyLabel="\@"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <case
+                latin:hasShortcutKey="true"
+                latin:keyboardLayoutSetElement="alphabet"
+            >
+                <Key
+                    latin:keyLabel="q"
+                    latin:backgroundType="normal"
+                    latin:additionalMoreKeys="!text/shortcut_as_more_key"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <case
+                latin:hasShortcutKey="true"
+            >
+                <Key
+                    latin:keyLabel="Q"
+                    latin:backgroundType="normal"
+                    latin:additionalMoreKeys="!text/shortcut_as_more_key"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <!-- latin:hasShortcutKey="false" -->
+            <case
+                latin:keyboardLayoutSetElement="alphabet"
+            >
+                <Key
+                    latin:keyLabel="q"
+                    latin:backgroundType="normal"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <default>
+                <Key
+                    latin:keyLabel="Q"
+                    latin:backgroundType="normal"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </default>
+        </switch>
+        <include
+            latin:keyboardLayout="@xml/key_space" />
+        <Key
+            latin:keyLabel="z"
+            latin:moreKeys="!text/more_keys_for_z" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
+</merge>
diff --git a/java/res/xml/rowkeys_dvorak1.xml b/java/res/xml/rowkeys_dvorak1.xml
new file mode 100644
index 0000000000..7e0eb6e713
--- /dev/null
+++ b/java/res/xml/rowkeys_dvorak1.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyLabel="p"
+        latin:keyHintLabel="4"
+        latin:additionalMoreKeys="4" />
+    <Key
+        latin:keyLabel="y"
+        latin:keyHintLabel="5"
+        latin:additionalMoreKeys="5"
+        latin:moreKeys="!text/more_keys_for_y" />
+    <Key
+        latin:keyLabel="f"
+        latin:keyHintLabel="6"
+        latin:additionalMoreKeys="6" />
+    <Key
+        latin:keyLabel="g"
+        latin:keyHintLabel="7"
+        latin:additionalMoreKeys="7"
+        latin:moreKeys="!text/more_keys_for_g" />
+    <Key
+        latin:keyLabel="c"
+        latin:keyHintLabel="8"
+        latin:additionalMoreKeys="8"
+        latin:moreKeys="!text/more_keys_for_c" />
+    <Key
+        latin:keyLabel="r"
+        latin:keyHintLabel="9"
+        latin:additionalMoreKeys="9"
+        latin:moreKeys="!text/more_keys_for_r" />
+    <Key
+        latin:keyLabel="l"
+        latin:keyHintLabel="0"
+        latin:additionalMoreKeys="0"
+        latin:moreKeys="!text/more_keys_for_l" />
+</merge>
diff --git a/java/res/xml/rowkeys_dvorak2.xml b/java/res/xml/rowkeys_dvorak2.xml
new file mode 100644
index 0000000000..943e3f549d
--- /dev/null
+++ b/java/res/xml/rowkeys_dvorak2.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyLabel="a"
+        latin:moreKeys="!text/more_keys_for_a" />
+    <Key
+        latin:keyLabel="o"
+        latin:moreKeys="!text/more_keys_for_o" />
+    <Key
+        latin:keyLabel="e"
+        latin:moreKeys="!text/more_keys_for_e" />
+    <Key
+        latin:keyLabel="u"
+        latin:moreKeys="!text/more_keys_for_u" />
+    <Key
+        latin:keyLabel="i"
+        latin:moreKeys="!text/more_keys_for_i" />
+    <Key
+        latin:keyLabel="d"
+        latin:moreKeys="!text/more_keys_for_d" />
+    <Key
+        latin:keyLabel="h"
+        latin:moreKeys="!text/more_keys_for_h" />
+    <Key
+        latin:keyLabel="t"
+        latin:moreKeys="!text/more_keys_for_t" />
+    <Key
+        latin:keyLabel="n"
+        latin:moreKeys="!text/more_keys_for_n" />
+    <Key
+        latin:keyLabel="s"
+        latin:moreKeys="!text/more_keys_for_s" />
+</merge>
diff --git a/java/res/xml/rowkeys_dvorak3.xml b/java/res/xml/rowkeys_dvorak3.xml
new file mode 100644
index 0000000000..b035f41cde
--- /dev/null
+++ b/java/res/xml/rowkeys_dvorak3.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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:keyLabel="j"
+        latin:moreKeys="!text/more_keys_for_j" />
+    <Key
+        latin:keyLabel="k"
+        latin:moreKeys="!text/more_keys_for_k" />
+    <Key
+        latin:keyLabel="x" />
+    <Key
+        latin:keyLabel="b" />
+    <Key
+        latin:keyLabel="m" />
+    <Key
+        latin:keyLabel="w"
+        latin:moreKeys="!text/more_keys_for_w" />
+    <Key
+        latin:keyLabel="v"
+        latin:moreKeys="!text/more_keys_for_v" />
+</merge>
diff --git a/java/res/xml/rows_dvorak.xml b/java/res/xml/rows_dvorak.xml
new file mode 100644
index 0000000000..8e3d071b01
--- /dev/null
+++ b/java/res/xml/rows_dvorak.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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/key_styles_common" />
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/keys_dvorak_123" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak1" />
+        </Row>
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak2" />
+    </Row>
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyStyle="shiftKeyStyle"
+            latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p" />
+        <include
+            latin:keyboardLayout="@xml/rowkeys_dvorak3" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillRight"
+            latin:visualInsetsLeft="1%p" />
+    </Row>
+    <include
+        latin:keyboardLayout="@xml/row_dvorak4" />
+</merge>
diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
index 28cec56e6e..1e405f9a25 100644
--- a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
+++ b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
@@ -28,10 +28,12 @@ public class AdditionalSubtype {
     public static final String QWERTY = "qwerty";
     public static final String QWERTZ = "qwertz";
     public static final String AZERTY = "azerty";
+    public static final String DVORAK = "dvorak";
     public static final String[] PREDEFINED_KEYBOARD_LAYOUT_SET = {
         QWERTY,
         QWERTZ,
-        AZERTY
+        AZERTY,
+        DVORAK
     };
 
     // Keyboard layout to subtype name resource id map.
@@ -42,6 +44,7 @@ public class AdditionalSubtype {
         sKeyboardLayoutToNameIdsMap.put(QWERTY, R.string.subtype_generic_qwerty);
         sKeyboardLayoutToNameIdsMap.put(QWERTZ, R.string.subtype_generic_qwertz);
         sKeyboardLayoutToNameIdsMap.put(AZERTY, R.string.subtype_generic_azerty);
+        sKeyboardLayoutToNameIdsMap.put(DVORAK, R.string.subtype_generic_dvorak);
     }
 
     private AdditionalSubtype() {
diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
index fc61932875..d291d1a2ef 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
@@ -115,7 +115,12 @@ public class SubtypeLocale {
     }
 
     public static String getKeyboardLayoutSetDisplayName(InputMethodSubtype subtype) {
-        return getKeyboardLayoutSetName(subtype).toUpperCase();
+        final String layoutName = getKeyboardLayoutSetName(subtype);
+        // TODO: This hack should be removed.
+        if (layoutName.equals(AdditionalSubtype.DVORAK)) {
+            return StringUtils.toTitleCase(layoutName, Locale.US);
+        }
+        return layoutName.toUpperCase();
     }
 
     public static String getKeyboardLayoutSetName(InputMethodSubtype subtype) {
-- 
GitLab