Settings key always exists in more keys of shortcut/f1 key
This change also * Fix comman/f1 key for Arabic keyboard. * Removes "show settings key option" and related stuff. * Renames and simplifies F2 key to shortcut key on 7 inch tablet. Change-Id: Ib1cf99ad00d9780a2f0d170260e756771e161521
This commit is contained in:
parent
fed72d6038
commit
97bde43740
36 changed files with 154 additions and 329 deletions
|
@ -70,17 +70,13 @@
|
|||
<!-- U+066B: "٫" ARABIC DECIMAL SEPARATOR
|
||||
U+066C: "٬" ARABIC THOUSANDS SEPARATOR -->
|
||||
<string name="additional_more_keys_for_symbols_0">0,٫,٬</string>
|
||||
<!-- U+060C: "،" ARABIC COMMA -->
|
||||
<string name="keylabel_for_comma">،</string>
|
||||
<string name="keylabel_for_f1">،</string>
|
||||
<string name="more_keys_for_comma">"\\,"</string>
|
||||
<string name="keylabel_for_symbols_question">؟</string>
|
||||
<string name="keylabel_for_symbols_semicolon">؛</string>
|
||||
<!-- U+066A: "٪" ARABIC PERCENT SIGN -->
|
||||
<string name="keylabel_for_symbols_percent">٪</string>
|
||||
<string name="more_keys_for_comma">,</string>
|
||||
<!-- U+060C: "،" ARABIC COMMA -->
|
||||
<string name="more_keys_for_f1">،</string>
|
||||
<string name="more_keys_for_f1_settings">\\,,\@icon/settingsKey|\@integer/key_settings</string>
|
||||
<string name="more_keys_for_f1_navigate">\\,,\@icon/tabKey|\@integer/key_tab</string>
|
||||
<string name="more_keys_for_symbols_question">\?</string>
|
||||
<string name="more_keys_for_symbols_semicolon">;</string>
|
||||
<!-- U+2030: "‰" PER MILLE SIGN -->
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<bool name="config_enable_show_settings_key_option">true</bool>
|
||||
<bool name="config_default_show_settings_key">false</bool>
|
||||
<bool name="config_enable_show_voice_key_option">false</bool>
|
||||
<bool name="config_enable_show_popup_on_keypress_option">false</bool>
|
||||
<bool name="config_enable_bigram_suggestions_option">false</bool>
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<bool name="config_enable_show_settings_key_option">false</bool>
|
||||
<bool name="config_default_show_settings_key">true</bool>
|
||||
<bool name="config_enable_show_voice_key_option">false</bool>
|
||||
<bool name="config_enable_show_popup_on_keypress_option">false</bool>
|
||||
<bool name="config_enable_bigram_suggestions_option">false</bool>
|
||||
|
|
|
@ -357,14 +357,6 @@
|
|||
</attr>
|
||||
<attr name="navigateAction" format="boolean" />
|
||||
<attr name="passwordInput" format="boolean" />
|
||||
<attr name="hasSettingsKey" format="boolean" />
|
||||
<!-- This should be aligned with KeyboardID.F2KEY_MODE_* -->
|
||||
<attr name="f2KeyMode" format="enum">
|
||||
<enum name="none" value="0" />
|
||||
<enum name="settings" value="1" />
|
||||
<enum name="shortcutIme" value="2" />
|
||||
<enum name="shortcutImeOrSettings" value="3" />
|
||||
</attr>
|
||||
<attr name="clobberSettingsKey" format="boolean" />
|
||||
<attr name="shortcutKeyEnabled" format="boolean" />
|
||||
<attr name="hasShortcutKey" format="boolean" />
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
<resources>
|
||||
<bool name="config_use_fullscreen_mode">false</bool>
|
||||
<bool name="config_enable_show_settings_key_option">true</bool>
|
||||
<bool name="config_default_show_settings_key">false</bool>
|
||||
<bool name="config_enable_show_voice_key_option">true</bool>
|
||||
<bool name="config_enable_show_popup_on_keypress_option">true</bool>
|
||||
<bool name="config_enable_bigram_suggestions_option">true</bool>
|
||||
|
|
|
@ -115,15 +115,12 @@
|
|||
<!-- U+207F: "ⁿ" SUPERSCRIPT LATIN SMALL LETTER N
|
||||
U+2205: "∅" EMPTY SET -->
|
||||
<string name="more_keys_for_symbols_0">ⁿ,∅</string>
|
||||
<string name="settings_as_more_key">\@icon/settingsKey|\@integer/key_settings</string>
|
||||
<string name="keylabel_for_comma">,</string>
|
||||
<string name="keylabel_for_f1">,</string>
|
||||
<string name="more_keys_for_comma"></string>
|
||||
<string name="keylabel_for_symbols_question">\?</string>
|
||||
<string name="keylabel_for_symbols_semicolon">;</string>
|
||||
<string name="keylabel_for_symbols_percent">%</string>
|
||||
<string name="more_keys_for_comma"></string>
|
||||
<string name="more_keys_for_f1"></string>
|
||||
<string name="more_keys_for_f1_settings">\@icon/settingsKey|\@integer/key_settings</string>
|
||||
<string name="more_keys_for_f1_navigate">\@icon/tabKey|\@integer/key_tab</string>
|
||||
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
|
||||
<string name="more_keys_for_symbols_question">¿</string>
|
||||
<string name="more_keys_for_symbols_semicolon"></string>
|
||||
|
|
|
@ -95,9 +95,6 @@
|
|||
<string name="prefs_suggestion_visibility_show_only_portrait_name">Show on portrait mode</string>
|
||||
<string name="prefs_suggestion_visibility_hide_name">Always hide</string>
|
||||
|
||||
<!-- Option to show/hide the settings key -->
|
||||
<string name="prefs_settings_key">Show settings key</string>
|
||||
|
||||
<!-- Option to decide the auto correction threshold score -->
|
||||
<!-- Option to enable auto correction [CHAR LIMIT=20]-->
|
||||
<string name="auto_correction">Auto correction</string>
|
||||
|
|
|
@ -1,73 +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:f2KeyMode="settings"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<case
|
||||
latin:f2KeyMode="shortcutIme"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:shortcutKeyEnabled="true"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="shortcutKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<!-- shortcutKeyEnabled="false" -->
|
||||
<default>
|
||||
<Spacer />
|
||||
</default>
|
||||
</switch>
|
||||
</case>
|
||||
<case
|
||||
latin:f2KeyMode="shortcutImeOrSettings"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:shortcutKeyEnabled="true"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="shortcutKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<!-- shortcutKeyEnabled="false" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</default>
|
||||
</switch>
|
||||
</case>
|
||||
<!-- f2KeyMode="none" -->
|
||||
<default>
|
||||
<Spacer />
|
||||
</default>
|
||||
</switch>
|
||||
</merge>
|
56
java/res/xml-sw600dp/key_shortcut.xml
Normal file
56
java/res/xml-sw600dp/key_shortcut.xml
Normal file
|
@ -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"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:shortcutKeyEnabled="true"
|
||||
latin:clobberSettingsKey="false"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="shortcutKeyStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/settings_as_more_key"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<case
|
||||
latin:shortcutKeyEnabled="true"
|
||||
latin:clobberSettingsKey="true"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="shortcutKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<case
|
||||
latin:shortcutKeyEnabled="false"
|
||||
latin:clobberSettingsKey="false"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<!-- shortcutKeyEnabled="false" clobberSettingsKey="true" -->
|
||||
<default>
|
||||
<Spacer />
|
||||
</default>
|
||||
</switch>
|
||||
</merge>
|
|
@ -21,23 +21,6 @@
|
|||
<merge
|
||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<!-- Base key style for the key which may have settings key as popup key -->
|
||||
<switch>
|
||||
<case
|
||||
latin:clobberSettingsKey="true"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="f2PopupStyle"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<default>
|
||||
<key-style
|
||||
latin:styleName="f2PopupStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="\@icon/settingsKey|\@integer/key_settings"
|
||||
latin:backgroundType="functional" />
|
||||
</default>
|
||||
</switch>
|
||||
<switch>
|
||||
<case
|
||||
latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted"
|
||||
|
@ -112,7 +95,7 @@
|
|||
latin:keyIconDisabled="iconDisabledShortcutKey"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
|
||||
latin:parentStyle="f2PopupStyle" />
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="settingsKeyStyle"
|
||||
latin:code="@integer/key_settings"
|
||||
|
|
|
@ -71,6 +71,6 @@
|
|||
latin:keyXPos="-10.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
|
@ -133,6 +133,6 @@
|
|||
latin:keyXPos="-11.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
|
@ -76,6 +76,6 @@
|
|||
latin:keyXPos="-11.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
|
@ -127,6 +127,6 @@
|
|||
latin:keyXPos="-11.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
|
@ -167,6 +167,6 @@
|
|||
latin:keyXPos="-10.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
|
@ -148,6 +148,6 @@
|
|||
latin:keyXPos="-10.00%p"
|
||||
latin:keyWidth="0%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f2" />
|
||||
latin:keyboardLayout="@xml/key_shortcut" />
|
||||
</Row>
|
||||
</merge>
|
||||
|
|
35
java/res/xml-sw768dp/key_settings.xml
Normal file
35
java/res/xml-sw768dp/key_settings.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?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:clobberSettingsKey="false"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle" />
|
||||
</case>
|
||||
<default>
|
||||
<Spacer />
|
||||
</default>
|
||||
</switch>
|
||||
</merge>
|
|
@ -24,15 +24,8 @@
|
|||
<Row
|
||||
latin:keyWidth="8.047%p"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="true"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
</switch>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings" />
|
||||
<Spacer
|
||||
latin:keyXPos="15.157%p"
|
||||
latin:keyWidth="0%p" />
|
||||
|
|
|
@ -115,18 +115,9 @@
|
|||
latin:keyWidth="0%p" />
|
||||
</Row>
|
||||
<Row>
|
||||
<switch>
|
||||
<case latin:hasSettingsKey="true">
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
<default>
|
||||
<!-- Note: This Spacer prevents the below key from being marked as a left edge key. -->
|
||||
<Spacer
|
||||
latin:keyWidth="8.047%p" />
|
||||
</default>
|
||||
</switch>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings"
|
||||
latin:keyWidth="8.047%p" />
|
||||
<Key
|
||||
latin:keyStyle="nonSpecialBackgroundSpaceKeyStyle"
|
||||
latin:keyXPos="13.829%p"
|
||||
|
|
|
@ -110,18 +110,9 @@
|
|||
latin:keyWidth="0%p" />
|
||||
</Row>
|
||||
<Row>
|
||||
<switch>
|
||||
<case latin:hasSettingsKey="true">
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
<default>
|
||||
<!-- Note: This Spacer prevents the below key from being marked as a left edge key. -->
|
||||
<Spacer
|
||||
latin:keyWidth="8.047%p" />
|
||||
</default>
|
||||
</switch>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings"
|
||||
latin:keyWidth="8.047%p" />
|
||||
<Key
|
||||
latin:keyStyle="nonSpecialBackgroundSpaceKeyStyle"
|
||||
latin:keyXPos="13.829%p"
|
||||
|
|
|
@ -155,15 +155,8 @@
|
|||
<Row
|
||||
latin:keyWidth="8.047%p"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="true"
|
||||
>
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
</switch>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings" />
|
||||
<Key
|
||||
latin:keyLabel="/"
|
||||
latin:keyXPos="15.157%p" />
|
||||
|
|
|
@ -145,13 +145,8 @@
|
|||
<Row
|
||||
latin:keyWidth="8.047%p"
|
||||
>
|
||||
<switch>
|
||||
<case latin:hasSettingsKey="true">
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
</switch>
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings" />
|
||||
<Key
|
||||
latin:keyStyle="spaceKeyStyle"
|
||||
latin:keyXPos="31.250%p"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
latin:navigateAction="false"
|
||||
>
|
||||
<switch>
|
||||
|
@ -51,11 +50,14 @@
|
|||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:additionalMoreKeys="@string/more_keys_for_comma"
|
||||
latin:keyStyle="f1PopupStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
</case>
|
||||
<!-- hasSettingsKey="true" or navigateAction="true" -->
|
||||
<!-- TODO: Remove dedicated navigation tab key. -->
|
||||
<!-- navigateAction="true" -->
|
||||
<default>
|
||||
<switch>
|
||||
<case
|
||||
|
@ -85,9 +87,10 @@
|
|||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:keyWidth="9.2%p"
|
||||
latin:keyStyle="f1PopupStyle" />
|
||||
</default>
|
||||
latin:additionalMoreKeys="@string/more_keys_for_comma"
|
||||
latin:keyStyle="f1PopupStyle"
|
||||
latin:keyWidth="9.2%p" />
|
||||
</default>
|
||||
</switch>
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -22,17 +22,6 @@
|
|||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="true"
|
||||
>
|
||||
<!-- Because this settings key is not adjacent to the space key, this key should be
|
||||
just ignored while typing (altCode=CODE_UNSPECIFIED). -->
|
||||
<Key
|
||||
latin:keyStyle="settingsKeyStyle"
|
||||
latin:altCode="@integer/key_unspecified"
|
||||
latin:keyWidth="9.2%p" />
|
||||
</case>
|
||||
<!-- hasSettingsKey="false" -->
|
||||
<case
|
||||
latin:navigateAction="true"
|
||||
>
|
|
@ -28,36 +28,14 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="f1PopupStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_f1"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<!-- clobberSettingsKey="false -->
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="f1PopupStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_f1_settings"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<!-- clobberSettingsKey="false" hasSettingsKey="true" -->
|
||||
<case
|
||||
latin:navigateAction="true"
|
||||
>
|
||||
<key-style
|
||||
latin:styleName="f1PopupStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_f1_navigate"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<!-- clobberSettingsKey="false" and hasSettingsKey="true" navigateAction="false" -->
|
||||
<!-- clobberSettingsKey="false" -->
|
||||
<default>
|
||||
<key-style
|
||||
latin:styleName="f1PopupStyle"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_f1"
|
||||
latin:moreKeys="@string/settings_as_more_key"
|
||||
latin:backgroundType="functional" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
latin:navigateAction="false"
|
||||
>
|
||||
<switch>
|
||||
|
@ -36,12 +35,14 @@
|
|||
<!-- latin:hasShortcutKey="false" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_f1"
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:additionalMoreKeys="@string/more_keys_for_comma"
|
||||
latin:keyStyle="f1PopupStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
</case>
|
||||
<!-- hasSettingsKey="true" or navigateAction="true" -->
|
||||
<!-- navigateAction="true" -->
|
||||
<default>
|
||||
<switch>
|
||||
<case
|
||||
|
@ -54,10 +55,12 @@
|
|||
<!-- latin:hasShortcutKey="false" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_f1"
|
||||
latin:keyWidth="9.2%p"
|
||||
latin:keyStyle="f1PopupStyle" />
|
||||
</default>
|
||||
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>
|
||||
|
|
|
@ -44,11 +44,6 @@
|
|||
android:title="@string/popup_on_keypress"
|
||||
android:persistent="true"
|
||||
android:defaultValue="@bool/config_default_popup_preview" />
|
||||
<CheckBoxPreference
|
||||
android:key="show_settings_key"
|
||||
android:title="@string/prefs_settings_key"
|
||||
android:persistent="true"
|
||||
android:defaultValue="@bool/config_default_show_settings_key" />
|
||||
<ListPreference
|
||||
android:key="voice_mode"
|
||||
android:title="@string/voice_input"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
latin:navigateAction="false"
|
||||
>
|
||||
<Key
|
||||
|
@ -43,13 +42,14 @@
|
|||
latin:keyStyle="enterKeyStyle"
|
||||
latin:keyWidth="fillRight" />
|
||||
</case>
|
||||
<!-- hasSettingsKey="true" or navigateAction="true" -->
|
||||
<!-- TODO: Remove dedicated navigation tab key. -->
|
||||
<!-- navigateAction="true" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyStyle="toSymbolKeyStyle"
|
||||
latin:keyWidth="13.75%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings_or_tab" />
|
||||
latin:keyboardLayout="@xml/key_navigation_tab" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f1" />
|
||||
<Key
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
latin:navigateAction="false"
|
||||
>
|
||||
<Key
|
||||
|
@ -43,13 +42,14 @@
|
|||
latin:keyStyle="enterKeyStyle"
|
||||
latin:keyWidth="fillRight" />
|
||||
</case>
|
||||
<!-- hasSettingsKey="true" or navigateAction="true" -->
|
||||
<!-- TODO: Remove dedicated navigation tab key. -->
|
||||
<!-- navigateAction="true" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyStyle="toAlphaKeyStyle"
|
||||
latin:keyWidth="13.75%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings_or_tab" />
|
||||
latin:keyboardLayout="@xml/key_navigation_tab" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_f1" />
|
||||
<Key
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
>
|
||||
<switch>
|
||||
<case
|
||||
latin:hasSettingsKey="false"
|
||||
latin:navigateAction="false"
|
||||
>
|
||||
<Key
|
||||
|
@ -51,13 +50,14 @@
|
|||
latin:keyStyle="enterKeyStyle"
|
||||
latin:keyWidth="fillRight" />
|
||||
</case>
|
||||
<!-- hasSettingsKey="true" or navigateAction="true" -->
|
||||
<!-- TODO: Remove dedicated navigation tab key. -->
|
||||
<!-- navigateAction="true" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyStyle="toAlphaKeyStyle"
|
||||
latin:keyWidth="13.75%p" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_settings_or_tab" />
|
||||
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" -->
|
||||
|
|
|
@ -1073,10 +1073,6 @@ public class Keyboard {
|
|||
R.styleable.Keyboard_Case_navigateAction, id.navigateAction());
|
||||
final boolean passwordInputMatched = matchBoolean(a,
|
||||
R.styleable.Keyboard_Case_passwordInput, id.passwordInput());
|
||||
final boolean hasSettingsKeyMatched = matchBoolean(a,
|
||||
R.styleable.Keyboard_Case_hasSettingsKey, id.hasSettingsKey());
|
||||
final boolean f2KeyModeMatched = matchInteger(a,
|
||||
R.styleable.Keyboard_Case_f2KeyMode, id.f2KeyMode());
|
||||
final boolean clobberSettingsKeyMatched = matchBoolean(a,
|
||||
R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey);
|
||||
final boolean shortcutKeyEnabledMatched = matchBoolean(a,
|
||||
|
@ -1094,14 +1090,13 @@ public class Keyboard {
|
|||
final boolean countryCodeMatched = matchString(a,
|
||||
R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry());
|
||||
final boolean selected = keyboardSetElementMatched && modeMatched
|
||||
&& navigateActionMatched && passwordInputMatched && hasSettingsKeyMatched
|
||||
&& f2KeyModeMatched && clobberSettingsKeyMatched
|
||||
&& shortcutKeyEnabledMatched && hasShortcutKeyMatched && isMultiLineMatched
|
||||
&& imeActionMatched && localeCodeMatched && languageCodeMatched
|
||||
&& countryCodeMatched;
|
||||
&& navigateActionMatched && 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%s>%s", TAG_CASE,
|
||||
startTag("<%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"),
|
||||
|
@ -1109,11 +1104,6 @@ public class Keyboard {
|
|||
"navigateAction"),
|
||||
booleanAttr(a, R.styleable.Keyboard_Case_passwordInput,
|
||||
"passwordInput"),
|
||||
booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey,
|
||||
"hasSettingsKey"),
|
||||
textAttr(KeyboardId.f2KeyModeName(
|
||||
a.getInt(R.styleable.Keyboard_Case_f2KeyMode, -1)),
|
||||
"f2KeyMode"),
|
||||
booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey,
|
||||
"clobberSettingsKey"),
|
||||
booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled,
|
||||
|
|
|
@ -48,11 +48,6 @@ public class KeyboardId {
|
|||
public static final int ELEMENT_PHONE_SYMBOLS = 8;
|
||||
public static final int ELEMENT_NUMBER = 9;
|
||||
|
||||
private static final int F2KEY_MODE_NONE = 0;
|
||||
private static final int F2KEY_MODE_SETTINGS = 1;
|
||||
private static final int F2KEY_MODE_SHORTCUT_IME = 2;
|
||||
private static final int F2KEY_MODE_SHORTCUT_IME_OR_SETTINGS = 3;
|
||||
|
||||
private static final int IME_ACTION_CUSTOM_LABEL = EditorInfo.IME_MASK_ACTION + 1;
|
||||
|
||||
public final Locale mLocale;
|
||||
|
@ -61,7 +56,6 @@ public class KeyboardId {
|
|||
public final int mMode;
|
||||
public final int mElementId;
|
||||
private final EditorInfo mEditorInfo;
|
||||
private final boolean mSettingsKeyEnabled;
|
||||
public final boolean mClobberSettingsKey;
|
||||
public final boolean mShortcutKeyEnabled;
|
||||
public final boolean mHasShortcutKey;
|
||||
|
@ -70,15 +64,14 @@ public class KeyboardId {
|
|||
private final int mHashCode;
|
||||
|
||||
public KeyboardId(int elementId, Locale locale, int orientation, int width, int mode,
|
||||
EditorInfo editorInfo, boolean settingsKeyEnabled, boolean clobberSettingsKey,
|
||||
boolean shortcutKeyEnabled, boolean hasShortcutKey) {
|
||||
EditorInfo editorInfo, boolean clobberSettingsKey, boolean shortcutKeyEnabled,
|
||||
boolean hasShortcutKey) {
|
||||
this.mLocale = locale;
|
||||
this.mOrientation = orientation;
|
||||
this.mWidth = width;
|
||||
this.mMode = mode;
|
||||
this.mElementId = elementId;
|
||||
this.mEditorInfo = editorInfo;
|
||||
this.mSettingsKeyEnabled = settingsKeyEnabled;
|
||||
this.mClobberSettingsKey = clobberSettingsKey;
|
||||
this.mShortcutKeyEnabled = shortcutKeyEnabled;
|
||||
this.mHasShortcutKey = hasShortcutKey;
|
||||
|
@ -96,7 +89,6 @@ public class KeyboardId {
|
|||
id.mWidth,
|
||||
id.navigateAction(),
|
||||
id.passwordInput(),
|
||||
id.mSettingsKeyEnabled,
|
||||
id.mClobberSettingsKey,
|
||||
id.mShortcutKeyEnabled,
|
||||
id.mHasShortcutKey,
|
||||
|
@ -116,7 +108,6 @@ public class KeyboardId {
|
|||
&& other.mWidth == this.mWidth
|
||||
&& other.navigateAction() == this.navigateAction()
|
||||
&& other.passwordInput() == this.passwordInput()
|
||||
&& other.mSettingsKeyEnabled == this.mSettingsKeyEnabled
|
||||
&& other.mClobberSettingsKey == this.mClobberSettingsKey
|
||||
&& other.mShortcutKeyEnabled == this.mShortcutKeyEnabled
|
||||
&& other.mHasShortcutKey == this.mHasShortcutKey
|
||||
|
@ -183,25 +174,6 @@ public class KeyboardId {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean hasSettingsKey() {
|
||||
return mSettingsKeyEnabled && !mClobberSettingsKey;
|
||||
}
|
||||
|
||||
public int f2KeyMode() {
|
||||
if (mClobberSettingsKey) {
|
||||
// Never shows the Settings key
|
||||
return KeyboardId.F2KEY_MODE_SHORTCUT_IME;
|
||||
}
|
||||
|
||||
if (mSettingsKeyEnabled) {
|
||||
return KeyboardId.F2KEY_MODE_SETTINGS;
|
||||
} else {
|
||||
// It should be alright to fall back to the Settings key on 7-inch layouts
|
||||
// even when the Settings key is not explicitly enabled.
|
||||
return KeyboardId.F2KEY_MODE_SHORTCUT_IME_OR_SETTINGS;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof KeyboardId && equals((KeyboardId) other);
|
||||
|
@ -214,17 +186,15 @@ public class KeyboardId {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("[%s %s %s%d %s %s %s%s%s%s%s%s%s]",
|
||||
return String.format("[%s %s %s%d %s %s %s%s%s%s%s]",
|
||||
elementIdToName(mElementId),
|
||||
mLocale,
|
||||
(mOrientation == 1 ? "port" : "land"), mWidth,
|
||||
modeName(mMode),
|
||||
imeAction(),
|
||||
f2KeyModeName(f2KeyMode()),
|
||||
(mClobberSettingsKey ? " clobberSettingsKey" : ""),
|
||||
(navigateAction() ? " navigateAction" : ""),
|
||||
(passwordInput() ? " passwordInput" : ""),
|
||||
(hasSettingsKey() ? " hasSettingsKey" : ""),
|
||||
(mShortcutKeyEnabled ? " shortcutKeyEnabled" : ""),
|
||||
(mHasShortcutKey ? " hasShortcutKey" : "")
|
||||
);
|
||||
|
@ -270,14 +240,4 @@ public class KeyboardId {
|
|||
return (actionId == IME_ACTION_CUSTOM_LABEL) ? "actionCustomLabel"
|
||||
: EditorInfoCompatUtils.imeActionName(actionId);
|
||||
}
|
||||
|
||||
public static String f2KeyModeName(int f2KeyMode) {
|
||||
switch (f2KeyMode) {
|
||||
case F2KEY_MODE_NONE: return "none";
|
||||
case F2KEY_MODE_SETTINGS: return "settings";
|
||||
case F2KEY_MODE_SHORTCUT_IME: return "shortcutIme";
|
||||
case F2KEY_MODE_SHORTCUT_IME_OR_SETTINGS: return "shortcutImeOrSettings";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ public class KeyboardSet {
|
|||
int mMode;
|
||||
EditorInfo mEditorInfo;
|
||||
boolean mTouchPositionCorrectionEnabled;
|
||||
boolean mSettingsKeyEnabled;
|
||||
boolean mVoiceKeyEnabled;
|
||||
boolean mVoiceKeyOnMain;
|
||||
boolean mNoSettingsKey;
|
||||
|
@ -193,8 +192,8 @@ public class KeyboardSet {
|
|||
final boolean hasShortcutKey = params.mVoiceKeyEnabled
|
||||
&& (isSymbols != params.mVoiceKeyOnMain);
|
||||
return new KeyboardId(keyboardSetElementId, params.mLocale, params.mOrientation,
|
||||
params.mWidth, params.mMode, params.mEditorInfo, params.mSettingsKeyEnabled,
|
||||
params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey);
|
||||
params.mWidth, params.mMode, params.mEditorInfo, params.mNoSettingsKey,
|
||||
params.mVoiceKeyEnabled, hasShortcutKey);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
@ -237,9 +236,7 @@ public class KeyboardSet {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setOptions(boolean settingsKeyEnabled, boolean voiceKeyEnabled,
|
||||
boolean voiceKeyOnMain) {
|
||||
mParams.mSettingsKeyEnabled = settingsKeyEnabled;
|
||||
public Builder setOptions(boolean voiceKeyEnabled, boolean voiceKeyOnMain) {
|
||||
@SuppressWarnings("deprecation")
|
||||
final boolean deprecatedNoMicrophone = Utils.inPrivateImeOptions(
|
||||
null, LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, mEditorInfo);
|
||||
|
|
|
@ -35,7 +35,6 @@ import com.android.inputmethod.latin.InputView;
|
|||
import com.android.inputmethod.latin.LatinIME;
|
||||
import com.android.inputmethod.latin.LatinImeLogger;
|
||||
import com.android.inputmethod.latin.R;
|
||||
import com.android.inputmethod.latin.Settings;
|
||||
import com.android.inputmethod.latin.SettingsValues;
|
||||
import com.android.inputmethod.latin.SubtypeSwitcher;
|
||||
import com.android.inputmethod.latin.Utils;
|
||||
|
@ -133,7 +132,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
|||
mSubtypeSwitcher.currentSubtypeContainsExtraValueKey(
|
||||
LatinIME.SUBTYPE_EXTRA_VALUE_SUPPORT_TOUCH_POSITION_CORRECTION));
|
||||
builder.setOptions(
|
||||
settingsValues.isSettingsKeyEnabled(),
|
||||
settingsValues.isVoiceKeyEnabled(editorInfo),
|
||||
settingsValues.isVoiceKeyOnMain());
|
||||
mKeyboardSet = builder.build();
|
||||
|
@ -404,8 +402,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
|||
if (PREF_KEYBOARD_LAYOUT.equals(key)) {
|
||||
final int themeIndex = getKeyboardThemeIndex(mInputMethodService, sharedPreferences);
|
||||
postSetInputView(createInputView(themeIndex, false));
|
||||
} else if (Settings.PREF_SHOW_SETTINGS_KEY.equals(key)) {
|
||||
postSetInputView(createInputView(mThemeIndex, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ public class Settings extends InputMethodSettingsActivity
|
|||
public static final String PREF_VIBRATE_ON = "vibrate_on";
|
||||
public static final String PREF_SOUND_ON = "sound_on";
|
||||
public static final String PREF_POPUP_ON = "popup_on";
|
||||
public static final String PREF_SHOW_SETTINGS_KEY = "show_settings_key";
|
||||
public static final String PREF_VOICE_MODE = "voice_mode";
|
||||
public static final String PREF_CORRECTION_SETTINGS = "correction_settings";
|
||||
public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key";
|
||||
|
@ -96,7 +95,6 @@ public class Settings extends InputMethodSettingsActivity
|
|||
private PreferenceScreen mKeypressVibrationDurationSettingsPref;
|
||||
private PreferenceScreen mKeypressSoundVolumeSettingsPref;
|
||||
private ListPreference mVoicePreference;
|
||||
private CheckBoxPreference mShowSettingsKeyPreference;
|
||||
private ListPreference mShowCorrectionSuggestionsPreference;
|
||||
private ListPreference mAutoCorrectionThresholdPreference;
|
||||
private ListPreference mKeyPreviewPopupDismissDelay;
|
||||
|
@ -147,7 +145,6 @@ public class Settings extends InputMethodSettingsActivity
|
|||
mInputLanguageSelection = (PreferenceScreen) findPreference(PREF_SUBTYPES_SETTINGS);
|
||||
mInputLanguageSelection.setOnPreferenceClickListener(this);
|
||||
mVoicePreference = (ListPreference) findPreference(PREF_VOICE_MODE);
|
||||
mShowSettingsKeyPreference = (CheckBoxPreference) findPreference(PREF_SHOW_SETTINGS_KEY);
|
||||
mShowCorrectionSuggestionsPreference =
|
||||
(ListPreference) findPreference(PREF_SHOW_SUGGESTIONS_SETTING);
|
||||
SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
|
||||
|
@ -178,10 +175,6 @@ public class Settings extends InputMethodSettingsActivity
|
|||
final PreferenceGroup miscSettings =
|
||||
(PreferenceGroup) findPreference(PREF_MISC_SETTINGS);
|
||||
|
||||
if (!SettingsValues.isShowSettingsKeyOptionEnabled(res)) {
|
||||
generalSettings.removePreference(mShowSettingsKeyPreference);
|
||||
}
|
||||
|
||||
final boolean showVoiceKeyOption = res.getBoolean(
|
||||
R.bool.config_enable_show_voice_key_option);
|
||||
if (!showVoiceKeyOption) {
|
||||
|
|
|
@ -49,7 +49,6 @@ public class SettingsValues {
|
|||
public final boolean mVibrateOn;
|
||||
public final boolean mSoundOn;
|
||||
public final boolean mKeyPreviewPopupOn;
|
||||
private final boolean mShowSettingsKey;
|
||||
private final String mVoiceMode;
|
||||
private final String mAutoCorrectionThresholdRawValue;
|
||||
public final String mShowSuggestionsSetting;
|
||||
|
@ -118,7 +117,6 @@ public class SettingsValues {
|
|||
mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON,
|
||||
res.getBoolean(R.bool.config_default_sound_enabled));
|
||||
mKeyPreviewPopupOn = isKeyPreviewPopupEnabled(prefs, res);
|
||||
mShowSettingsKey = isSettingsKeyShown(prefs, res);
|
||||
final String voiceModeMain = res.getString(R.string.voice_mode_main);
|
||||
final String voiceModeOff = res.getString(R.string.voice_mode_off);
|
||||
mVoiceMode = prefs.getString(Settings.PREF_VOICE_MODE, voiceModeMain);
|
||||
|
@ -202,19 +200,6 @@ public class SettingsValues {
|
|||
return wordSeparators;
|
||||
}
|
||||
|
||||
private static boolean isSettingsKeyShown(final SharedPreferences prefs, final Resources res) {
|
||||
final boolean defaultShowSettingsKey = res.getBoolean(
|
||||
R.bool.config_default_show_settings_key);
|
||||
return isShowSettingsKeyOptionEnabled(res)
|
||||
? prefs.getBoolean(Settings.PREF_SHOW_SETTINGS_KEY, defaultShowSettingsKey)
|
||||
: defaultShowSettingsKey;
|
||||
}
|
||||
|
||||
public static boolean isShowSettingsKeyOptionEnabled(final Resources resources) {
|
||||
// TODO: Read this once and for all into a public final member
|
||||
return resources.getBoolean(R.bool.config_enable_show_settings_key_option);
|
||||
}
|
||||
|
||||
private static boolean isVibrateOn(final Context context, final SharedPreferences prefs,
|
||||
final Resources res) {
|
||||
final boolean hasVibrator = VibratorCompatWrapper.getInstance(context).hasVibrator();
|
||||
|
@ -306,10 +291,6 @@ public class SettingsValues {
|
|||
return autoCorrectionThreshold;
|
||||
}
|
||||
|
||||
public boolean isSettingsKeyEnabled() {
|
||||
return mShowSettingsKey;
|
||||
}
|
||||
|
||||
public boolean isVoiceKeyEnabled(final EditorInfo editorInfo) {
|
||||
final boolean shortcutImeEnabled = SubtypeSwitcher.getInstance().isShortcutImeEnabled();
|
||||
final int inputType = (editorInfo != null) ? editorInfo.inputType : 0;
|
||||
|
|
Loading…
Reference in a new issue