diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-09 20:22:21 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-09 20:22:21 +0100 |
commit | 05d1f46c15e5f29531f2d8c237f34cd08da80ef7 (patch) | |
tree | 088f457390e1d525c1c9743c56a06f1e847a12cc /src/main/java/eu/siacs/conversations | |
parent | ae3bd9c9e92f0e71ba9d0fdb87b6e08724be909b (diff) |
recreate activity after theme has changed. fixed #764
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 9 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 5b0fa562..b2bf2fd8 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -676,6 +676,15 @@ public class ConversationActivity extends XmppActivity implements } @Override + public void onResume() { + super.onResume(); + int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } + } + + @Override public void onSaveInstanceState(final Bundle savedInstanceState) { Conversation conversation = getSelectedConversation(); if (conversation != null) { diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 5fba1664..e6ae2a1c 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -94,6 +94,7 @@ public abstract class XmppActivity extends Activity { protected boolean mUseSubject = true; private DisplayMetrics metrics; + protected int mTheme; protected interface OnValueEdited { public void onValueEdited(String value); @@ -292,9 +293,8 @@ public abstract class XmppActivity extends Activity { mPrimaryColor = getResources().getColor(R.color.primary); mSecondaryBackgroundColor = getResources().getColor( R.color.secondarybackground); - if (getPreferences().getBoolean("use_larger_font", false)) { - setTheme(R.style.ConversationsTheme_LargerText); - } + this.mTheme = findTheme(); + setTheme(this.mTheme); mUseSubject = getPreferences().getBoolean("use_subject", true); } @@ -721,6 +721,14 @@ public abstract class XmppActivity extends Activity { } } + protected int findTheme() { + if (getPreferences().getBoolean("use_larger_font", false)) { + return R.style.ConversationsTheme_LargerText; + } else { + return R.style.ConversationsTheme; + } + } + @Override public void onPause() { super.onPause(); |