diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-09-18 20:26:47 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-23 21:41:03 +0200 |
commit | 414febeb94b73733d660bed3993f0cde06360a42 (patch) | |
tree | 65250f5a5dd35443cea360f07cc64fd9782418c3 /src/main | |
parent | 449aa682f03acb6c4d49dfb5ed7b00bde65e8491 (diff) |
recreate activities when theme changed
Diffstat (limited to 'src/main')
5 files changed, 40 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 2ca287c96..d91c6e192 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -268,6 +268,15 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.mNotifyStatusText = (TextView) findViewById(R.id.notification_status_text); } + @Override + protected void onStart() { + super.onStart(); + final int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } + } + @Override public boolean onOptionsItemSelected(MenuItem menuItem) { switch (menuItem.getItemId()) { diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index d1880ea3b..9fc302c47 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -54,7 +54,6 @@ import de.pixart.messenger.xmpp.OnUpdateBlocklist; import de.pixart.messenger.xmpp.XmppConnection; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; -import github.ankushsachdeva.emojicon.EmojiconTextView; public class ContactDetailsActivity extends XmppActivity implements OnAccountUpdate, OnRosterUpdate, OnUpdateBlocklist, OnKeyStatusUpdated { public static final String ACTION_VIEW_CONTACT = "view_contact"; @@ -227,13 +226,18 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd } } - @Override - public void onStart() { - super.onStart(); - final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); - this.showDynamicTags = preferences.getBoolean("show_dynamic_tags",false); - this.showLastSeen = preferences.getBoolean("last_activity", true); - } + @Override + public void onStart() { + super.onStart(); + final int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } else { + final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + this.showDynamicTags = preferences.getBoolean("show_dynamic_tags", false); + this.showLastSeen = preferences.getBoolean("last_activity", false); + } + } @Override public boolean onOptionsItemSelected(final MenuItem menuItem) { diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index ad6518f33..ae23336ae 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -585,7 +585,10 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate @Override protected void onStart() { super.onStart(); - if (getIntent() != null) { + final int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } else if (getIntent() != null) { try { this.jidToEdit = Jid.fromString(getIntent().getStringExtra("jid")); } catch (final InvalidJidException | NullPointerException ignored) { diff --git a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java index edf4481b5..0eb5eda21 100644 --- a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java @@ -102,6 +102,15 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda registerForContextMenu(accountListView); } + @Override + protected void onStart() { + super.onStart(); + final int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } + } + @Override public void onSaveInstanceState(final Bundle savedInstanceState) { if (selectedAccount != null) { diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index 3c04b0818..f163cef72 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -281,7 +281,12 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU @Override public void onStart() { super.onStart(); - askForContactsPermissions(); + final int theme = findTheme(); + if (this.mTheme != theme) { + recreate(); + } else { + askForContactsPermissions(); + } } @Override |