diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-07 21:38:05 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-07 21:38:05 +0200 |
commit | 595a97676e6f062279314454c0c02ad01db74bf8 (patch) | |
tree | cc53dedd0d13e4a691643ce603e0717363fa14a8 /src/main/java/de/pixart/messenger | |
parent | 2253547a42510f663be33c659900eda9eefed115 (diff) |
hide register account checkbox in magic mode
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 83 |
1 files changed, 32 insertions, 51 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index f40930b14..3d977d96c 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -37,7 +37,6 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TableLayout; -import android.widget.TableRow; import android.widget.TextView; import android.widget.Toast; @@ -91,16 +90,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat private TextView getmDisableOsOptimizationsBody; private TableLayout mMoreTable; - private TextView mServerInfoSm; - private TextView mServerInfoRosterVersion; - private TextView mServerInfoCarbons; - private TextView mServerInfoMam; - private TextView mServerInfoCSI; - private TextView mServerInfoBlocking; - private TextView mServerInfoPep; - private TextView mServerInfoHttpUpload; - private TextView mServerInfoPush; - private TextView mSessionEst; private TextView mOtrFingerprint; private TextView mAxolotlFingerprint; private TextView mPgpFingerprint; @@ -292,7 +281,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } }; private Toast mFetchingMamPrefsToast; - private TableRow mPushRow; private String mSavedInstanceAccount; private boolean mSavedInstanceInit = false; private Button mClearDevicesButton; @@ -569,17 +557,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat this.mRegisterNew = findViewById(R.id.account_register_new); this.mDisableOsOptimizationsButton = findViewById(R.id.os_optimization_disable); this.getmDisableOsOptimizationsBody = findViewById(R.id.os_optimization_body); - this.mSessionEst = findViewById(R.id.session_est); - this.mServerInfoRosterVersion = findViewById(R.id.server_info_roster_version); - this.mServerInfoCarbons = findViewById(R.id.server_info_carbons); - this.mServerInfoMam = findViewById(R.id.server_info_mam); - this.mServerInfoCSI = findViewById(R.id.server_info_csi); - this.mServerInfoBlocking = findViewById(R.id.server_info_blocking); - this.mServerInfoSm = findViewById(R.id.server_info_sm); - this.mServerInfoPep = findViewById(R.id.server_info_pep); - this.mServerInfoHttpUpload = findViewById(R.id.server_info_http_upload); - this.mPushRow = findViewById(R.id.push_row); - this.mServerInfoPush = findViewById(R.id.server_info_push); this.mPgpFingerprintBox = findViewById(R.id.pgp_fingerprint_box); this.mPgpFingerprint = findViewById(R.id.pgp_fingerprint); this.getmPgpFingerprintDesc = findViewById(R.id.pgp_fingerprint_desc); @@ -1027,12 +1004,17 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } else { this.mAvatar.setVisibility(View.GONE); } - if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) { - this.mRegisterNew.setVisibility(View.VISIBLE); - this.mRegisterNew.setChecked(true); + this.binding.accountRegisterNew.setChecked(this.mAccount.isOptionSet(Account.OPTION_REGISTER)); + if (this.mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE)) { + if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) { + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setTitle(R.string.create_account); + } + } + this.binding.accountRegisterNew.setVisibility(View.GONE); } else { - this.mRegisterNew.setVisibility(View.GONE); - this.mRegisterNew.setChecked(false); + this.binding.accountRegisterNew.setVisibility(mInitMode ? View.VISIBLE : View.GONE); } if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) { Features features = this.mAccount.getXmppConnection().getFeatures(); @@ -1040,63 +1022,62 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat boolean showBatteryWarning = !xmppConnectionService.getPushManagementService().available(mAccount) && isOptimizingBattery(); boolean showDataSaverWarning = isAffectedByDataSaver(); showOsOptimizationWarning(showBatteryWarning, showDataSaverWarning); - this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection() + this.binding.sessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection() .getLastSessionEstablished())); if (features.rosterVersioning()) { - this.mServerInfoRosterVersion.setText(R.string.server_info_available); + this.binding.serverInfoRosterVersion.setText(R.string.server_info_available); } else { - this.mServerInfoRosterVersion.setText(R.string.server_info_unavailable); + this.binding.serverInfoRosterVersion.setText(R.string.server_info_unavailable); } if (features.carbons()) { - this.mServerInfoCarbons.setText(R.string.server_info_available); + this.binding.serverInfoCarbons.setText(R.string.server_info_available); } else { - this.mServerInfoCarbons - .setText(R.string.server_info_unavailable); + this.binding.serverInfoCarbons.setText(R.string.server_info_unavailable); } if (features.mam()) { - this.mServerInfoMam.setText(R.string.server_info_available); + this.binding.serverInfoMam.setText(R.string.server_info_available); } else { - this.mServerInfoMam.setText(R.string.server_info_unavailable); + this.binding.serverInfoMam.setText(R.string.server_info_unavailable); } if (features.csi()) { - this.mServerInfoCSI.setText(R.string.server_info_available); + this.binding.serverInfoCsi.setText(R.string.server_info_available); } else { - this.mServerInfoCSI.setText(R.string.server_info_unavailable); + this.binding.serverInfoCsi.setText(R.string.server_info_unavailable); } if (features.blocking()) { - this.mServerInfoBlocking.setText(R.string.server_info_available); + this.binding.serverInfoBlocking.setText(R.string.server_info_available); } else { - this.mServerInfoBlocking.setText(R.string.server_info_unavailable); + this.binding.serverInfoBlocking.setText(R.string.server_info_unavailable); } if (features.sm()) { - this.mServerInfoSm.setText(R.string.server_info_available); + this.binding.serverInfoSm.setText(R.string.server_info_available); } else { - this.mServerInfoSm.setText(R.string.server_info_unavailable); + this.binding.serverInfoSm.setText(R.string.server_info_unavailable); } if (features.pep()) { AxolotlService axolotlService = this.mAccount.getAxolotlService(); if (axolotlService != null && axolotlService.isPepBroken()) { - this.mServerInfoPep.setText(R.string.server_info_broken); + this.binding.serverInfoPep.setText(R.string.server_info_broken); } else if (features.pepPublishOptions() || features.pepOmemoWhitelisted()) { - this.mServerInfoPep.setText(R.string.server_info_available); + this.binding.serverInfoPep.setText(R.string.server_info_available); } else { - this.mServerInfoPep.setText(R.string.server_info_partial); + this.binding.serverInfoPep.setText(R.string.server_info_partial); } } else { - this.mServerInfoPep.setText(R.string.server_info_unavailable); + this.binding.serverInfoPep.setText(R.string.server_info_unavailable); } if (features.httpUpload(0)) { - this.mServerInfoHttpUpload.setText(R.string.server_info_available); + this.binding.serverInfoHttpUpload.setText(R.string.server_info_available); } else { - this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable); + this.binding.serverInfoHttpUpload.setText(R.string.server_info_unavailable); } - this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().isStub() ? View.GONE : View.VISIBLE); + this.binding.pushRow.setVisibility(xmppConnectionService.getPushManagementService().isStub() ? View.GONE : View.VISIBLE); if (xmppConnectionService.getPushManagementService().available(mAccount)) { - this.mServerInfoPush.setText(R.string.server_info_available); + this.binding.serverInfoPush.setText(R.string.server_info_available); } else { - this.mServerInfoPush.setText(R.string.server_info_unavailable); + this.binding.serverInfoPush.setText(R.string.server_info_unavailable); } final long pgpKeyId = this.mAccount.getPgpId(); if (pgpKeyId != 0 && Config.supportOpenPgp()) { |