From 7af5c96c1497d8429bca2e6a2307a34c15750aa4 Mon Sep 17 00:00:00 2001 From: 12aw Date: Fri, 11 Mar 2022 08:26:30 +0100 Subject: [PATCH] =?UTF-8?q?show=20'using=20account=20=E2=80=A6'=20in=20inc?= =?UTF-8?q?oming=20call=20screen=20=20(Daniel=20Gultsch)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../conversations/ui/RtpSessionActivity.java | 23 ++++++++++++------- src/main/res/layout/activity_rtp_session.xml | 11 +++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index 4a3c663da..d4692a8ac 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -404,7 +404,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe updateButtonConfiguration(state); updateVerifiedShield(false); updateStateDisplay(state); - updateProfilePicture(state); + updateIncomingCallScreen(state); invalidateOptionsMenu(); } setWith(account.getRoster().getContact(with)); @@ -613,7 +613,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe updateStateDisplay(currentState, media); updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(currentState)); updateButtonConfiguration(currentState, media); - updateProfilePicture(currentState); + updateIncomingCallScreen(currentState); invalidateOptionsMenu(); return false; } @@ -628,7 +628,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe resetIntent(account, with, terminatedRtpSession.state, terminatedRtpSession.media); updateButtonConfiguration(state); updateStateDisplay(state); - updateProfilePicture(state); + updateIncomingCallScreen(state); updateCallDuration(); updateVerifiedShield(false); invalidateOptionsMenu(); @@ -726,11 +726,11 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe this.binding.verified.setVisibility(verified ? View.VISIBLE : View.GONE); } - private void updateProfilePicture(final RtpEndUserState state) { - updateProfilePicture(state, null); + private void updateIncomingCallScreen(final RtpEndUserState state) { + updateIncomingCallScreen(state, null); } - private void updateProfilePicture(final RtpEndUserState state, final Contact contact) { + private void updateIncomingCallScreen(final RtpEndUserState state, final Contact contact) { if (state == RtpEndUserState.INCOMING_CALL || state == RtpEndUserState.ACCEPTING_CALL) { final boolean show = getResources().getBoolean(R.bool.show_avatar_incoming_call); if (show) { @@ -743,7 +743,14 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe } else { binding.contactPhoto.setVisibility(View.GONE); } + final Account account = contact == null ? getWith().getAccount() : contact.getAccount(); + binding.usingAccount.setVisibility(View.VISIBLE); + binding.usingAccount.setText( + getString( + R.string.using_account, + account.getJid().asBareJid().toEscapedString())); } else { + binding.usingAccount.setVisibility(View.GONE); binding.contactPhoto.setVisibility(View.GONE); } } @@ -1155,7 +1162,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(state)); updateButtonConfiguration(state, media); updateVideoViews(state); - updateProfilePicture(state, contact); + updateIncomingCallScreen(state); invalidateOptionsMenu(); }); if (END_CARD.contains(state)) { @@ -1205,7 +1212,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe updateVerifiedShield(false); updateStateDisplay(state); updateButtonConfiguration(state); - updateProfilePicture(state); + updateIncomingCallScreen(state); invalidateOptionsMenu(); }); resetIntent(account, with, state, actionToMedia(currentIntent.getAction())); diff --git a/src/main/res/layout/activity_rtp_session.xml b/src/main/res/layout/activity_rtp_session.xml index c45dff598..e8a3a70c3 100644 --- a/src/main/res/layout/activity_rtp_session.xml +++ b/src/main/res/layout/activity_rtp_session.xml @@ -269,5 +269,16 @@ app:tint="?attr/icon_tint" /> + + +