1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Restore view visibility based on restored CheckBox state

The problem can be observed if, when modifying the outgoing server
settings, you change the state of the mRequireLoginView check box,
then change the screen orientation.

This is necessary because the OnCheckChanged listener (which
normally updates the view visibility) is not yet set. (The listeners
are set up after view initialization so that they only fire on
user input.)
This commit is contained in:
Joe Steele 2014-07-30 10:52:01 -04:00
parent 346d903ec3
commit c5085be2ca

View File

@ -311,6 +311,12 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (mRequireLoginView.isChecked()) {
mRequireLoginSettingsView.setVisibility(View.VISIBLE);
} else {
mRequireLoginSettingsView.setVisibility(View.GONE);
}
/*
* We didn't want the listeners active while the state was being restored
* because they could overwrite the restored port with a default port when