From 2f07fccfce6bc961a17050b8fcb81912d3921c93 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 7 Mar 2022 12:43:55 +0100 Subject: [PATCH] show contact jid in call screen closes #4071 --- .../conversations/ui/RtpSessionActivity.java | 19 ++++++++++++++----- src/main/res/layout/activity_rtp_session.xml | 14 +++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index 6320ef5b7..323a2f67b 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -400,7 +400,7 @@ public class RtpSessionActivity extends XmppActivity } } else if (asList(ACTION_MAKE_VIDEO_CALL, ACTION_MAKE_VOICE_CALL).contains(action)) { proposeJingleRtpSession(account, with, actionToMedia(action)); - binding.with.setText(account.getRoster().getContact(with).getDisplayName()); + setWith(account.getRoster().getContact(with)); } else { throw new IllegalStateException("received onNewIntent without sessionId"); } @@ -424,7 +424,7 @@ public class RtpSessionActivity extends XmppActivity } } else if (asList(ACTION_MAKE_VIDEO_CALL, ACTION_MAKE_VOICE_CALL).contains(action)) { proposeJingleRtpSession(account, with, actionToMedia(action)); - binding.with.setText(account.getRoster().getContact(with).getDisplayName()); + setWith(account.getRoster().getContact(with)); } else if (Intent.ACTION_VIEW.equals(action)) { final String extraLastState = intent.getStringExtra(EXTRA_LAST_REPORTED_STATE); final RtpEndUserState state = @@ -437,7 +437,7 @@ public class RtpSessionActivity extends XmppActivity updateProfilePicture(state); invalidateOptionsMenu(); } - binding.with.setText(account.getRoster().getContact(with).getDisplayName()); + setWith(account.getRoster().getContact(with)); if (xmppConnectionService .getJingleConnectionManager() .fireJingleRtpConnectionStateUpdates()) { @@ -454,6 +454,15 @@ public class RtpSessionActivity extends XmppActivity } } + private void setWidth() { + setWith(getWith()); + } + + private void setWith(final Contact contact) { + binding.with.setText(contact.getDisplayName()); + binding.withJid.setText(contact.getJid().asBareJid().toEscapedString()); + } + private void proposeJingleRtpSession( final Account account, final Jid with, final Set media) { checkMicrophoneAvailabilityAsync(); @@ -657,7 +666,7 @@ public class RtpSessionActivity extends XmppActivity requireRtpConnection().getState())) { putScreenInCallMode(); } - binding.with.setText(getWith().getDisplayName()); + setWidth(); updateVideoViews(currentState); updateStateDisplay(currentState, media); updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(currentState)); @@ -684,7 +693,7 @@ public class RtpSessionActivity extends XmppActivity updateCallDuration(); updateVerifiedShield(false); invalidateOptionsMenu(); - binding.with.setText(account.getRoster().getContact(with).getDisplayName()); + setWith(account.getRoster().getContact(with)); } private void reInitializeActivityWithRunningRtpSession( diff --git a/src/main/res/layout/activity_rtp_session.xml b/src/main/res/layout/activity_rtp_session.xml index 0bdca4776..73bfee30e 100644 --- a/src/main/res/layout/activity_rtp_session.xml +++ b/src/main/res/layout/activity_rtp_session.xml @@ -55,10 +55,22 @@ android:layout_marginLeft="16dp" android:layout_marginTop="0dp" android:layout_marginRight="16dp" - android:layout_marginBottom="32dp" + android:layout_marginBottom="8dp" android:textAppearance="@style/TextAppearance.Conversations.Display2" android:textColor="@color/white" tools:text="Juliet Capulet" /> + +