From ceceead5051834ae02c30ca61c480ed5c3792c88 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 7 Mar 2022 13:10:57 +0100 Subject: [PATCH] =?UTF-8?q?show=20'using=20account=20=E2=80=A6'=20in=20inc?= =?UTF-8?q?oming=20call=20screen?= 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 | 10 ++++++++ 2 files changed, 25 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 323a2f67b..842811edb 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -434,7 +434,7 @@ public class RtpSessionActivity extends XmppActivity updateButtonConfiguration(state); updateVerifiedShield(false); updateStateDisplay(state); - updateProfilePicture(state); + updateIncomingCallScreen(state); invalidateOptionsMenu(); } setWith(account.getRoster().getContact(with)); @@ -671,7 +671,7 @@ public class RtpSessionActivity extends XmppActivity updateStateDisplay(currentState, media); updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(currentState)); updateButtonConfiguration(currentState, media); - updateProfilePicture(currentState); + updateIncomingCallScreen(currentState); invalidateOptionsMenu(); return false; } @@ -689,7 +689,7 @@ public class RtpSessionActivity extends XmppActivity resetIntent(account, with, terminatedRtpSession.state, terminatedRtpSession.media); updateButtonConfiguration(state); updateStateDisplay(state); - updateProfilePicture(state); + updateIncomingCallScreen(state); updateCallDuration(); updateVerifiedShield(false); invalidateOptionsMenu(); @@ -790,11 +790,11 @@ public class RtpSessionActivity extends XmppActivity 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) { @@ -809,7 +809,14 @@ public class RtpSessionActivity extends XmppActivity } 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); } } @@ -1253,7 +1260,7 @@ public class RtpSessionActivity extends XmppActivity verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(state)); updateButtonConfiguration(state, media); updateVideoViews(state); - updateProfilePicture(state, contact); + updateIncomingCallScreen(state, contact); invalidateOptionsMenu(); }); if (END_CARD.contains(state)) { @@ -1314,7 +1321,7 @@ public class RtpSessionActivity extends XmppActivity 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 73bfee30e..4563d9a97 100644 --- a/src/main/res/layout/activity_rtp_session.xml +++ b/src/main/res/layout/activity_rtp_session.xml @@ -247,5 +247,15 @@ app:tint="?attr/icon_tint" /> + +