From b824e55277cf4a4a9042dc0fe30d0cc8939445dc Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Tue, 4 Nov 2014 17:10:35 +0100 Subject: register nfc callback in every activity that provides a proper sharable uri --- .../siacs/conversations/ui/ConferenceDetailsActivity.java | 2 +- .../eu/siacs/conversations/ui/ContactDetailsActivity.java | 2 +- .../eu/siacs/conversations/ui/ConversationActivity.java | 14 +------------- .../eu/siacs/conversations/ui/EditAccountActivity.java | 2 +- src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 16 deletions(-) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index 5606208c..cc9fca26 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -144,7 +144,7 @@ public class ConferenceDetailsActivity extends XmppActivity { if (conversation!=null) { return "xmpp:"+conversation.getContactJid().split("/")[0]+"?join"; } else { - return super.getShareableUri(); + return ""; } } diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index ea790667..7ac30e39 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -166,7 +166,7 @@ public class ContactDetailsActivity extends XmppActivity { if (contact!=null) { return "xmpp:"+contact.getJid(); } else { - return super.getShareableUri(); + return ""; } } diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 85b05e5b..6c3dff87 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -116,7 +116,7 @@ public class ConversationActivity extends XmppActivity implements if (conversation!=null) { return "xmpp:"+conversation.getAccount().getJid(); } else { - return super.getShareableUri(); + return ""; } } @@ -659,18 +659,6 @@ public class ConversationActivity extends XmppActivity implements } } - @Override - public void onResume() { - super.onResume(); - this.registerNdefPushMessageCallback(); - } - - @Override - public void onPause() { - super.onPause(); - this.unregisterNdefPushMessageCallback(); - } - @Override protected void onStop() { if (xmppConnectionServiceBound) { diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index aadf05b2..c5529613 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -287,7 +287,7 @@ public class EditAccountActivity extends XmppActivity { if (mAccount!=null) { return "xmpp:"+mAccount.getJid(); } else { - return super.getShareableUri(); + return ""; } } diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 4c17dd56..052385f6 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -588,6 +588,20 @@ public abstract class XmppActivity extends Activity { return null; } + @Override + public void onResume() { + super.onResume(); + if (this.getShareableUri()!=null) { + this.registerNdefPushMessageCallback(); + } + } + + @Override + public void onPause() { + super.onPause(); + this.unregisterNdefPushMessageCallback(); + } + protected void showQrCode() { String uri = getShareableUri(); if (uri!=null) { -- cgit v1.2.3