1
0
Fork 1

show 'using account …' in incoming call screen (Daniel Gultsch)

This commit is contained in:
12aw 2022-03-11 08:26:30 +01:00
parent ed6e0f1754
commit 7af5c96c14
2 changed files with 26 additions and 8 deletions

View file

@ -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()));

View file

@ -269,5 +269,16 @@
app:tint="?attr/icon_tint" />
</RelativeLayout>
<TextView
android:id="@+id/using_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_margin="8dp"
android:text="@string/using_account"
android:textAppearance="@style/TextAppearance.Conversations.Caption"/>
</RelativeLayout>
</layout>