Home | History | Annotate | Download | only in xml
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3 /*
      4 **
      5 ** Copyright 2012, The Android Open Source Project
      6 **
      7 ** Licensed under the Apache License, Version 2.0 (the "License");
      8 ** you may not use this file except in compliance with the License.
      9 ** You may obtain a copy of the License at
     10 **
     11 **     http://www.apache.org/licenses/LICENSE-2.0
     12 **
     13 ** Unless required by applicable law or agreed to in writing, software
     14 ** distributed under the License is distributed on an "AS IS" BASIS,
     15 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 ** See the License for the specific language governing permissions and
     17 ** limitations under the License.
     18 */
     19 -->
     20 
     21 <merge
     22     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     23 >
     24     <!-- TODO: Stop using many conditional cases for emoji_key_as_more_key. There are way too many to maintain. -->
     25     <!-- Navigate more keys style -->
     26     <switch>
     27         <!-- latin:passwordInput="true" -->
     28         <case
     29             latin:imeAction="actionNext"
     30             latin:navigatePrevious="true"
     31             latin:passwordInput="true"
     32         >
     33             <key-style
     34                 latin:styleName="navigateMoreKeysStyle"
     35                 latin:keyLabelFlags="hasPopupHint|preserveCase"
     36                 latin:moreKeys="!text/action_previous_as_more_key" />
     37         </case>
     38         <case
     39             latin:imeAction="actionNext"
     40             latin:navigatePrevious="false"
     41             latin:passwordInput="true"
     42         >
     43             <key-style
     44                 latin:styleName="navigateMoreKeysStyle" />
     45         </case>
     46         <case
     47             latin:imeAction="actionPrevious"
     48             latin:navigateNext="true"
     49             latin:passwordInput="true"
     50         >
     51             <key-style
     52                 latin:styleName="navigateMoreKeysStyle"
     53                 latin:keyLabelFlags="hasPopupHint|preserveCase"
     54                 latin:moreKeys="!text/action_next_as_more_key" />
     55         </case>
     56         <case
     57             latin:imeAction="actionPrevious"
     58             latin:navigateNext="false"
     59             latin:passwordInput="true"
     60         >
     61             <key-style
     62                 latin:styleName="navigateMoreKeysStyle" />
     63         </case>
     64         <case
     65             latin:navigateNext="true"
     66             latin:navigatePrevious="true"
     67             latin:passwordInput="true"
     68         >
     69             <key-style
     70                 latin:styleName="navigateMoreKeysStyle"
     71                 latin:keyLabelFlags="hasPopupHint|preserveCase"
     72                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/action_previous_as_more_key,!text/action_next_as_more_key" />
     73         </case>
     74         <case
     75             latin:navigateNext="true"
     76             latin:navigatePrevious="false"
     77             latin:passwordInput="true"
     78         >
     79             <key-style
     80                 latin:styleName="navigateMoreKeysStyle"
     81                 latin:keyLabelFlags="hasPopupHint|preserveCase"
     82                 latin:moreKeys="!text/action_next_as_more_key" />
     83         </case>
     84         <case
     85             latin:navigateNext="false"
     86             latin:navigatePrevious="true"
     87             latin:passwordInput="true"
     88         >
     89             <key-style
     90                 latin:styleName="navigateMoreKeysStyle"
     91                 latin:keyLabelFlags="hasPopupHint|preserveCase"
     92                 latin:moreKeys="!text/action_previous_as_more_key" />
     93         </case>
     94         <case
     95             latin:navigateNext="false"
     96             latin:navigatePrevious="false"
     97             latin:passwordInput="true"
     98         >
     99             <key-style
    100                 latin:styleName="navigateMoreKeysStyle" />
    101         </case>
    102         <!-- latin:mode="email|url|phone|number|date|time|datetime" -->
    103         <case
    104             latin:imeAction="actionNext"
    105             latin:navigatePrevious="true"
    106             latin:mode="email|url|phone|number|date|time|datetime"
    107         >
    108             <key-style
    109                 latin:styleName="navigateMoreKeysStyle"
    110                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    111                 latin:moreKeys="!text/action_previous_as_more_key" />
    112         </case>
    113         <case
    114             latin:imeAction="actionNext"
    115             latin:navigatePrevious="false"
    116             latin:mode="email|url|phone|number|date|time|datetime"
    117         >
    118             <key-style
    119                 latin:styleName="navigateMoreKeysStyle" />
    120         </case>
    121         <case
    122             latin:imeAction="actionPrevious"
    123             latin:navigateNext="true"
    124             latin:mode="email|url|phone|number|date|time|datetime"
    125         >
    126             <key-style
    127                 latin:styleName="navigateMoreKeysStyle"
    128                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    129                 latin:moreKeys="!text/action_next_as_more_key" />
    130         </case>
    131         <case
    132             latin:imeAction="actionPrevious"
    133             latin:navigateNext="false"
    134             latin:mode="email|url|phone|number|date|time|datetime"
    135         >
    136             <key-style
    137                 latin:styleName="navigateMoreKeysStyle" />
    138         </case>
    139         <case
    140             latin:navigateNext="true"
    141             latin:navigatePrevious="true"
    142             latin:mode="email|url|phone|number|date|time|datetime"
    143         >
    144             <key-style
    145                 latin:styleName="navigateMoreKeysStyle"
    146                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    147                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/action_previous_as_more_key,!text/action_next_as_more_key" />
    148         </case>
    149         <case
    150             latin:navigateNext="true"
    151             latin:navigatePrevious="false"
    152             latin:mode="email|url|phone|number|date|time|datetime"
    153         >
    154             <key-style
    155                 latin:styleName="navigateMoreKeysStyle"
    156                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    157                 latin:moreKeys="!text/action_next_as_more_key" />
    158         </case>
    159         <case
    160             latin:navigateNext="false"
    161             latin:navigatePrevious="true"
    162             latin:mode="email|url|phone|number|date|time|datetime"
    163         >
    164             <key-style
    165                 latin:styleName="navigateMoreKeysStyle"
    166                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    167                 latin:moreKeys="!text/action_previous_as_more_key" />
    168         </case>
    169         <case
    170             latin:navigateNext="false"
    171             latin:navigatePrevious="false"
    172             latin:mode="email|url|phone|number|date|time|datetime"
    173         >
    174             <key-style
    175                 latin:styleName="navigateMoreKeysStyle" />
    176         </case>
    177         <!-- default -->
    178         <case
    179             latin:imeAction="actionNext"
    180             latin:navigatePrevious="true"
    181         >
    182             <key-style
    183                 latin:styleName="navigateMoreKeysStyle"
    184                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    185                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/emoji_key_as_more_key,!text/action_previous_as_more_key" />
    186         </case>
    187         <case
    188             latin:imeAction="actionNext"
    189             latin:navigatePrevious="false"
    190         >
    191             <key-style
    192                 latin:styleName="navigateMoreKeysStyle"
    193                 latin:moreKeys="!text/emoji_key_as_more_key" />
    194         </case>
    195         <case
    196             latin:imeAction="actionPrevious"
    197             latin:navigateNext="true"
    198         >
    199             <key-style
    200                 latin:styleName="navigateMoreKeysStyle"
    201                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    202                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/emoji_key_as_more_key,!text/action_next_as_more_key" />
    203         </case>
    204         <case
    205             latin:imeAction="actionPrevious"
    206             latin:navigateNext="false"
    207         >
    208             <key-style
    209                 latin:styleName="navigateMoreKeysStyle"
    210                 latin:moreKeys="!text/emoji_key_as_more_key" />
    211         </case>
    212         <case
    213             latin:navigateNext="true"
    214             latin:navigatePrevious="true"
    215         >
    216             <key-style
    217                 latin:styleName="navigateMoreKeysStyle"
    218                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    219                 latin:moreKeys="!fixedColumnOrder!3,!needsDividers!,!text/emoji_key_as_more_key,!text/action_previous_as_more_key,!text/action_next_as_more_key" />
    220         </case>
    221         <case
    222             latin:navigateNext="true"
    223             latin:navigatePrevious="false"
    224         >
    225             <key-style
    226                 latin:styleName="navigateMoreKeysStyle"
    227                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    228                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/emoji_key_as_more_key,!text/action_next_as_more_key" />
    229         </case>
    230         <case
    231             latin:navigateNext="false"
    232             latin:navigatePrevious="true"
    233         >
    234             <key-style
    235                 latin:styleName="navigateMoreKeysStyle"
    236                 latin:keyLabelFlags="hasPopupHint|preserveCase"
    237                 latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/emoji_key_as_more_key,!text/action_previous_as_more_key" />
    238         </case>
    239         <case
    240             latin:navigateNext="false"
    241             latin:navigatePrevious="false"
    242         >
    243             <key-style
    244                 latin:styleName="navigateMoreKeysStyle"
    245                 latin:moreKeys="!text/emoji_key_as_more_key" />
    246         </case>
    247         <default>
    248             <key-style
    249                 latin:styleName="navigateMoreKeysStyle" />
    250         </default>
    251     </switch>
    252     <!-- Enter key style -->
    253     <key-style
    254         latin:styleName="defaultEnterKeyStyle"
    255         latin:code="!code/key_enter"
    256         latin:keyIcon="!icon/enter_key"
    257         latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio"
    258         latin:keyActionFlags="noKeyPreview"
    259         latin:backgroundType="functional"
    260         latin:parentStyle="navigateMoreKeysStyle" />
    261     <key-style
    262         latin:styleName="shiftEnterKeyStyle"
    263         latin:code="!code/key_shift_enter"
    264         latin:parentStyle="defaultEnterKeyStyle" />
    265     <key-style
    266         latin:styleName="defaultActionEnterKeyStyle"
    267         latin:code="!code/key_enter"
    268         latin:keyIcon="!icon/undefined"
    269         latin:backgroundType="action"
    270         latin:parentStyle="defaultEnterKeyStyle" />
    271     <switch>
    272         <!-- Shift + Enter in textMultiLine field. -->
    273         <case
    274             latin:isMultiLine="true"
    275             latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLockShifted"
    276         >
    277             <key-style
    278                 latin:styleName="enterKeyStyle"
    279                 latin:parentStyle="shiftEnterKeyStyle" />
    280         </case>
    281         <case
    282             latin:imeAction="actionGo"
    283         >
    284             <key-style
    285                 latin:styleName="enterKeyStyle"
    286                 latin:keyLabel="!text/label_go_key"
    287                 latin:parentStyle="defaultActionEnterKeyStyle" />
    288         </case>
    289         <case
    290             latin:imeAction="actionNext"
    291         >
    292             <key-style
    293                 latin:styleName="enterKeyStyle"
    294                 latin:keyLabel="!text/label_next_key"
    295                 latin:parentStyle="defaultActionEnterKeyStyle" />
    296         </case>
    297         <case
    298             latin:imeAction="actionPrevious"
    299         >
    300             <key-style
    301                 latin:styleName="enterKeyStyle"
    302                 latin:keyLabel="!text/label_previous_key"
    303                 latin:parentStyle="defaultActionEnterKeyStyle" />
    304         </case>
    305         <case
    306             latin:imeAction="actionDone"
    307         >
    308             <key-style
    309                 latin:styleName="enterKeyStyle"
    310                 latin:keyLabel="!text/label_done_key"
    311                 latin:parentStyle="defaultActionEnterKeyStyle" />
    312         </case>
    313         <case
    314             latin:imeAction="actionSend"
    315         >
    316             <key-style
    317                 latin:styleName="enterKeyStyle"
    318                 latin:keyLabel="!text/label_send_key"
    319                 latin:parentStyle="defaultActionEnterKeyStyle" />
    320         </case>
    321         <case
    322             latin:imeAction="actionSearch"
    323         >
    324             <key-style
    325                 latin:styleName="enterKeyStyle"
    326                 latin:keyIcon="!icon/search_key"
    327                 latin:parentStyle="defaultActionEnterKeyStyle" />
    328         </case>
    329         <case
    330             latin:imeAction="actionCustomLabel"
    331         >
    332             <key-style
    333                 latin:styleName="enterKeyStyle"
    334                 latin:keyLabelFlags="fromCustomActionLabel"
    335                 latin:parentStyle="defaultActionEnterKeyStyle" />
    336         </case>
    337         <!-- imeAction is either actionNone or actionUnspecified. -->
    338         <default>
    339             <key-style
    340                 latin:styleName="enterKeyStyle"
    341                 latin:parentStyle="defaultEnterKeyStyle" />
    342         </default>
    343     </switch>
    344 </merge>
    345