Add SmileyParser from the android Mms application.
Integrate it in the Chat activity. Fix #66
Improvement will be to put the smiley spannable in the current EditText
Binary file res/drawable-hdpi/emo_im_angel.png has changed
Binary file res/drawable-hdpi/emo_im_cool.png has changed
Binary file res/drawable-hdpi/emo_im_crying.png has changed
Binary file res/drawable-hdpi/emo_im_embarrassed.png has changed
Binary file res/drawable-hdpi/emo_im_foot_in_mouth.png has changed
Binary file res/drawable-hdpi/emo_im_happy.png has changed
Binary file res/drawable-hdpi/emo_im_heart.png has changed
Binary file res/drawable-hdpi/emo_im_kissing.png has changed
Binary file res/drawable-hdpi/emo_im_laughing.png has changed
Binary file res/drawable-hdpi/emo_im_lips_are_sealed.png has changed
Binary file res/drawable-hdpi/emo_im_mad.png has changed
Binary file res/drawable-hdpi/emo_im_money_mouth.png has changed
Binary file res/drawable-hdpi/emo_im_pokerface.png has changed
Binary file res/drawable-hdpi/emo_im_sad.png has changed
Binary file res/drawable-hdpi/emo_im_smirk.png has changed
Binary file res/drawable-hdpi/emo_im_surprised.png has changed
Binary file res/drawable-hdpi/emo_im_tongue_sticking_out.png has changed
Binary file res/drawable-hdpi/emo_im_undecided.png has changed
Binary file res/drawable-hdpi/emo_im_winking.png has changed
Binary file res/drawable-hdpi/emo_im_wtf.png has changed
Binary file res/drawable-hdpi/emo_im_yelling.png has changed
Binary file res/drawable-mdpi/emo_im_angel.png has changed
Binary file res/drawable-mdpi/emo_im_cool.png has changed
Binary file res/drawable-mdpi/emo_im_crying.png has changed
Binary file res/drawable-mdpi/emo_im_embarrassed.png has changed
Binary file res/drawable-mdpi/emo_im_foot_in_mouth.png has changed
Binary file res/drawable-mdpi/emo_im_happy.png has changed
Binary file res/drawable-mdpi/emo_im_heart.png has changed
Binary file res/drawable-mdpi/emo_im_kissing.png has changed
Binary file res/drawable-mdpi/emo_im_laughing.png has changed
Binary file res/drawable-mdpi/emo_im_lips_are_sealed.png has changed
Binary file res/drawable-mdpi/emo_im_mad.png has changed
Binary file res/drawable-mdpi/emo_im_money_mouth.png has changed
Binary file res/drawable-mdpi/emo_im_pokerface.png has changed
Binary file res/drawable-mdpi/emo_im_sad.png has changed
Binary file res/drawable-mdpi/emo_im_smirk.png has changed
Binary file res/drawable-mdpi/emo_im_surprised.png has changed
Binary file res/drawable-mdpi/emo_im_tongue_sticking_out.png has changed
Binary file res/drawable-mdpi/emo_im_undecided.png has changed
Binary file res/drawable-mdpi/emo_im_winking.png has changed
Binary file res/drawable-mdpi/emo_im_wtf.png has changed
Binary file res/drawable-mdpi/emo_im_yelling.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-de/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Glücklich"</item>
+ <item msgid="1601611480575517120">"Traurig"</item>
+ <item msgid="1531181614218625881">"Zwinkern"</item>
+ <item msgid="3858808057949077894">"Frech"</item>
+ <item msgid="7835238297967185651">"Überrascht"</item>
+ <item msgid="1756223535005296033">"Kuss"</item>
+ <item msgid="1093906245140165107">"Schreien"</item>
+ <item msgid="888834839864150170">"Cool"</item>
+ <item msgid="6320683740534773967">"Dollarzeichen"</item>
+ <item msgid="6610111212478853990">"Fettnäpfchen"</item>
+ <item msgid="1706035208563940251">"Peinlich berührt"</item>
+ <item msgid="9079275787422313427">"Engel"</item>
+ <item msgid="4630490399784004880">"Unentschlossen"</item>
+ <item msgid="7002574538342357456">"Weinen"</item>
+ <item msgid="850324578089267455">"Versiegelte Lippen"</item>
+ <item msgid="6334637439528489607">"Fröhlich"</item>
+ <item msgid="7602915122893958066">"Verwirrt"</item>
+ <item msgid="3939233701582771068">"Verliebt"</item>
+ <item msgid="1414759480575851587">"Verärgert"</item>
+ <item msgid="8479809115158836070">"Grinsen"</item>
+ <item msgid="638612939305162424">"Pokergesicht"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-es/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Contento"</item>
+ <item msgid="1601611480575517120">"Triste"</item>
+ <item msgid="1531181614218625881">"Guiño"</item>
+ <item msgid="3858808057949077894">"Sacando la lengua"</item>
+ <item msgid="7835238297967185651">"Sorprendido"</item>
+ <item msgid="1756223535005296033">"Besando"</item>
+ <item msgid="1093906245140165107">"Sorpresa"</item>
+ <item msgid="888834839864150170">"Atractivo"</item>
+ <item msgid="6320683740534773967">"Dinero en la boca"</item>
+ <item msgid="6610111212478853990">"Metedura de pata"</item>
+ <item msgid="1706035208563940251">"Avergonzado"</item>
+ <item msgid="9079275787422313427">"Ángel"</item>
+ <item msgid="4630490399784004880">"Indeciso"</item>
+ <item msgid="7002574538342357456">"Llorando"</item>
+ <item msgid="850324578089267455">"Labios sellados"</item>
+ <item msgid="6334637439528489607">"Riendo"</item>
+ <item msgid="7602915122893958066">"Confuso"</item>
+ <item msgid="3939233701582771068">"Corazón"</item>
+ <item msgid="1414759480575851587">"Enfadado"</item>
+ <item msgid="8479809115158836070">"No mola"</item>
+ <item msgid="638612939305162424">"Cara de póquer"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-fr/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Content"</item>
+ <item msgid="1601611480575517120">"Triste"</item>
+ <item msgid="1531181614218625881">"Clin d\'œil"</item>
+ <item msgid="3858808057949077894">"Tire la langue"</item>
+ <item msgid="7835238297967185651">"Surpris"</item>
+ <item msgid="1756223535005296033">"Bisou"</item>
+ <item msgid="1093906245140165107">"Hurle"</item>
+ <item msgid="888834839864150170">"Cool"</item>
+ <item msgid="6320683740534773967">"Argent"</item>
+ <item msgid="6610111212478853990">"Embarrassé"</item>
+ <item msgid="1706035208563940251">"Gêné"</item>
+ <item msgid="9079275787422313427">"Ange"</item>
+ <item msgid="4630490399784004880">"Indécis"</item>
+ <item msgid="7002574538342357456">"Pleure"</item>
+ <item msgid="850324578089267455">"Motus"</item>
+ <item msgid="6334637439528489607">"Rigole"</item>
+ <item msgid="7602915122893958066">"Confus"</item>
+ <item msgid="3939233701582771068">"Cœur"</item>
+ <item msgid="1414759480575851587">"Mécontent"</item>
+ <item msgid="8479809115158836070">"Sourire en coin"</item>
+ <item msgid="638612939305162424">"Impassible"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-it/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Felice"</item>
+ <item msgid="1601611480575517120">"Triste"</item>
+ <item msgid="1531181614218625881">"Occhiolino"</item>
+ <item msgid="3858808057949077894">"Linguaccia"</item>
+ <item msgid="7835238297967185651">"Sorpreso"</item>
+ <item msgid="1756223535005296033">"Bacio"</item>
+ <item msgid="1093906245140165107">"Urlo"</item>
+ <item msgid="888834839864150170">"Fico"</item>
+ <item msgid="6320683740534773967">"Fatti, non parole"</item>
+ <item msgid="6610111212478853990">"Gaffe"</item>
+ <item msgid="1706035208563940251">"Imbarazzato"</item>
+ <item msgid="9079275787422313427">"Angelo"</item>
+ <item msgid="4630490399784004880">"Indeciso"</item>
+ <item msgid="7002574538342357456">"Piango"</item>
+ <item msgid="850324578089267455">"Labbra cucite"</item>
+ <item msgid="6334637439528489607">"Risata"</item>
+ <item msgid="7602915122893958066">"Confuso"</item>
+ <item msgid="3939233701582771068">"Cuore"</item>
+ <item msgid="1414759480575851587">"Arrabbiato"</item>
+ <item msgid="8479809115158836070">"Ghigno"</item>
+ <item msgid="638612939305162424">"Impassibile"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-nb/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Glad"</item>
+ <item msgid="1601611480575517120">"Trist"</item>
+ <item msgid="1531181614218625881">"Blunker"</item>
+ <item msgid="3858808057949077894">"Rekker tunge"</item>
+ <item msgid="7835238297967185651">"Overrasket"</item>
+ <item msgid="1756223535005296033">"Kyss"</item>
+ <item msgid="1093906245140165107">"Roper"</item>
+ <item msgid="888834839864150170">"Kul"</item>
+ <item msgid="6320683740534773967">"Pengemunn"</item>
+ <item msgid="6610111212478853990">"Fot i munnen"</item>
+ <item msgid="1706035208563940251">"Flau"</item>
+ <item msgid="9079275787422313427">"Engel"</item>
+ <item msgid="4630490399784004880">"Usikker"</item>
+ <item msgid="7002574538342357456">"Gråter"</item>
+ <item msgid="850324578089267455">"Stille som graven"</item>
+ <item msgid="6334637439528489607">"Ler"</item>
+ <item msgid="7602915122893958066">"Forvirret"</item>
+ <item msgid="3939233701582771068">"Hjerte"</item>
+ <item msgid="1414759480575851587">"Sint"</item>
+ <item msgid="8479809115158836070">"Glis"</item>
+ <item msgid="638612939305162424">"Pokerfjes"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-pt/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Feliz"</item>
+ <item msgid="1601611480575517120">"Triste"</item>
+ <item msgid="1531181614218625881">"Piscando"</item>
+ <item msgid="3858808057949077894">"Mostrando a língua"</item>
+ <item msgid="7835238297967185651">"Surpreso"</item>
+ <item msgid="1756223535005296033">"Beijando"</item>
+ <item msgid="1093906245140165107">"Gritando"</item>
+ <item msgid="888834839864150170">"Tranquilo"</item>
+ <item msgid="6320683740534773967">"Louco por dinheiro"</item>
+ <item msgid="6610111212478853990">"Falei besteira"</item>
+ <item msgid="1706035208563940251">"Envergonhado"</item>
+ <item msgid="9079275787422313427">"Anjo"</item>
+ <item msgid="4630490399784004880">"Indeciso"</item>
+ <item msgid="7002574538342357456">"Chorando"</item>
+ <item msgid="850324578089267455">"Boca fechada"</item>
+ <item msgid="6334637439528489607">"Rindo"</item>
+ <item msgid="7602915122893958066">"Confuso"</item>
+ <item msgid="3939233701582771068">"Coração"</item>
+ <item msgid="1414759480575851587">"Louco"</item>
+ <item msgid="8479809115158836070">"Sorriso forçado"</item>
+ <item msgid="638612939305162424">"Indiferente"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-ru/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Радость"</item>
+ <item msgid="1601611480575517120">"Грустный"</item>
+ <item msgid="1531181614218625881">"Подмигивает"</item>
+ <item msgid="3858808057949077894">"Показывает язык"</item>
+ <item msgid="7835238297967185651">"Удивлен"</item>
+ <item msgid="1756223535005296033">"Поцелуй"</item>
+ <item msgid="1093906245140165107">"Кричит"</item>
+ <item msgid="888834839864150170">"Крутой"</item>
+ <item msgid="6320683740534773967">"Не болтай попусту"</item>
+ <item msgid="6610111212478853990">"В замешательстве"</item>
+ <item msgid="1706035208563940251">"Смущение"</item>
+ <item msgid="9079275787422313427">"Ангел"</item>
+ <item msgid="4630490399784004880">"Нерешительный"</item>
+ <item msgid="7002574538342357456">"Плачет"</item>
+ <item msgid="850324578089267455">"Не скажу"</item>
+ <item msgid="6334637439528489607">"Смех"</item>
+ <item msgid="7602915122893958066">"Озадаченный"</item>
+ <item msgid="3939233701582771068">"Сердце"</item>
+ <item msgid="1414759480575851587">"Злой"</item>
+ <item msgid="8479809115158836070">"Ухмылка"</item>
+ <item msgid="638612939305162424">"Невозмутимость"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-sv/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"Glad"</item>
+ <item msgid="1601611480575517120">"Ledsen"</item>
+ <item msgid="1531181614218625881">"Blinkar"</item>
+ <item msgid="3858808057949077894">"Lipar"</item>
+ <item msgid="7835238297967185651">"Förvånad"</item>
+ <item msgid="1756223535005296033">"Pussar"</item>
+ <item msgid="1093906245140165107">"Skriker"</item>
+ <item msgid="888834839864150170">"Cool"</item>
+ <item msgid="6320683740534773967">"Dollarmun"</item>
+ <item msgid="6610111212478853990">"Bortgjord"</item>
+ <item msgid="1706035208563940251">"Generad"</item>
+ <item msgid="9079275787422313427">"Ängel"</item>
+ <item msgid="4630490399784004880">"Tveksam"</item>
+ <item msgid="7002574538342357456">"Gråter"</item>
+ <item msgid="850324578089267455">"Hemlis"</item>
+ <item msgid="6334637439528489607">"Skrattar"</item>
+ <item msgid="7602915122893958066">"Förvirrad"</item>
+ <item msgid="3939233701582771068">"Hjärta"</item>
+ <item msgid="1414759480575851587">"Arg"</item>
+ <item msgid="8479809115158836070">"Flinar"</item>
+ <item msgid="638612939305162424">"Pokeransikte"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-zh-rCN/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"开心"</item>
+ <item msgid="1601611480575517120">"忧伤"</item>
+ <item msgid="1531181614218625881">"眨眼"</item>
+ <item msgid="3858808057949077894">"吐舌"</item>
+ <item msgid="7835238297967185651">"惊讶"</item>
+ <item msgid="1756223535005296033">"亲吻"</item>
+ <item msgid="1093906245140165107">"叫喊"</item>
+ <item msgid="888834839864150170">"酷"</item>
+ <item msgid="6320683740534773967">"财迷"</item>
+ <item msgid="6610111212478853990">"说错了话"</item>
+ <item msgid="1706035208563940251">"尴尬"</item>
+ <item msgid="9079275787422313427">"天使"</item>
+ <item msgid="4630490399784004880">"犹豫"</item>
+ <item msgid="7002574538342357456">"哭泣"</item>
+ <item msgid="850324578089267455">"保密"</item>
+ <item msgid="6334637439528489607">"大笑"</item>
+ <item msgid="7602915122893958066">"困惑"</item>
+ <item msgid="3939233701582771068">"爱之心"</item>
+ <item msgid="1414759480575851587">"生气"</item>
+ <item msgid="8479809115158836070">"傻笑"</item>
+ <item msgid="638612939305162424">"一本正经"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values-zh-rTW/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string-array name="default_smiley_names">
+ <item msgid="1831934949361041701">"開心"</item>
+ <item msgid="1601611480575517120">"傷心"</item>
+ <item msgid="1531181614218625881">"眨眼"</item>
+ <item msgid="3858808057949077894">"吐舌頭"</item>
+ <item msgid="7835238297967185651">"驚訝"</item>
+ <item msgid="1756223535005296033">"紅唇"</item>
+ <item msgid="1093906245140165107">"大喊"</item>
+ <item msgid="888834839864150170">"酷"</item>
+ <item msgid="6320683740534773967">"滿嘴錢"</item>
+ <item msgid="6610111212478853990">"說錯話"</item>
+ <item msgid="1706035208563940251">"害羞"</item>
+ <item msgid="9079275787422313427">"天使"</item>
+ <item msgid="4630490399784004880">"還沒決定"</item>
+ <item msgid="7002574538342357456">"嚎啕大哭"</item>
+ <item msgid="850324578089267455">"不要告訴別人"</item>
+ <item msgid="6334637439528489607">"開懷大笑"</item>
+ <item msgid="7602915122893958066">"疑惑"</item>
+ <item msgid="3939233701582771068">"愛心"</item>
+ <item msgid="1414759480575851587">"生氣"</item>
+ <item msgid="8479809115158836070">"傻笑"</item>
+ <item msgid="638612939305162424">"撲克臉"</item>
+ </string-array>
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/values/smileys.xml Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 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.
+ -->
+<resources>
+ <!-- NOTE: if you change anything about this array, you must make the corresponding change
+ to the array DEFAULT_SMILEY_RES_IDS in MessageListItem.java and to default_smiley_names
+ below. -->
+ <string-array name="default_smiley_texts" translatable="false">
+ <item>:-)</item> <!-- 0: Happy -->
+ <item>:-(</item> <!-- 1: Sad -->
+ <item>;-)</item> <!-- 2: Winking -->
+ <item>:-P</item> <!-- 3: Tongue sticking out -->
+ <item>=-O</item> <!-- 4: Surprised -->
+ <item>:-*</item> <!-- 5: Kissing -->
+ <item>:O</item> <!-- 6: Yelling -->
+ <item>B-)</item> <!-- 7: Cool -->
+ <item>:-$</item> <!-- 8: Money mouth -->
+ <item>:-!</item> <!-- 9: Foot in mouth -->
+ <item>:-[</item> <!-- 10: Embarrassed -->
+ <item>O:-)</item> <!-- 11: Angel -->
+ <item>:-\\</item> <!-- 12: Undecided -->
+ <item>:\'(</item> <!-- 13: Crying -->
+ <item>:-X</item> <!-- 14: Lips are sealed -->
+ <item>:-D</item> <!-- 15: Laughing -->
+ <item>o_O</item> <!-- 16: Confused -->
+ <item><3</item> <!-- 17: Heart -->
+ <item>x-(</item> <!-- 18: Mad -->
+ <item>:-/</item> <!-- 19: Smirk -->
+ <item>:-I</item> <!-- 20: Poker face -->
+ </string-array>
+
+ <!-- NOTE: if you change anything about this array, you must make the corresponding change
+ to the array DEFAULT_SMILEY_RES_IDS in SmileyParser.java and to default_smiley_texts
+ above. -->
+ <string-array name="default_smiley_names">
+ <item>Happy</item> <!-- 0: :-) -->
+ <item>Sad</item> <!-- 1: :-( -->
+ <item>Winking</item> <!-- 2: ;-) -->
+ <item>Tongue sticking out</item> <!-- 3: :-P -->
+ <item>Surprised</item> <!-- 4: =-O -->
+ <item>Kissing</item> <!-- 5: :-* -->
+ <item>Yelling</item> <!-- 6: :O -->
+ <item>Cool</item> <!-- 7: B-) -->
+ <item>Money mouth</item> <!-- 8: :-$ -->
+ <item>Foot in mouth</item> <!-- 9: :-! -->
+ <item>Embarrassed</item> <!-- 10: :-[ -->
+ <item>Angel</item> <!-- 11: O:-) -->
+ <item>Undecided</item> <!-- 12: :-\\ -->
+ <item>Crying</item> <!-- 13: :\'( -->
+ <item>Lips are sealed</item> <!-- 14: :-X -->
+ <item>Laughing</item> <!-- 15: :-D -->
+ <item>Confused</item> <!-- 16: o_O -->
+ <item>Heart</item> <!-- 17: <3 -->
+ <item>Mad</item> <!-- 18: x-( -->
+ <item>Smirk</item> <!-- 19: :-/ -->
+ <item>Poker face</item> <!-- 20: :-I -->
+ </string-array>
+
+</resources>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/android/mms/util/SmileyParser.java Fri Dec 07 00:43:25 2012 +0100
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+package com.android.mms.util;
+
+import java.util.HashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import android.content.Context;
+import android.text.Spannable;
+import android.text.SpannableStringBuilder;
+import android.text.style.ImageSpan;
+
+import com.beem.project.beem.R;
+
+/**
+ * A class for annotating a CharSequence with spans to convert textual emoticons
+ * to graphical ones.
+ */
+public class SmileyParser {
+ // Singleton stuff
+ private static SmileyParser sInstance;
+ public static SmileyParser getInstance() { return sInstance; }
+ public static void init(Context context) {
+ sInstance = new SmileyParser(context);
+ }
+
+ private final Context mContext;
+ private final String[] mSmileyTexts;
+ private final Pattern mPattern;
+ private final HashMap<String, Integer> mSmileyToRes;
+
+ private SmileyParser(Context context) {
+ mContext = context;
+ mSmileyTexts = mContext.getResources().getStringArray(DEFAULT_SMILEY_TEXTS);
+ mSmileyToRes = buildSmileyToRes();
+ mPattern = buildPattern();
+ }
+
+ static class Smileys {
+ private static final int[] sIconIds = {
+ R.drawable.emo_im_happy,
+ R.drawable.emo_im_sad,
+ R.drawable.emo_im_winking,
+ R.drawable.emo_im_tongue_sticking_out,
+ R.drawable.emo_im_surprised,
+ R.drawable.emo_im_kissing,
+ R.drawable.emo_im_yelling,
+ R.drawable.emo_im_cool,
+ R.drawable.emo_im_money_mouth,
+ R.drawable.emo_im_foot_in_mouth,
+ R.drawable.emo_im_embarrassed,
+ R.drawable.emo_im_angel,
+ R.drawable.emo_im_undecided,
+ R.drawable.emo_im_crying,
+ R.drawable.emo_im_lips_are_sealed,
+ R.drawable.emo_im_laughing,
+ R.drawable.emo_im_wtf,
+ R.drawable.emo_im_heart,
+ R.drawable.emo_im_mad,
+ R.drawable.emo_im_smirk,
+ R.drawable.emo_im_pokerface
+ };
+
+ public static int HAPPY = 0;
+ public static int SAD = 1;
+ public static int WINKING = 2;
+ public static int TONGUE_STICKING_OUT = 3;
+ public static int SURPRISED = 4;
+ public static int KISSING = 5;
+ public static int YELLING = 6;
+ public static int COOL = 7;
+ public static int MONEY_MOUTH = 8;
+ public static int FOOT_IN_MOUTH = 9;
+ public static int EMBARRASSED = 10;
+ public static int ANGEL = 11;
+ public static int UNDECIDED = 12;
+ public static int CRYING = 13;
+ public static int LIPS_ARE_SEALED = 14;
+ public static int LAUGHING = 15;
+ public static int WTF = 16;
+ public static int MAD = 17;
+ public static int HEART = 18;
+ public static int SMIRK = 19;
+ public static int POKERFACE = 20;
+
+ public static int getSmileyResource(int which) {
+ return sIconIds[which];
+ }
+ }
+
+ // NOTE: if you change anything about this array, you must make the corresponding change
+ // to the string arrays: default_smiley_texts and default_smiley_names in res/values/arrays.xml
+ public static final int[] DEFAULT_SMILEY_RES_IDS = {
+ Smileys.getSmileyResource(Smileys.HAPPY), // 0
+ Smileys.getSmileyResource(Smileys.SAD), // 1
+ Smileys.getSmileyResource(Smileys.WINKING), // 2
+ Smileys.getSmileyResource(Smileys.TONGUE_STICKING_OUT), // 3
+ Smileys.getSmileyResource(Smileys.SURPRISED), // 4
+ Smileys.getSmileyResource(Smileys.KISSING), // 5
+ Smileys.getSmileyResource(Smileys.YELLING), // 6
+ Smileys.getSmileyResource(Smileys.COOL), // 7
+ Smileys.getSmileyResource(Smileys.MONEY_MOUTH), // 8
+ Smileys.getSmileyResource(Smileys.FOOT_IN_MOUTH), // 9
+ Smileys.getSmileyResource(Smileys.EMBARRASSED), // 10
+ Smileys.getSmileyResource(Smileys.ANGEL), // 11
+ Smileys.getSmileyResource(Smileys.UNDECIDED), // 12
+ Smileys.getSmileyResource(Smileys.CRYING), // 13
+ Smileys.getSmileyResource(Smileys.LIPS_ARE_SEALED), // 14
+ Smileys.getSmileyResource(Smileys.LAUGHING), // 15
+ Smileys.getSmileyResource(Smileys.WTF), // 16
+ Smileys.getSmileyResource(Smileys.MAD), // 17
+ Smileys.getSmileyResource(Smileys.HEART), // 18
+ Smileys.getSmileyResource(Smileys.SMIRK), // 19
+ Smileys.getSmileyResource(Smileys.POKERFACE), // 20
+ };
+
+ public static final int DEFAULT_SMILEY_TEXTS = R.array.default_smiley_texts;
+ public static final int DEFAULT_SMILEY_NAMES = R.array.default_smiley_names;
+
+ /**
+ * Builds the hashtable we use for mapping the string version
+ * of a smiley (e.g. ":-)") to a resource ID for the icon version.
+ */
+ private HashMap<String, Integer> buildSmileyToRes() {
+ if (DEFAULT_SMILEY_RES_IDS.length != mSmileyTexts.length) {
+ // Throw an exception if someone updated DEFAULT_SMILEY_RES_IDS
+ // and failed to update arrays.xml
+ throw new IllegalStateException("Smiley resource ID/text mismatch");
+ }
+
+ HashMap<String, Integer> smileyToRes =
+ new HashMap<String, Integer>(mSmileyTexts.length);
+ for (int i = 0; i < mSmileyTexts.length; i++) {
+ smileyToRes.put(mSmileyTexts[i], DEFAULT_SMILEY_RES_IDS[i]);
+ }
+
+ return smileyToRes;
+ }
+
+ /**
+ * Builds the regular expression we use to find smileys in {@link #addSmileySpans}.
+ */
+ private Pattern buildPattern() {
+ // Set the StringBuilder capacity with the assumption that the average
+ // smiley is 3 characters long.
+ StringBuilder patternString = new StringBuilder(mSmileyTexts.length * 3);
+
+ // Build a regex that looks like (:-)|:-(|...), but escaping the smilies
+ // properly so they will be interpreted literally by the regex matcher.
+ patternString.append('(');
+ for (String s : mSmileyTexts) {
+ patternString.append(Pattern.quote(s));
+ patternString.append('|');
+ }
+ // Replace the extra '|' with a ')'
+ patternString.replace(patternString.length() - 1, patternString.length(), ")");
+
+ return Pattern.compile(patternString.toString());
+ }
+
+
+ /**
+ * Adds ImageSpans to a CharSequence that replace textual emoticons such
+ * as :-) with a graphical version.
+ *
+ * @param text A CharSequence possibly containing emoticons
+ * @return A CharSequence annotated with ImageSpans covering any
+ * recognized emoticons.
+ */
+ public CharSequence addSmileySpans(CharSequence text) {
+ SpannableStringBuilder builder = new SpannableStringBuilder(text);
+
+ Matcher matcher = mPattern.matcher(text);
+ while (matcher.find()) {
+ int resId = mSmileyToRes.get(matcher.group());
+ builder.setSpan(new ImageSpan(mContext, resId),
+ matcher.start(), matcher.end(),
+ Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ }
+
+ return builder;
+ }
+}
+
+
--- a/src/com/beem/project/beem/BeemApplication.java Fri Nov 02 10:56:48 2012 +0100
+++ b/src/com/beem/project/beem/BeemApplication.java Fri Dec 07 00:43:25 2012 +0100
@@ -49,6 +49,8 @@
import android.preference.PreferenceManager;
import android.text.TextUtils;
+import com.android.mms.util.SmileyParser;
+
/**
* This class contains informations that needs to be global in the application.
* Theses informations must be necessary for the activities and the service.
@@ -133,6 +135,7 @@
String password = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
mIsAccountConfigured = !("".equals(login) || "".equals(password));
mSettings.registerOnSharedPreferenceChangeListener(mPreferenceListener);
+ SmileyParser.init(this);
}
@Override
--- a/src/com/beem/project/beem/ui/Chat.java Fri Nov 02 10:56:48 2012 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Fri Dec 07 00:43:25 2012 +0100
@@ -90,6 +90,8 @@
import android.widget.ListView;
import android.widget.TextView;
+import com.android.mms.util.SmileyParser;
+
import com.beem.project.beem.BeemApplication;
import com.beem.project.beem.R;
import com.beem.project.beem.providers.AvatarProvider;
@@ -603,6 +605,16 @@
BitmapFactory.decodeResource(getResources(), R.drawable.status_requested));
}
+ /**
+ * Add smileys Spannable to a message string.
+ *
+ * @param msg the message containing optional smileys strings
+ * @return the message with smileys spannable
+ */
+ private CharSequence addSmileysToMessage(String msg) {
+ SmileyParser parser = SmileyParser.getInstance();
+ return parser.addSmileySpans(msg);
+ }
/**
* {@inheritDoc}.
@@ -851,7 +863,8 @@
msgName.setTextColor(Color.WHITE);
msgName.setError(null);
TextView msgText = (TextView) sv.findViewById(R.id.chatmessagetext);
- msgText.setText(msg.getMessage());
+ CharSequence msgBody = addSmileysToMessage(msg.getMessage());
+ msgText.setText(msgBody);
registerForContextMenu(msgText);
TextView msgDate = (TextView) sv.findViewById(R.id.chatmessagedate);
if (msg.getTimestamp() != null) {