diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/xml-sw600dp/key_azerty3_right.xml | 29 | ||||
-rw-r--r-- | java/res/xml/key_azerty3_right.xml | 37 | ||||
-rw-r--r-- | java/res/xml/rowkeys_azerty3.xml | 15 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/StringUtils.java | 40 |
4 files changed, 53 insertions, 68 deletions
diff --git a/java/res/xml-sw600dp/key_azerty3_right.xml b/java/res/xml-sw600dp/key_azerty3_right.xml deleted file mode 100644 index 25b0e52b8..000000000 --- a/java/res/xml-sw600dp/key_azerty3_right.xml +++ /dev/null @@ -1,29 +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" -> - <Key - latin:keySpec=":" - latin:keyHintLabel=";" - latin:moreKeys=";" - latin:keyStyle="hasShiftedLetterHintStyle" /> -</merge> diff --git a/java/res/xml/key_azerty3_right.xml b/java/res/xml/key_azerty3_right.xml deleted file mode 100644 index 85a066613..000000000 --- a/java/res/xml/key_azerty3_right.xml +++ /dev/null @@ -1,37 +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" -> - <switch> - <case - latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLockShifted" - > - <Key - latin:keySpec="\?" /> - </case> - <default> - <Key - latin:keySpec="\'" - latin:moreKeys="!text/more_keys_for_single_quote" /> - </default> - </switch> -</merge> diff --git a/java/res/xml/rowkeys_azerty3.xml b/java/res/xml/rowkeys_azerty3.xml index 0aa215305..c955e237c 100644 --- a/java/res/xml/rowkeys_azerty3.xml +++ b/java/res/xml/rowkeys_azerty3.xml @@ -37,6 +37,17 @@ <Key latin:keySpec="n" latin:moreKeys="!text/more_keys_for_n" /> - <include - latin:keyboardLayout="@xml/key_azerty3_right" /> + <switch> + <case + latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLockShifted" + > + <Key + latin:keySpec="\?" /> + </case> + <default> + <Key + latin:keySpec="\'" + latin:moreKeys="!text/more_keys_for_single_quote" /> + </default> + </switch> </merge> diff --git a/java/src/com/android/inputmethod/latin/utils/StringUtils.java b/java/src/com/android/inputmethod/latin/utils/StringUtils.java index e7932b5a6..b9d526b5f 100644 --- a/java/src/com/android/inputmethod/latin/utils/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/StringUtils.java @@ -507,4 +507,44 @@ public final class StringUtils { return codePointCount(casedText) == 1 ? casedText.codePointAt(0) : CODE_UNSPECIFIED; } + + @UsedForTesting + public static class Stringizer<E> { + public String stringize(final E element) { + return element != null ? element.toString() : "null"; + } + + @UsedForTesting + public final String join(final E[] array) { + return joinStringArray(toStringArray(array), null /* delimiter */); + } + + @UsedForTesting + public final String join(final E[] array, final String delimiter) { + return joinStringArray(toStringArray(array), delimiter); + } + + protected String[] toStringArray(final E[] array) { + final String[] stringArray = new String[array.length]; + for (int index = 0; index < array.length; index++) { + stringArray[index] = stringize(array[index]); + } + return stringArray; + } + + protected String joinStringArray(final String[] stringArray, final String delimiter) { + if (stringArray == null) { + return "null"; + } + if (delimiter == null) { + return Arrays.toString(stringArray); + } + final StringBuilder sb = new StringBuilder(); + for (int index = 0; index < stringArray.length; index++) { + sb.append(index == 0 ? "[" : delimiter); + sb.append(stringArray[index]); + } + return sb + "]"; + } + } } |