From 1fe02f5e572970e21b760d5774483bc859634982 Mon Sep 17 00:00:00 2001 From: linyuh Date: Fri, 3 Nov 2017 11:57:28 -0700 Subject: Add character mappings for Bulgarian & Ukrainian in DialpadCharMappings. Bug: 30215380 Test: Manual PiperOrigin-RevId: 174493347 Change-Id: I06d5d3d8877ac29d148b3945e28dc0a094660eca --- .../dialer/dialpadview/DialpadCharMappings.java | 49 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/dialpadview') diff --git a/java/com/android/dialer/dialpadview/DialpadCharMappings.java b/java/com/android/dialer/dialpadview/DialpadCharMappings.java index 12994bc78..03bc2e728 100644 --- a/java/com/android/dialer/dialpadview/DialpadCharMappings.java +++ b/java/com/android/dialer/dialpadview/DialpadCharMappings.java @@ -50,13 +50,34 @@ public class DialpadCharMappings { getCharToKeyMap(KEY_TO_CHARS); } + /** The character mapping for the Bulgarian alphabet */ + private static class Bul { + private static final String[] KEY_TO_CHARS = { + "" /* 0 */, + "" /* 1 */, + "АБВГ" /* 2 */, + "ДЕЖЗ" /* 3 */, + "ИЙКЛ" /* 4 */, + "МНО" /* 5 */, + "ПРС" /* 6 */, + "ТУФХ" /* 7 */, + "ЦЧШЩ" /* 8 */, + "ЪЬЮЯ" /* 9 */, + "" /* * */, + "" /* # */, + }; + + private static final SimpleArrayMap CHAR_TO_KEY = + getCharToKeyMap(KEY_TO_CHARS); + } + /** The character mapping for the Russian alphabet */ private static class Rus { private static final String[] KEY_TO_CHARS = { "" /* 0 */, "" /* 1 */, "АБВГ" /* 2 */, - "ДЕЖЗ" /* 3 */, + "ДЕЁЖЗ" /* 3 */, "ИЙКЛ" /* 4 */, "МНОП" /* 5 */, "РСТУ" /* 6 */, @@ -71,6 +92,27 @@ public class DialpadCharMappings { getCharToKeyMap(KEY_TO_CHARS); } + /** The character mapping for the Ukrainian alphabet */ + private static class Ukr { + private static final String[] KEY_TO_CHARS = { + "" /* 0 */, + "" /* 1 */, + "АБВГҐ" /* 2 */, + "ДЕЄЖЗ" /* 3 */, + "ИІЇЙКЛ" /* 4 */, + "МНОП" /* 5 */, + "РСТУ" /* 6 */, + "ФХЦЧ" /* 7 */, + "ШЩ" /* 8 */, + "ЬЮЯ" /* 9 */, + "" /* * */, + "" /* # */, + }; + + private static final SimpleArrayMap CHAR_TO_KEY = + getCharToKeyMap(KEY_TO_CHARS); + } + // A map in which each key is an ISO 639-2 language code and the corresponding value is a // character-key map. private static final SimpleArrayMap> @@ -81,8 +123,13 @@ public class DialpadCharMappings { private static final SimpleArrayMap KEY_TO_CHAR_MAPS = new SimpleArrayMap<>(); static { + CHAR_TO_KEY_MAPS.put("bul", Bul.CHAR_TO_KEY); CHAR_TO_KEY_MAPS.put("rus", Rus.CHAR_TO_KEY); + CHAR_TO_KEY_MAPS.put("ukr", Ukr.CHAR_TO_KEY); + + KEY_TO_CHAR_MAPS.put("bul", Bul.KEY_TO_CHARS); KEY_TO_CHAR_MAPS.put("rus", Rus.KEY_TO_CHARS); + KEY_TO_CHAR_MAPS.put("ukr", Ukr.KEY_TO_CHARS); } /** -- cgit v1.2.3