From 9b20223655c28cbe3fcd10617514648383d8ad31 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 8 Jan 2016 17:17:36 +0100 Subject: Fixes FS#107, Implements FS#77 Show the number of online resources in account view and enable show resources by clicking on the account jid --- Conversations-Plus-ChangeLog.md | 3 +++ .../conversationsplus/ui/EditAccountActivity.java | 12 +++++++++++- src/main/res/layout/activity_edit_account.xml | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Conversations-Plus-ChangeLog.md b/Conversations-Plus-ChangeLog.md index 8cb7db2f..5e7b7782 100644 --- a/Conversations-Plus-ChangeLog.md +++ b/Conversations-Plus-ChangeLog.md @@ -1,6 +1,9 @@ ###Conversations+ ChangeLog ####Version 0.0.6 +* Fixes FS#107: Account can be edited while online +* Implements FS#77: Open list of resources for own jid +* Fixes FS#99: Adjust namespace according to XEP-0363 * Fixes FS#95: NPE when opening message details for failed file transfer * Implements FS#89: Change about information * Implements FS#84: Setting for location to store received pictures diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java index efcd4128..822234c7 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java @@ -27,6 +27,7 @@ import de.thedevstack.conversationsplus.R; import de.thedevstack.conversationsplus.entities.Account; import de.thedevstack.conversationsplus.services.XmppConnectionService.OnAccountUpdate; import de.thedevstack.conversationsplus.ui.adapter.KnownHostsAdapter; +import de.thedevstack.conversationsplus.ui.listeners.ShowResourcesListDialogListener; import de.thedevstack.conversationsplus.utils.CryptoHelper; import de.thedevstack.conversationsplus.utils.UIHelper; import de.thedevstack.conversationsplus.xmpp.XmppConnection.Features; @@ -437,6 +438,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate this.mRegisterNew.setChecked(false); } if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) { + this.findViewById(R.id.editAccountBoxes).setVisibility(View.GONE); + this.findViewById(R.id.displayAccountFrame).setVisibility(View.VISIBLE); + TextView detailsAccountJid = (TextView)this.findViewById(R.id.detailsAccountJid); + if (this.mAccount.countPresences() > 0) { + detailsAccountJid.setText(this.mAccount.getJid().toBareJid().toString() + " (" + this.mAccount.countPresences() + ")"); + detailsAccountJid.setOnClickListener(new ShowResourcesListDialogListener(EditAccountActivity.this, this.mAccount.getRoster().getContact(this.mAccount.getJid().toBareJid()))); + } else { + detailsAccountJid.setText(this.mAccount.getJid().toBareJid().toString()); + } this.mStats.setVisibility(View.VISIBLE); this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection() .getLastSessionEstablished())); @@ -502,7 +512,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } } else { if (this.mAccount.errorStatus()) { - this.mAccountJid.setError(getString(this.mAccount.getStatus().getReadableId())); + this.mAccountJid.setError(getString(this.mAccount.getStatus().getReadableId())); if (init || !accountInfoEdited()) { this.mAccountJid.requestFocus(); } diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index 9c951afd..0c9809bc 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -37,7 +37,8 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:layout_toRightOf="@+id/avater"> + android:layout_toRightOf="@+id/avater" + android:id="@+id/editAccountBoxes"> + + +