am 6ba84dcd: Merge "Refactor action label/icon definitions" into lmp-dev

* commit '6ba84dcd96418a7a568afeaf064aa64cf94a1839':
  Refactor action label/icon definitions
This commit is contained in:
Tadashi G. Takaoka 2014-09-05 15:36:05 +00:00 committed by Android Git Automerger
commit 7f8501867e
7 changed files with 292 additions and 268 deletions

View file

@ -22,20 +22,18 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<!-- Navigate more keys style -->
<include latin:keyboardLayout="@xml/key_styles_navigate_more_keys" />
<switch>
<!-- latin:passwordInput="true" -->
<case
latin:imeAction="actionNext"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle" />
@ -46,12 +44,10 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:navigateNext="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle" />
@ -62,33 +58,21 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_action_previous,!text/keyspec_action_next" />
latin:parentStyle="navigatePreviousNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="true"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<default>
<key-style
@ -103,6 +87,7 @@
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="action"
latin:parentStyle="navigateMoreKeysStyle" />
<include latin:keyboardLayout="@xml/key_styles_actions" />
<switch>
<!-- Shift + Enter in textMultiLine field. -->
<case
@ -116,133 +101,52 @@
</case>
<case
latin:imeAction="actionGo"
latin:isIconDefined="go_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/go_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionGo"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_go_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:isIconDefined="next_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/next_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="goActionKeyStyle" />
</case>
<case
latin:imeAction="actionNext"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_next_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:isIconDefined="previous_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/previous_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="nextActionKeyStyle" />
</case>
<case
latin:imeAction="actionPrevious"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_previous_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionDone"
latin:isIconDefined="done_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/done_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="previousActionKeyStyle" />
</case>
<case
latin:imeAction="actionDone"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_done_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionSend"
latin:isIconDefined="send_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/send_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="doneActionKeyStyle" />
</case>
<case
latin:imeAction="actionSend"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_send_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionSearch"
latin:isIconDefined="search_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/search_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="sendActionKeyStyle" />
</case>
<case
latin:imeAction="actionSearch"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_search_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="searchActionKeyStyle" />
</case>
<case
latin:imeAction="actionCustomLabel"
latin:keyboardTheme="ICS|KLP"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionCustomLabel"
latin:keyboardTheme="LXXLight|LXXDark"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="functional"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="customLabelActionKeyStyle" />
</case>
<!-- imeAction is either actionNone or actionUnspecified. -->
<default>

View file

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2014, 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"
>
<!-- Go key -->
<switch>
<case latin:isIconDefined="go_key">
<key-style
latin:styleName="goActionKeyStyle"
latin:keySpec="!icon/go_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="goActionKeyStyle"
latin:keySpec="!text/label_go_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<!-- Next key -->
<switch>
<case latin:isIconDefined="next_key">
<key-style
latin:styleName="nextActionKeyStyle"
latin:keySpec="!icon/next_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="nextActionKeyStyle"
latin:keySpec="!text/label_next_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<!-- Previous key -->
<switch>
<case latin:isIconDefined="previous_key">
<key-style
latin:styleName="previousActionKeyStyle"
latin:keySpec="!icon/previous_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="previousActionKeyStyle"
latin:keySpec="!text/label_previous_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<!-- Done key -->
<switch>
<case latin:isIconDefined="done_key">
<key-style
latin:styleName="doneActionKeyStyle"
latin:keySpec="!icon/done_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="doneActionKeyStyle"
latin:keySpec="!text/label_done_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<!-- Send key -->
<switch>
<case latin:isIconDefined="send_key">
<key-style
latin:styleName="sendActionKeyStyle"
latin:keySpec="!icon/send_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="sendActionKeyStyle"
latin:keySpec="!text/label_send_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<!-- Seartch key -->
<switch>
<case latin:isIconDefined="search_key">
<key-style
latin:styleName="searchActionKeyStyle"
latin:keySpec="!icon/search_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<default>
<key-style
latin:styleName="searchActionKeyStyle"
latin:keySpec="!text/label_search_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
<switch>
<case latin:keyboardTheme="ICS|KLP">
<key-style
latin:styleName="customLabelActionKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<!-- keyboardTheme="LXXLight|LXXDark" -->
<default>
<key-style
latin:styleName="customLabelActionKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="functional"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>
</merge>

View file

@ -21,8 +21,8 @@
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
<!-- TODO: Stop using many conditional cases for keyspec_emoji_action_key. There are way too many to maintain. -->
<!-- Navigate more keys style -->
<include latin:keyboardLayout="@xml/key_styles_navigate_more_keys" />
<switch>
<!-- latin:passwordInput="true" -->
<case
@ -32,12 +32,10 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:navigatePrevious="false"
latin:passwordInput="true"
>
<key-style
@ -50,12 +48,10 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:navigateNext="false"
latin:passwordInput="true"
>
<key-style
@ -68,32 +64,25 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_action_previous,!text/keyspec_action_next" />
latin:parentStyle="navigatePreviousNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="true"
latin:navigatePrevious="false"
latin:passwordInput="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="true"
latin:passwordInput="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="false"
latin:passwordInput="true"
>
<key-style
@ -107,12 +96,10 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:navigatePrevious="false"
latin:mode="email|url|phone|number|date|time|datetime"
>
<key-style
@ -125,12 +112,10 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:navigateNext="false"
latin:mode="email|url|phone|number|date|time|datetime"
>
<key-style
@ -143,32 +128,25 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_action_previous,!text/keyspec_action_next" />
latin:parentStyle="navigatePreviousNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="true"
latin:navigatePrevious="false"
latin:mode="email|url|phone|number|date|time|datetime"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
latin:parentStyle="navigateNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="true"
latin:mode="email|url|phone|number|date|time|datetime"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
latin:parentStyle="navigatePreviousMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="false"
latin:mode="email|url|phone|number|date|time|datetime"
>
<key-style
@ -181,17 +159,14 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous" />
latin:parentStyle="navigateEmojiPreviousMoreKeysStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_emoji_action_key" />
latin:parentStyle="navigateEmojiMoreKeysStyle" />
</case>
<case
latin:imeAction="actionPrevious"
@ -199,17 +174,14 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_next" />
latin:parentStyle="navigateEmojiNextMoreKeysStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:navigateNext="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_emoji_action_key" />
latin:parentStyle="navigateEmojiMoreKeysStyle" />
</case>
<case
latin:navigateNext="true"
@ -217,39 +189,26 @@
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous,!text/keyspec_action_next" />
latin:parentStyle="navigateEmojiPreviousNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="true"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_next" />
latin:parentStyle="navigateEmojiNextMoreKeysStyle" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="true"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous" />
</case>
<case
latin:navigateNext="false"
latin:navigatePrevious="false"
>
<key-style
latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_emoji_action_key" />
latin:parentStyle="navigateEmojiPreviousMoreKeysStyle" />
</case>
<default>
<key-style
latin:styleName="navigateMoreKeysStyle" />
latin:styleName="navigateMoreKeysStyle"
latin:parentStyle="navigateEmojiMoreKeysStyle" />
</default>
</switch>
<!-- Enter key style -->
@ -260,10 +219,7 @@
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="action"
latin:parentStyle="navigateMoreKeysStyle" />
<key-style
latin:styleName="shiftEnterKeyStyle"
latin:keySpec="!icon/enter_key|!code/key_shift_enter"
latin:parentStyle="defaultEnterKeyStyle" />
<include latin:keyboardLayout="@xml/key_styles_actions" />
<switch>
<!-- Shift + Enter in textMultiLine field. -->
<case
@ -272,7 +228,8 @@
>
<key-style
latin:styleName="enterKeyStyle"
latin:parentStyle="shiftEnterKeyStyle" />
latin:keySpec="!icon/enter_key|!code/key_shift_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<!-- Smiley in textShortMessage field.
This <case> should be after Shift + Enter <case> and before any of action <case>. -->
@ -285,139 +242,57 @@
</case>
<case
latin:imeAction="actionGo"
latin:isIconDefined="go_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/go_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionGo"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_go_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionNext"
latin:isIconDefined="next_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/next_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="goActionKeyStyle" />
</case>
<case
latin:imeAction="actionNext"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_next_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionPrevious"
latin:isIconDefined="previous_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/previous_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="nextActionKeyStyle" />
</case>
<case
latin:imeAction="actionPrevious"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_previous_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionDone"
latin:isIconDefined="done_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/done_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="previousActionKeyStyle" />
</case>
<case
latin:imeAction="actionDone"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_done_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionSend"
latin:isIconDefined="send_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/send_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="doneActionKeyStyle" />
</case>
<case
latin:imeAction="actionSend"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_send_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionSearch"
latin:isIconDefined="search_key"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/search_key|!code/key_enter"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="sendActionKeyStyle" />
</case>
<case
latin:imeAction="actionSearch"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!text/label_search_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="searchActionKeyStyle" />
</case>
<case
latin:imeAction="actionCustomLabel"
latin:keyboardTheme="ICS|KLP"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="action"
latin:parentStyle="defaultEnterKeyStyle" />
</case>
<case
latin:imeAction="actionCustomLabel"
latin:keyboardTheme="LXXLight|LXXDark"
>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="dummy_label|!code/key_enter"
latin:keyLabelFlags="fromCustomActionLabel"
latin:backgroundType="functional"
latin:parentStyle="defaultEnterKeyStyle" />
latin:parentStyle="customLabelActionKeyStyle" />
</case>
<!-- imeAction is either actionNone or actionUnspecified. -->
<default>
<key-style
latin:styleName="enterKeyStyle"
latin:keySpec="!icon/enter_key|!code/key_enter"
latin:parentStyle="defaultEnterKeyStyle" />
</default>
</switch>

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2014, 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:keyboardTheme="ICS|KLP">
<key-style
latin:styleName="navigateNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_next" />
<key-style
latin:styleName="navigatePreviousMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_action_previous" />
<key-style
latin:styleName="navigatePreviousNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_action_previous,!text/keyspec_action_next" />
<key-style
latin:styleName="navigateEmojiMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_emoji_action_key" />
<key-style
latin:styleName="navigateEmojiNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_next" />
<key-style
latin:styleName="navigateEmojiPreviousMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous" />
<key-style
latin:styleName="navigateEmojiPreviousNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/keyspec_emoji_action_key,!text/keyspec_action_previous,!text/keyspec_action_next" />
</case>
<default>
<key-style
latin:styleName="navigateNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!icon/next_key|!code/key_action_next" />
<key-style
latin:styleName="navigatePreviousMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!icon/previous_key|!code/key_action_previous" />
<key-style
latin:styleName="navigatePreviousNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/next_key|!code/key_action_next" />
<key-style
latin:styleName="navigateEmojiMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!text/keyspec_emoji_action_key" />
<key-style
latin:styleName="navigateEmojiNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!icon/next_key|!code/key_action_next" />
<key-style
latin:styleName="navigateEmojiPreviousMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/keyspec_emoji_action_key,!icon/previous_key|!code/key_action_previous" />
<key-style
latin:styleName="navigateEmojiPreviousNextMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/keyspec_emoji_action_key,!icon/previous_key|!code/key_action_previous,!icon/next_key|!code/key_action_next" />
</default>
</switch>
</merge>

View file

@ -35,12 +35,24 @@ abstract class KeyboardLayoutSetNavigateMoreKeysBase extends KeyboardLayoutSetTe
private ExpectedMoreKey mExpectedNavigatePreviousMoreKey;
private ExpectedMoreKey mExpectedEmojiMoreKey;
protected ExpectedMoreKey getExpectedNavigateNextMoreKey() {
return new ExpectedMoreKey(R.string.label_next_key);
}
protected ExpectedMoreKey getExpectedNavigatePreviousMoreKey() {
return new ExpectedMoreKey(R.string.label_previous_key);
}
protected ExpectedMoreKey getExpectedEmojiMoreKey() {
return new ExpectedMoreKey(KeyboardIconsSet.NAME_EMOJI_ACTION_KEY);
}
@Override
protected void setUp() throws Exception {
super.setUp();
mExpectedNavigateNextMoreKey = new ExpectedMoreKey(R.string.label_next_key);
mExpectedNavigatePreviousMoreKey = new ExpectedMoreKey(R.string.label_previous_key);
mExpectedEmojiMoreKey = new ExpectedMoreKey(KeyboardIconsSet.NAME_EMOJI_ACTION_KEY);
mExpectedNavigateNextMoreKey = getExpectedNavigateNextMoreKey();
mExpectedNavigatePreviousMoreKey = getExpectedNavigatePreviousMoreKey();
mExpectedEmojiMoreKey = getExpectedEmojiMoreKey();
}
/**
@ -90,6 +102,7 @@ abstract class KeyboardLayoutSetNavigateMoreKeysBase extends KeyboardLayoutSetTe
assertEquals(tag + " column",
expectedMoreKeys.length, actualKey.getMoreKeysColumnNumber());
}
assertNotNull(tag + " moreKeys", actualMoreKeys);
assertEquals(tag, expectedMoreKeys.length, actualMoreKeys.length);
for (int index = 0; index < actualMoreKeys.length; index++) {
final int expectedLabelResId = expectedMoreKeys[index].mLabelResId;

View file

@ -18,6 +18,8 @@ package com.android.inputmethod.keyboard;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
@SmallTest
public class KeyboardLayoutSetNavigateMoreKeysLxxTests
extends KeyboardLayoutSetNavigateMoreKeysBase {
@ -25,4 +27,14 @@ public class KeyboardLayoutSetNavigateMoreKeysLxxTests
protected int getKeyboardThemeForTests() {
return KeyboardTheme.THEME_ID_LXX_LIGHT;
}
@Override
protected ExpectedMoreKey getExpectedNavigateNextMoreKey() {
return new ExpectedMoreKey(KeyboardIconsSet.NAME_NEXT_KEY);
}
@Override
protected ExpectedMoreKey getExpectedNavigatePreviousMoreKey() {
return new ExpectedMoreKey(KeyboardIconsSet.NAME_PREVIOUS_KEY);
}
}

View file

@ -52,6 +52,7 @@ public abstract class KeyboardLayoutSetTestsBase extends AndroidTestCase {
final KeyboardTheme keyboardTheme = KeyboardTheme.searchKeyboardThemeById(
getKeyboardThemeForTests());
setContext(new ContextThemeWrapper(getContext(), keyboardTheme.mStyleId));
KeyboardLayoutSet.onKeyboardThemeChanged();
final Context context = getContext();
mScreenMetrics = context.getResources().getInteger(R.integer.config_screen_metrics);