recreate activities when theme changed

This commit is contained in:
Daniel Gultsch 2016-09-18 20:26:47 +02:00
parent 6b904d4de1
commit 7c608c8862
5 changed files with 36 additions and 5 deletions

View File

@ -270,6 +270,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()) {

View File

@ -227,10 +227,15 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
@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.showDynamicTags = preferences.getBoolean("show_dynamic_tags", false);
this.showLastSeen = preferences.getBoolean("last_activity", false);
}
}
@Override
public boolean onOptionsItemSelected(final MenuItem menuItem) {

View File

@ -587,7 +587,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) {

View File

@ -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) {

View File

@ -282,8 +282,13 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
@Override
public void onStart() {
super.onStart();
final int theme = findTheme();
if (this.mTheme != theme) {
recreate();
} else {
askForContactsPermissions();
}
}
@Override
public void onStop() {