aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-04-14 23:48:28 +0200
committerlookshe <github@lookshe.org>2015-04-14 23:48:28 +0200
commit549810783ce651f27bdd386488b6690195522372 (patch)
treebe050d54e7c591370c5c0dc9667ab6eb5056887b /src/main/java/de
parent8932dd9fb320b4641e707ae44de2c1d00996c358 (diff)
changed received and read confirmation setting to one list and put it to settings class
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/tzur/conversations/Settings.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main/java/de/tzur/conversations/Settings.java b/src/main/java/de/tzur/conversations/Settings.java
index 72084285..c919d60c 100644
--- a/src/main/java/de/tzur/conversations/Settings.java
+++ b/src/main/java/de/tzur/conversations/Settings.java
@@ -15,7 +15,7 @@ public final class Settings {
*/
public static void initSettingsClassWithPreferences(SharedPreferences preferences) {
Log.d("SETTING", "Initializing settings");
- String[] preferenceNames = { "parse_emoticons", "send_button_status", "led_notification_color", "auto_download_file_wlan", "auto_download_file_link" };
+ String[] preferenceNames = { "parse_emoticons", "send_button_status", "led_notification_color", "auto_download_file_wlan", "auto_download_file_link", "confirm_messages_list" };
for (String name : preferenceNames) {
Settings.synchronizeSettingsClassWithPreferences(preferences, name);
}
@@ -44,6 +44,16 @@ public final class Settings {
case "auto_download_file_link":
Settings.DOWNLOAD_IMAGE_LINKS = preferences.getBoolean(name, Settings.DOWNLOAD_IMAGE_LINKS);
break;
+ case "confirm_messages_list":
+ int iPref = Settings.CONFIRM_MESSAGE_RECEIVED && Settings.CONFIRM_MESSAGE_READ ? 2 : Settings.CONFIRM_MESSAGE_RECEIVED ? 1 : 0;
+ try {
+ iPref = Integer.valueOf(preferences.getString(name, new Integer(iPref).toString()));
+ } catch (NumberFormatException e) {
+ // ignored, fallback-value set above
+ }
+ Settings.CONFIRM_MESSAGE_RECEIVED = iPref >= 1;
+ Settings.CONFIRM_MESSAGE_READ = iPref >= 2;
+ break;
}
}
/**
@@ -66,6 +76,14 @@ public final class Settings {
* Boolean if automatic downloads should be done only jif connected to WLAN.
*/
public static boolean DOWNLOAD_ONLY_WLAN = true;
+ /**
+ * Boolean if confirm received messages
+ */
+ public static boolean CONFIRM_MESSAGE_RECEIVED = true;
+ /**
+ * Boolean if confirm read message
+ */
+ public static boolean CONFIRM_MESSAGE_READ = true;
/**
* This is a utility class - private constructor avoids any instantiation.