jump right into edit account if now accounts are configured

This commit is contained in:
Daniel Gultsch 2014-08-23 21:31:27 +02:00
parent d504daec16
commit e0b759340d
3 changed files with 19 additions and 10 deletions

View File

@ -86,7 +86,7 @@
android:layout_marginTop="8dp"
android:orientation="vertical"
android:padding="16dp"
android:visibility="visible" >
android:visibility="gone" >
<TextView
android:layout_width="fill_parent"

View File

@ -628,8 +628,7 @@ public class ConversationActivity extends XmppActivity {
}
} else {
if (xmppConnectionService.getAccounts().size() == 0) {
startActivity(new Intent(this, ManageAccountActivity.class));
finish();
startActivity(new Intent(this, EditAccountActivity.class));
} else if (conversationList.size() <= 0) {
// add no history
startActivity(new Intent(this, StartConversationActivity.class));

View File

@ -116,7 +116,13 @@ public class EditAccountActivity extends XmppActivity {
@Override
public void run() {
if (jidToEdit == null && mAccount != null
if (mAccount != null
&& mAccount.getStatus() != Account.STATUS_ONLINE
&& mFetchingAvatar) {
startActivity(new Intent(getApplicationContext(),
ManageAccountActivity.class));
finish();
} else if (jidToEdit == null && mAccount != null
&& mAccount.getStatus() == Account.STATUS_ONLINE) {
if (!mFetchingAvatar) {
mFetchingAvatar = true;
@ -273,6 +279,7 @@ public class EditAccountActivity extends XmppActivity {
getActionBar().setDisplayHomeAsUpEnabled(false);
getActionBar().setDisplayShowHomeEnabled(false);
this.mCancelButton.setEnabled(false);
this.mCancelButton.setTextColor(getSecondaryTextColor());
}
this.mAccountJid.setAdapter(this.mKnownHostsAdapter);
updateSaveButton();
@ -289,7 +296,8 @@ public class EditAccountActivity extends XmppActivity {
this.mRegisterNew.setVisibility(View.GONE);
this.mRegisterNew.setChecked(false);
}
if (this.mAccount.getStatus() == Account.STATUS_ONLINE && !this.mFetchingAvatar) {
if (this.mAccount.getStatus() == Account.STATUS_ONLINE
&& !this.mFetchingAvatar) {
this.mStats.setVisibility(View.VISIBLE);
this.mSessionEst.setText(UIHelper.readableTimeDifference(
getApplicationContext(), this.mAccount.getXmppConnection()
@ -298,7 +306,8 @@ public class EditAccountActivity extends XmppActivity {
if (features.carbons()) {
this.mServerInfoCarbons.setText(R.string.server_info_available);
} else {
this.mServerInfoCarbons.setText(R.string.server_info_unavailable);
this.mServerInfoCarbons
.setText(R.string.server_info_unavailable);
}
if (features.sm()) {
this.mServerInfoSm.setText(R.string.server_info_available);
@ -310,7 +319,8 @@ public class EditAccountActivity extends XmppActivity {
} else {
this.mServerInfoPep.setText(R.string.server_info_unavailable);
}
String fingerprint = this.mAccount.getOtrFingerprint(getApplicationContext());
String fingerprint = this.mAccount
.getOtrFingerprint(getApplicationContext());
if (fingerprint != null) {
this.mOtrFingerprintHeadline.setVisibility(View.VISIBLE);
this.mOtrFingerprint.setVisibility(View.VISIBLE);