diff --git a/libs/MemorizingTrustManager/res/values-v21/themes.xml b/libs/MemorizingTrustManager/res/values-v21/themes.xml
new file mode 100644
index 000000000..c2bd573f0
--- /dev/null
+++ b/libs/MemorizingTrustManager/res/values-v21/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libs/MemorizingTrustManager/res/values/defaults.xml b/libs/MemorizingTrustManager/res/values/defaults.xml
new file mode 100644
index 000000000..6fea62719
--- /dev/null
+++ b/libs/MemorizingTrustManager/res/values/defaults.xml
@@ -0,0 +1,4 @@
+
+
+ light
+
diff --git a/libs/MemorizingTrustManager/res/values/themes.xml b/libs/MemorizingTrustManager/res/values/themes.xml
new file mode 100644
index 000000000..2b0643154
--- /dev/null
+++ b/libs/MemorizingTrustManager/res/values/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java b/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java
index 013ac29b5..5aac2a6d6 100644
--- a/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java
+++ b/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java
@@ -24,20 +24,24 @@
package de.duenndns.ssl;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
-import android.content.DialogInterface.*;
+import android.content.DialogInterface.OnCancelListener;
+import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.os.Bundle;
+import android.preference.PreferenceManager;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class MemorizingActivity extends Activity
implements OnClickListener,OnCancelListener {
private final static Logger LOGGER = Logger.getLogger(MemorizingActivity.class.getName());
+ public static final String THEME = "theme";
int decisionId;
@@ -46,6 +50,7 @@ public class MemorizingActivity extends Activity
@Override
public void onCreate(Bundle savedInstanceState) {
LOGGER.log(Level.FINE, "onCreate");
+ setTheme(findTheme());
super.onCreate(savedInstanceState);
}
@@ -80,6 +85,15 @@ public class MemorizingActivity extends Activity
finish();
}
+ protected int findTheme() {
+ return getPreferences().getString(THEME, getResources().getString(R.string.theme)).equals("dark") ? R.style.ConversationsTheme_Dark : R.style.ConversationsTheme;
+ }
+
+ protected SharedPreferences getPreferences() {
+ return PreferenceManager
+ .getDefaultSharedPreferences(getApplicationContext());
+ }
+
// react on AlertDialog button press
public void onClick(DialogInterface dialog, int btnId) {
int decision;