From 4fe3b4539a63c99515450af069d51e20722d3992 Mon Sep 17 00:00:00 2001 From: Mishiranu Date: Tue, 20 Sep 2016 02:18:50 +0300 Subject: Fix "More table" layout Retain "More table" visibility on screen orientation change --- .../java/de/pixart/messenger/ui/EditAccountActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index ae23336ae..142683c04 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -517,6 +517,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate this.mSaveButton.setOnClickListener(this.mSaveButtonClickListener); this.mCancelButton.setOnClickListener(this.mCancelButtonClickListener); this.mMoreTable = (TableLayout) findViewById(R.id.server_info_more); + if (savedInstanceState != null && savedInstanceState.getBoolean("showMoreTable")) { + changeMoreTableVisibility(true); + } final OnCheckedChangeListener OnCheckedShowConfirmPassword = new OnCheckedChangeListener() { @Override public void onCheckedChanged(final CompoundButton buttonView, @@ -582,6 +585,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate return super.onCreateOptionsMenu(menu); } + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more); + if (showMoreInfo.isVisible()) { + showMoreInfo.setChecked(mMoreTable.getVisibility() == View.VISIBLE); + } + return super.onPrepareOptionsMenu(menu); + } + @Override protected void onStart() { super.onStart(); -- cgit v1.2.3