Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f86109ca authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Utilize KeyboardSet XML definitions

This change introduces KeyboardSet and SubKeyboard XML definitions to
represent a set of keyboard layouts.

Bug: 5002108
Bug: 5679585
Change-Id: Ib6c8d5936187381bb6725c9fe574e93871c01a86
parent cfe264bf
Loading
Loading
Loading
Loading
+25 −2
Original line number Diff line number Diff line
@@ -164,8 +164,6 @@
        <attr name="verticalGap" format="dimension|fraction" />
        <!-- More keys keyboard layout template -->
        <attr name="moreKeysTemplate" format="reference" />
        <!-- Locale of the keyboard layout -->
        <attr name="keyboardLocale" format="string" />
        <!-- True if the keyboard is Right-To-Left -->
        <attr name="isRtlKeyboard" format="boolean" />
        <!-- Icon set for key top and key preview. -->
@@ -328,4 +326,29 @@
        <attr name="spacebarTextColor" format="color" />
        <attr name="spacebarTextShadowColor" format="color" />
    </declare-styleable>

    <declare-styleable name="KeyboardSet">
        <!-- Locale of the keyboard layouts -->
        <attr name="keyboardLocale" format="string" />
    </declare-styleable>

    <declare-styleable name="KeyboardSet_Element">
        <!-- This should be aligned with KeyboardId.ELEMENT_* -->
        <attr name="elementName" format="enum">
          <enum name="alphabet" value="0" />
          <!--  TODO: Implement alphabet variant shift keyboards
          <enum name="alphabetManualTemporaryShift" value="1" />
          <enum name="alphabetAutomaticTemporaryShift" value="2" />
          <enum name="alphabetShiftLock" value="3" />
          <enum name="alphabetShiftLockShift" value="4" />
          -->
          <enum name="symbols" value="5" />
          <enum name="symbolsShift" value="6"  />
          <enum name="phone" value="7"  />
          <enum name="phoneShift" value="8"  />
          <enum name="number" value="9"  />
        </attr>
        <attr name="elementKeyboard" format="reference" />
        <!-- TODO: Add setShifted and setShiftLocked attribute. -->
    </declare-styleable>
</resources>
+42 −0
Original line number Diff line number Diff line
<?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.
*/
-->

<KeyboardSet
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardLocale="ar" >
    <Element
        latin:elementName="alphabet"
        latin:elementKeyboard="@xml/kbd_arabic" />
    <Element
        latin:elementName="symbols"
        latin:elementKeyboard="@xml/kbd_symbols" />
    <Element
        latin:elementName="symbolsShift"
        latin:elementKeyboard="@xml/kbd_symbols_shift" />
    <Element
        latin:elementName="phone"
        latin:elementKeyboard="@xml/kbd_phone" />
    <Element
        latin:elementName="phoneShift"
        latin:elementKeyboard="@xml/kbd_phone_shift" />
    <Element
        latin:elementName="number"
        latin:elementKeyboard="@xml/kbd_number" />
</KeyboardSet>
+21 −6
Original line number Diff line number Diff line
@@ -18,10 +18,25 @@
*/
-->

<Keyboard
<KeyboardSet
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardLocale="de"
>
    <include
        latin:keyboardLayout="@xml/kbd_rows_qwerty" />
</Keyboard>
    latin:keyboardLocale="cs">
    <Element
        latin:elementName="alphabet"
        latin:elementKeyboard="@xml/kbd_qwertz" />
    <Element
        latin:elementName="symbols"
        latin:elementKeyboard="@xml/kbd_symbols" />
    <Element
        latin:elementName="symbolsShift"
        latin:elementKeyboard="@xml/kbd_symbols_shift" />
    <Element
        latin:elementName="phone"
        latin:elementKeyboard="@xml/kbd_phone" />
    <Element
        latin:elementName="phoneShift"
        latin:elementKeyboard="@xml/kbd_phone_shift" />
    <Element
        latin:elementName="number"
        latin:elementKeyboard="@xml/kbd_number" />
</KeyboardSet>

java/res/xml-da/kbd_qwerty.xml

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
<?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.
*/
-->

<Keyboard
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardLocale="da"
>
    <include
        latin:keyboardLayout="@xml/kbd_rows_scandinavian" />
</Keyboard>
+42 −0
Original line number Diff line number Diff line
<?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.
*/
-->

<KeyboardSet
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardLocale="da">
    <Element
        latin:elementName="alphabet"
        latin:elementKeyboard="@xml/kbd_scandinavian" />
    <Element
        latin:elementName="symbols"
        latin:elementKeyboard="@xml/kbd_symbols" />
    <Element
        latin:elementName="symbolsShift"
        latin:elementKeyboard="@xml/kbd_symbols_shift" />
    <Element
        latin:elementName="phone"
        latin:elementKeyboard="@xml/kbd_phone" />
    <Element
        latin:elementName="phoneShift"
        latin:elementKeyboard="@xml/kbd_phone_shift" />
    <Element
        latin:elementName="number"
        latin:elementKeyboard="@xml/kbd_number" />
</KeyboardSet>
Loading