aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Zur <tristan.zur@ccwn.org>2015-01-11 01:09:46 +0100
committerTristan Zur <tristan.zur@ccwn.org>2015-01-11 01:40:25 +0100
commit5a860416b502833b445f10cea004735910ef0986 (patch)
tree1334b3767a292cdbd0483160a52d74978e106585 /src
parent0464a6a3fad6b6976fa924ae4307a5bf93e563c8 (diff)
Setting added for parsing emoticons or not
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java5
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java5
-rw-r--r--src/main/res/values-de/strings.xml2
-rw-r--r--src/main/res/values/strings.xml2
-rw-r--r--src/main/res/xml/preferences.xml5
5 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index a44851e3..6758acb6 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -14,6 +14,7 @@ import eu.siacs.conversations.utils.UIHelper;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
+import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -139,7 +140,9 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
} else {
if ((message.getEncryption() != Message.ENCRYPTION_PGP)
&& (message.getEncryption() != Message.ENCRYPTION_DECRYPTION_FAILED)) {
- mLastMessage.setText(Config.PARSE_EMOTICONS ? UIHelper
+ boolean parseEmoticons = PreferenceManager
+ .getDefaultSharedPreferences(activity).getBoolean("parse_emoticons", true);
+ mLastMessage.setText(parseEmoticons ? UIHelper
.transformAsciiEmoticons(getContext(), message.getBody()) : message
.getBody());
} else {
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index 249edecd..88c5c93d 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -5,6 +5,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Typeface;
import android.net.Uri;
+import android.preference.PreferenceManager;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
@@ -225,7 +226,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.messageBody.setVisibility(View.VISIBLE);
if (message.getBody() != null) {
if (message.getType() != Message.TYPE_PRIVATE) {
- viewHolder.messageBody.setText(Config.PARSE_EMOTICONS ? UIHelper
+ boolean parseEmoticons = PreferenceManager
+ .getDefaultSharedPreferences(getContext()).getBoolean("parse_emoticons", true);
+ viewHolder.messageBody.setText(parseEmoticons ? UIHelper
.transformAsciiEmoticons(getContext(), message.getMergedBody())
: message.getMergedBody());
} else {
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index 9e8e3b3d..72352e7d 100644
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -121,6 +121,8 @@
<string name="pref_confirm_messages">Lesebestätigung senden</string>
<string name="pref_confirm_messages_summary">Informiere deine Kontakte, wenn du eine Nachricht empfängst oder liest</string>
<string name="pref_ui_options">Benutzeroberfläche</string>
+ <string name="pref_parse_emoticons">Smilies ersetzen</string>
+ <string name="pref_parse_emoticons_summary">Zeige Smilie-Bilder anstelle von Emoticons.</string>
<string name="openpgp_error">Fehler mit OpenKeychain</string>
<string name="error_decrypting_file">Fehler beim Entschlüsseln der Datei</string>
<string name="accept">Annehmen</string>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 45174cd8..bc3c4ece 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -123,6 +123,8 @@
<string name="pref_confirm_messages">Confirm Messages</string>
<string name="pref_confirm_messages_summary">Let your contact know when you have received and read a message</string>
<string name="pref_ui_options">UI Options</string>
+ <string name="pref_parse_emoticons">Parse Emoticons</string>
+ <string name="pref_parse_emoticons_summary">Replace emoticons with smilies.</string>
<string name="openpgp_error">OpenKeychain reported an error</string>
<string name="error_decrypting_file">I/O Error decrypting file</string>
<string name="accept">Accept</string>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 9974f14d..97874738 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -28,6 +28,11 @@
android:key="confirm_messages"
android:summary="@string/pref_confirm_messages_summary"
android:title="@string/pref_confirm_messages" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="parse_emoticons"
+ android:summary="@string/pref_parse_emoticons_summary"
+ android:title="Parse Emoticons"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_notification_settings" >
<CheckBoxPreference