Merge "Add next/prev navigate action more keys and remove tab key"

main
Tadashi G. Takaoka 2012-02-21 23:09:58 -08:00 committed by Android (Google) Code Review
commit 1b3c16c183
22 changed files with 273 additions and 604 deletions

View File

@ -355,7 +355,8 @@
<enum name="phone" value="4" />
<enum name="number" value="5" />
</attr>
<attr name="navigateAction" format="boolean" />
<attr name="navigateNext" format="boolean" />
<attr name="navigatePrevious" format="boolean" />
<attr name="passwordInput" format="boolean" />
<attr name="clobberSettingsKey" format="boolean" />
<attr name="shortcutKeyEnabled" format="boolean" />

View File

@ -118,6 +118,8 @@
<string name="settings_as_more_key">\@icon/settingsKey|\@integer/key_settings</string>
<string name="keylabel_for_comma">,</string>
<string name="more_keys_for_comma"></string>
<string name="action_next_as_more_key">\@string/label_next_key|\@integer/key_action_next</string>
<string name="action_previous_as_more_key">\@string/label_previous_key|\@integer/key_action_previous</string>
<string name="keylabel_for_symbols_question">\?</string>
<string name="keylabel_for_symbols_semicolon">;</string>
<string name="keylabel_for_symbols_percent">%</string>

View File

@ -30,5 +30,7 @@
<integer name="key_settings">-5</integer>
<integer name="key_shortcut">-6</integer>
<integer name="key_action_enter">-7</integer>
<integer name="key_unspecified">-9</integer>
<integer name="key_action_next">-8</integer>
<integer name="key_action_previous">-9</integer>
<integer name="key_unspecified">-10</integer>
</resources>

View File

@ -73,7 +73,7 @@
latin:keyActionFlags="isRepeatable|noKeyPreview"
latin:backgroundType="functional" />
<include
latin:keyboardLayout="@xml/key_styles_enter_tablet" />
latin:keyboardLayout="@xml/key_styles_enter" />
<key-style
latin:styleName="spaceKeyStyle"
latin:code="@integer/key_space"
@ -102,12 +102,27 @@
latin:keyIcon="iconSettingsKey"
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
latin:backgroundType="functional" />
<switch>
<case
latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="tabKeyStyle"
latin:code="@integer/key_action_previous"
latin:keyIcon="iconTabKey"
latin:keyIconPreview="iconPreviewTabKey"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="tabKeyStyle"
latin:code="@integer/key_tab"
latin:keyIcon="iconTabKey"
latin:keyIconPreview="iconPreviewTabKey"
latin:backgroundType="functional" />
</default>
</switch>
<key-style
latin:styleName="toSymbolKeyStyle"
latin:code="@integer/key_switch_alpha_symbol"

View File

@ -72,7 +72,7 @@
latin:keyActionFlags="isRepeatable|noKeyPreview"
latin:backgroundType="functional" />
<include
latin:keyboardLayout="@xml/key_styles_enter_tablet" />
latin:keyboardLayout="@xml/key_styles_enter" />
<key-style
latin:styleName="spaceKeyStyle"
latin:code="@integer/key_space"
@ -101,12 +101,27 @@
latin:keyIcon="iconSettingsKey"
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
latin:backgroundType="functional" />
<switch>
<case
latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="tabKeyStyle"
latin:code="@integer/key_action_previous"
latin:keyLabel="@string/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" />
</case>
<default>
<key-style
latin:styleName="tabKeyStyle"
latin:code="@integer/key_tab"
latin:keyLabel="@string/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" />
</default>
</switch>
<key-style
latin:styleName="toSymbolKeyStyle"
latin:code="@integer/key_switch_alpha_symbol"

View File

@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<switch>
<case
latin:navigateAction="false"
>
<switch>
<case
latin:mode="url"
>
<Key
latin:keyLabel="/"
latin:keyStyle="f1PopupStyle" />
</case>
<case
latin:mode="email"
>
<Key
latin:keyLabel="\@"
latin:keyStyle="f1PopupStyle" />
</case>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
<!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1PopupStyle" />
</default>
</switch>
</case>
<!-- TODO: Remove dedicated navigation tab key. -->
<!-- navigateAction="true" -->
<default>
<switch>
<case
latin:mode="url"
>
<Key
latin:keyLabel="/"
latin:keyWidth="9.2%p"
latin:keyStyle="f1PopupStyle" />
</case>
<case
latin:mode="email"
>
<Key
latin:keyLabel="\@"
latin:keyWidth="9.2%p"
latin:keyStyle="f1PopupStyle" />
</case>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="9.2%p" />
</case>
<!-- hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1PopupStyle"
latin:keyWidth="9.2%p" />
</default>
</switch>
</default>
</switch>
</merge>

View File

@ -1,37 +0,0 @@
<?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"
>
<switch>
<case
latin:navigateAction="true"
>
<Key
latin:keyStyle="tabKeyStyle"
latin:keyWidth="9.2%p" />
</case>
<!-- hasSettingsKey="false" and navigateAction="false" -->
<default>
<!-- No key. -->
</default>
</switch>
</merge>

View File

@ -27,13 +27,13 @@
latin:clobberSettingsKey="true"
>
<key-style
latin:styleName="f1PopupStyle"
latin:styleName="f1MoreKeysStyle"
latin:backgroundType="functional" />
</case>
<!-- clobberSettingsKey="false" -->
<default>
<key-style
latin:styleName="f1PopupStyle"
latin:styleName="f1MoreKeysStyle"
latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/settings_as_more_key"
latin:backgroundType="functional" />
@ -77,7 +77,22 @@
latin:keyActionFlags="isRepeatable|noKeyPreview"
latin:backgroundType="functional" />
<include
latin:keyboardLayout="@xml/key_styles_enter_phone" />
latin:keyboardLayout="@xml/key_styles_enter" />
<switch>
<!-- Smiley in textShortMessage field.
Overrides common enter key style. -->
<case
latin:mode="im"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_smiley"
latin:backgroundType="functional" />
</case>
</switch>
<key-style
latin:styleName="spaceKeyStyle"
latin:code="@integer/key_space"
@ -91,7 +106,7 @@
latin:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
latin:altCode="@integer/key_space"
latin:parentStyle="f1PopupStyle" />
latin:parentStyle="f1MoreKeysStyle" />
<key-style
latin:styleName="settingsKeyStyle"
latin:code="@integer/key_settings"

View File

@ -21,6 +21,60 @@
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<!-- Navigate more keys style -->
<switch>
<case
latin:imeAction="actionNext"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_previous_as_more_key" />
</case>
<case
latin:imeAction="actionPrevious"
latin:navigateNext="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_next_as_more_key" />
</case>
<!-- imeAction!="actionNext" and imeAction!="actionPrevious" -->
<case
latin:navigateNext="true"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,\@string/action_previous_as_more_key,\@string/action_next_as_more_key" />
</case>
<case
latin:navigateNext="true"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_next_as_more_key" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_previous_as_more_key" />
</case>
<!-- naviagteNext="false" and navigatePrevious="false" -->
<default>
<key-style
latin:styleName="navigateMoreKeysStyle" />
</default>
</switch>
<!-- Enter key style -->
<key-style
latin:styleName="defaultEnterKeyStyle"
@ -28,7 +82,8 @@
latin:keyIcon="iconReturnKey"
latin:keyLabelFlags="autoXScale|preserveCase"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
latin:backgroundType="functional"
latin:parentStyle="navigateMoreKeysStyle" />
<key-style
latin:styleName="defaultActionKeyStyle"
latin:code="@integer/key_action_enter"
@ -45,18 +100,6 @@
latin:styleName="enterKeyStyle"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<!-- Smiley in textShortMessage field. -->
<case
latin:mode="im"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel=":-)"
latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_smiley"
latin:backgroundType="functional" />
</case>
<case
latin:imeAction="actionGo"
>

View File

@ -1,111 +0,0 @@
<?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"
>
<!-- Enter key style -->
<key-style
latin:styleName="defaultEnterKeyStyle"
latin:code="@integer/key_enter"
latin:keyIcon="iconReturnKey"
latin:keyLabelFlags="autoXScale|preserveCase"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
<key-style
latin:styleName="defaultActionKeyStyle"
latin:code="@integer/key_action_enter"
latin:keyIcon="iconUndefined"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
<switch>
<!-- Shift + Enter in textMultiLine field. -->
<case
latin:isMultiLine="true"
latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted"
>
<key-style
latin:styleName="enterKeyStyle"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionGo"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_go_key"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionNext"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_next_key"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionPrevious"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_previous_key"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionDone"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_done_key"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionSend"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_send_key"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionSearch"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyIcon="iconSearchKey"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<case
latin:imeAction="actionCustomLabel"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keyLabelFlags="fromCustomActionLabel"
latin:parentStyle="defaultActionKeyStyle" />
</case>
<!-- imeAction is either actionNone or actionUnspecified. -->
<default>
<key-style
latin:styleName="enterKeyStyle"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
</merge>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<switch>
<case
latin:navigateAction="false"
>
<switch>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
<!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1PopupStyle" />
</default>
</switch>
</case>
<!-- navigateAction="true" -->
<default>
<switch>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="9.2%p" />
</case>
<!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1PopupStyle"
latin:keyWidth="9.2%p" />
</default>
</switch>
</default>
</switch>
</merge>

View File

@ -23,16 +23,40 @@
>
<Row
latin:keyWidth="10%p"
>
<switch>
<case
latin:navigateAction="false"
>
<Key
latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="15%p" />
<include
latin:keyboardLayout="@xml/key_f1" />
<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"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
<!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" />
</default>
</switch>
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="50%p" />
@ -41,27 +65,5 @@
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</case>
<!-- TODO: Remove dedicated navigation tab key. -->
<!-- navigateAction="true" -->
<default>
<Key
latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="13.75%p" />
<include
latin:keyboardLayout="@xml/key_navigation_tab" />
<include
latin:keyboardLayout="@xml/key_f1" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="35.83%p" />
<Key
latin:keyStyle="punctuationKeyStyle"
latin:keyWidth="9.2%p" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</default>
</switch>
</Row>
</merge>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:keyWidth="10%p"
>
<switch>
<case
latin:navigateAction="false"
>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="15%p" />
<include
latin:keyboardLayout="@xml/key_symbols_f1" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="50%p" />
<Key
latin:keyStyle="punctuationKeyStyle" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</case>
<!-- TODO: Remove dedicated navigation tab key. -->
<!-- navigateAction="true" -->
<default>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="13.75%p" />
<include
latin:keyboardLayout="@xml/key_navigation_tab" />
<include
latin:keyboardLayout="@xml/key_f1" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="35.83%p" />
<Key
latin:keyStyle="punctuationKeyStyle"
latin:keyWidth="9.2%p" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</default>
</switch>
</Row>
</merge>

View File

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<Row
latin:keyWidth="10%p"
>
<switch>
<case
latin:navigateAction="false"
>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="15%p" />
<!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- latin:keyLabelFlags="hasPopupHint" -->
<!-- latin:moreKeys="&#x201F;" -->
<!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
<Key
latin:keyLabel="&#x201E;"
latin:backgroundType="functional" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="50%p" />
<!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
<Key
latin:keyLabel="&#x2026;"
latin:backgroundType="functional" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</case>
<!-- TODO: Remove dedicated navigation tab key. -->
<!-- navigateAction="true" -->
<default>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="13.75%p" />
<include
latin:keyboardLayout="@xml/key_navigation_tab" />
<!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- latin:keyLabelFlags="hasPopupHint" -->
<!-- latin:moreKeys="&#x201F;" -->
<!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
<Key
latin:keyLabel="&#x201E;"
latin:keyWidth="9.2%p"
latin:backgroundType="functional" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="35.83%p" />
<!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
<Key
latin:keyLabel="&#x2026;"
latin:keyWidth="9.2%p"
latin:backgroundType="functional" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</default>
</switch>
</Row>
</merge>

View File

@ -128,6 +128,35 @@
latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" />
</Row>
<include
latin:keyboardLayout="@xml/row_symbols4" />
<Row
latin:keyWidth="10%p"
>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="15%p" />
<switch>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
<!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" />
</default>
</switch>
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="50%p" />
<Key
latin:keyStyle="punctuationKeyStyle" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
</merge>

View File

@ -119,6 +119,29 @@
latin:keyWidth="fillRight"
latin:visualInsetsLeft="1%p" />
</Row>
<include
latin:keyboardLayout="@xml/row_symbols_shift4" />
<Row
latin:keyWidth="10%p"
>
<Key
latin:keyStyle="toAlphaKeyStyle"
latin:keyWidth="15%p" />
<!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
<!-- latin:keyLabelFlags="hasPopupHint" -->
<!-- latin:moreKeys="&#x201F;" -->
<!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
<Key
latin:keyLabel="&#x201E;"
latin:backgroundType="functional" />
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="50%p" />
<!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
<Key
latin:keyLabel="&#x2026;"
latin:backgroundType="functional" />
<Key
latin:keyStyle="enterKeyStyle"
latin:keyWidth="fillRight" />
</Row>
</merge>

View File

@ -39,30 +39,30 @@ public class EditorInfoCompatUtils {
private static final Integer OBJ_IME_ACTION_PREVIOUS = (Integer) CompatUtils
.getFieldValue(null, null, FIELD_IME_ACTION_PREVIOUS);
// EditorInfo.IME_FLAG_NAVIGATE_NEXT has been introduced since API#11 (Honeycomb).
public static boolean hasFlagNavigateNext(int imeOptions) {
if (OBJ_IME_FLAG_NAVIGATE_NEXT == null)
return false;
return (imeOptions & OBJ_IME_FLAG_NAVIGATE_NEXT) != 0;
}
// EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS has been introduced since API#11 (Honeycomb).
public static boolean hasFlagNavigatePrevious(int imeOptions) {
if (OBJ_IME_FLAG_NAVIGATE_PREVIOUS == null)
return false;
return (imeOptions & OBJ_IME_FLAG_NAVIGATE_PREVIOUS) != 0;
}
// EditorInfo.IME_FLAG_FORCE_ASCII has been introduced since API#16 (JellyBean).
public static boolean hasFlagForceAscii(int imeOptions) {
if (OBJ_IME_FLAG_FORCE_ASCII == null)
return false;
return (imeOptions & OBJ_IME_FLAG_FORCE_ASCII) != 0;
}
public static void performEditorActionNext(InputConnection ic) {
ic.performEditorAction(EditorInfo.IME_ACTION_NEXT);
}
// EditorInfo.IME_ACTION_PREVIOUS has been introduced since API#11 (Honeycomb).
public static void performEditorActionPrevious(InputConnection ic) {
if (OBJ_IME_ACTION_PREVIOUS == null)
if (OBJ_IME_ACTION_PREVIOUS == null || ic == null)
return;
ic.performEditorAction(OBJ_IME_ACTION_PREVIOUS);
}

View File

@ -99,8 +99,10 @@ public class Keyboard {
public static final int CODE_SETTINGS = -5;
public static final int CODE_SHORTCUT = -6;
public static final int CODE_ACTION_ENTER = -7;
public static final int CODE_ACTION_NEXT = -8;
public static final int CODE_ACTION_PREVIOUS = -9;
// Code value representing the code is not specified.
public static final int CODE_UNSPECIFIED = -9;
public static final int CODE_UNSPECIFIED = -10;
public final KeyboardId mId;
public final int mThemeId;
@ -381,6 +383,8 @@ public class Keyboard {
case CODE_SETTINGS: return "settings";
case CODE_SHORTCUT: return "shortcut";
case CODE_ACTION_ENTER: return "actionEnter";
case CODE_ACTION_NEXT: return "actionNext";
case CODE_ACTION_PREVIOUS: return "actionPrevious";
case CODE_UNSPECIFIED: return "unspec";
case CODE_TAB: return "tab";
case CODE_ENTER: return "enter";
@ -1069,8 +1073,10 @@ public class Keyboard {
KeyboardId.elementIdToName(id.mElementId));
final boolean modeMatched = matchTypedValue(a,
R.styleable.Keyboard_Case_mode, id.mMode, KeyboardId.modeName(id.mMode));
final boolean navigateActionMatched = matchBoolean(a,
R.styleable.Keyboard_Case_navigateAction, id.navigateAction());
final boolean navigateNextMatched = matchBoolean(a,
R.styleable.Keyboard_Case_navigateNext, id.navigateNext());
final boolean navigatePreviousMatched = matchBoolean(a,
R.styleable.Keyboard_Case_navigatePrevious, id.navigatePrevious());
final boolean passwordInputMatched = matchBoolean(a,
R.styleable.Keyboard_Case_passwordInput, id.passwordInput());
final boolean clobberSettingsKeyMatched = matchBoolean(a,
@ -1090,30 +1096,32 @@ public class Keyboard {
final boolean countryCodeMatched = matchString(a,
R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry());
final boolean selected = keyboardSetElementMatched && modeMatched
&& navigateActionMatched && passwordInputMatched
&& navigateNextMatched && navigatePreviousMatched && passwordInputMatched
&& clobberSettingsKeyMatched && shortcutKeyEnabledMatched
&& hasShortcutKeyMatched && isMultiLineMatched && imeActionMatched
&& localeCodeMatched && languageCodeMatched && countryCodeMatched;
if (DEBUG) {
startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE,
startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE,
textAttr(a.getString(R.styleable.Keyboard_Case_keyboardSetElement),
"keyboardSetElement"),
textAttr(a.getString(R.styleable.Keyboard_Case_mode), "mode"),
booleanAttr(a, R.styleable.Keyboard_Case_navigateAction,
"navigateAction"),
booleanAttr(a, R.styleable.Keyboard_Case_passwordInput,
"passwordInput"),
textAttr(a.getString(R.styleable.Keyboard_Case_imeAction),
"imeAction"),
booleanAttr(a, R.styleable.Keyboard_Case_navigateNext,
"navigateNext"),
booleanAttr(a, R.styleable.Keyboard_Case_navigatePrevious,
"navigatePrevious"),
booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey,
"clobberSettingsKey"),
booleanAttr(a, R.styleable.Keyboard_Case_passwordInput,
"passwordInput"),
booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled,
"shortcutKeyEnabled"),
booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey,
"hasShortcutKey"),
booleanAttr(a, R.styleable.Keyboard_Case_isMultiLine,
"isMultiLine"),
textAttr(a.getString(R.styleable.Keyboard_Case_imeAction),
"imeAction"),
textAttr(a.getString(R.styleable.Keyboard_Case_localeCode),
"localeCode"),
textAttr(a.getString(R.styleable.Keyboard_Case_languageCode),

View File

@ -87,7 +87,6 @@ public class KeyboardId {
id.mElementId,
id.mMode,
id.mWidth,
id.navigateAction(),
id.passwordInput(),
id.mClobberSettingsKey,
id.mShortcutKeyEnabled,
@ -95,6 +94,8 @@ public class KeyboardId {
id.isMultiLine(),
id.imeAction(),
id.mCustomActionLabel,
id.navigateNext(),
id.navigatePrevious(),
id.mLocale
});
}
@ -106,7 +107,6 @@ public class KeyboardId {
&& other.mElementId == this.mElementId
&& other.mMode == this.mMode
&& other.mWidth == this.mWidth
&& other.navigateAction() == this.navigateAction()
&& other.passwordInput() == this.passwordInput()
&& other.mClobberSettingsKey == this.mClobberSettingsKey
&& other.mShortcutKeyEnabled == this.mShortcutKeyEnabled
@ -114,6 +114,8 @@ public class KeyboardId {
&& other.isMultiLine() == this.isMultiLine()
&& other.imeAction() == this.imeAction()
&& TextUtils.equals(other.mCustomActionLabel, this.mCustomActionLabel)
&& other.navigateNext() == this.navigateNext()
&& other.navigatePrevious() == this.navigatePrevious()
&& other.mLocale.equals(this.mLocale);
}
@ -146,12 +148,12 @@ public class KeyboardId {
return mElementId == ELEMENT_PHONE_SYMBOLS;
}
public boolean navigateAction() {
// Note: Turn off checking navigation flag to show TAB key for now.
boolean navigateAction = InputTypeCompatUtils.isWebInputType(mEditorInfo.inputType);
// || EditorInfoCompatUtils.hasFlagNavigateNext(mImeOptions)
// || EditorInfoCompatUtils.hasFlagNavigatePrevious(mImeOptions);
return navigateAction;
public boolean navigateNext() {
return EditorInfoCompatUtils.hasFlagNavigateNext(mEditorInfo.imeOptions);
}
public boolean navigatePrevious() {
return EditorInfoCompatUtils.hasFlagNavigatePrevious(mEditorInfo.imeOptions);
}
public boolean passwordInput() {
@ -165,15 +167,21 @@ public class KeyboardId {
}
public int imeAction() {
final int actionId = mEditorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
if ((mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
return EditorInfo.IME_ACTION_NONE;
} else if (mEditorInfo.actionLabel != null) {
return IME_ACTION_CUSTOM_LABEL;
} else {
return mEditorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
return actionId;
}
}
public int imeActionId() {
final int actionId = imeAction();
return actionId == IME_ACTION_CUSTOM_LABEL ? mEditorInfo.actionId : actionId;
}
@Override
public boolean equals(Object other) {
return other instanceof KeyboardId && equals((KeyboardId) other);
@ -186,17 +194,19 @@ public class KeyboardId {
@Override
public String toString() {
return String.format("[%s %s %s%d %s %s %s%s%s%s%s]",
return String.format("[%s %s %s%d %s %s %s%s%s%s%s%s%s]",
elementIdToName(mElementId),
mLocale,
(mOrientation == 1 ? "port" : "land"), mWidth,
modeName(mMode),
imeAction(),
(navigateNext() ? "navigateNext" : ""),
(navigatePrevious() ? "navigatePrevious" : ""),
(mClobberSettingsKey ? " clobberSettingsKey" : ""),
(navigateAction() ? " navigateAction" : ""),
(passwordInput() ? " passwordInput" : ""),
(mShortcutKeyEnabled ? " shortcutKeyEnabled" : ""),
(mHasShortcutKey ? " hasShortcutKey" : "")
(mHasShortcutKey ? " hasShortcutKey" : ""),
(isMultiLine() ? "isMultiLine" : "")
);
}

View File

@ -163,10 +163,10 @@ public class KeyStyles {
if (DEBUG) {
Log.d(TAG, String.format("<%s styleName=%s />",
Keyboard.Builder.TAG_KEY_STYLE, styleName));
}
if (mStyles.containsKey(styleName)) {
throw new XmlParseUtils.ParseException(
"duplicate key style declared: " + styleName, parser);
Log.d(TAG, "key-style " + styleName + " is overridden at "
+ parser.getPositionDescription());
}
}
final DeclaredKeyStyle style = new DeclaredKeyStyle();

View File

@ -1246,11 +1246,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE);
}
private static int getEditorActionId(EditorInfo editorInfo) {
if (editorInfo == null) return 0;
return (editorInfo.actionLabel != null)
? editorInfo.actionId
: (editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION);
private static int getActionId(Keyboard keyboard) {
return keyboard != null ? keyboard.mId.imeActionId() : EditorInfo.IME_ACTION_NONE;
}
private void performeEditorAction(int actionId) {
@ -1316,18 +1313,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mSubtypeSwitcher.switchToShortcutIME();
break;
case Keyboard.CODE_ACTION_ENTER:
performeEditorAction(getEditorActionId(getCurrentInputEditorInfo()));
performeEditorAction(getActionId(switcher.getKeyboard()));
break;
case Keyboard.CODE_TAB:
handleTab();
// There are two cases for tab. Either we send a "next" event, that may change the
// focus but will never move the cursor. Or, we send a real tab keycode, which some
// applications may accept or ignore, and we don't know whether this will move the
// cursor or not. So actually, we don't really know.
// So to go with the safer option, we'd rather behave as if the user moved the
// cursor when they didn't than the opposite. We also expect that most applications
// will actually use tab only for focus movement.
// To sum it up: do not update mExpectingUpdateSelection here.
case Keyboard.CODE_ACTION_NEXT:
performeEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
case Keyboard.CODE_ACTION_PREVIOUS:
EditorInfoCompatUtils.performEditorActionPrevious(getCurrentInputConnection());
break;
default:
mSpaceState = SPACE_STATE_NONE;
@ -1494,30 +1486,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
}
// TODO: Implement next and previous actions using other key code than tab's code.
private void handleTab() {
final int imeOptions = getCurrentInputEditorInfo().imeOptions;
if (!EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions)
&& !EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions)) {
// TODO: This should be {@link #sendKeyCodePoint(int)}.
sendDownUpKeyEvents(KeyEvent.KEYCODE_TAB);
return;
}
final InputConnection ic = getCurrentInputConnection();
if (ic == null)
return;
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
// True if keyboard is in either shift chording or manual shifted state.
final boolean isManualShifted = (keyboard != null && keyboard.isManualShifted());
if (EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions) && !isManualShifted) {
EditorInfoCompatUtils.performEditorActionNext(ic);
} else if (EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions) && isManualShifted) {
EditorInfoCompatUtils.performEditorActionPrevious(ic);
}
}
// ic may be null
private boolean maybeStripSpaceWhileInBatchEdit(final InputConnection ic, final int code,
final int spaceState, final boolean isFromSuggestionStrip) {

View File

@ -27,8 +27,7 @@ public class XmlParseUtils {
@SuppressWarnings("serial")
public static class ParseException extends XmlPullParserException {
public ParseException(String msg, XmlPullParser parser) {
super(msg + " at line " + parser.getLineNumber()
+ ", column " + parser.getColumnNumber());
super(msg + " at " + parser.getPositionDescription());
}
}