1
0
Fork 1

improve rtp session activity and show avatar always

This commit is contained in:
Arne 2023-10-30 00:25:19 +01:00
parent 84d51d078d
commit 1a509ae374
7 changed files with 31 additions and 32 deletions

View file

@ -963,30 +963,20 @@ public class RtpSessionActivity extends XmppActivity
}
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) {
binding.contactPhoto.setVisibility(View.VISIBLE);
if (contact == null) {
AvatarWorkerTask.loadAvatar(
getWith(), binding.contactPhoto, R.dimen.publish_avatar_size);
} else {
AvatarWorkerTask.loadAvatar(
contact, binding.contactPhoto, R.dimen.publish_avatar_size);
}
final Account account = contact == null ? getWith().getAccount() : contact.getAccount();
binding.detailsAccount.setVisibility(View.VISIBLE);
binding.detailsAccount.setText(
getString(
R.string.using_account,
account.getJid().asBareJid().toEscapedString()));
binding.contactPhoto.setVisibility(View.VISIBLE);
if (contact == null) {
AvatarWorkerTask.loadAvatar(
getWith(), binding.contactPhoto, R.dimen.publish_avatar_size);
} else {
binding.contactPhoto.setVisibility(View.GONE);
AvatarWorkerTask.loadAvatar(
contact, binding.contactPhoto, R.dimen.publish_avatar_size);
}
final Account account = contact == null ? getWith().getAccount() : contact.getAccount();
binding.detailsAccount.setVisibility(View.VISIBLE);
binding.detailsAccount.setText(
getString(
R.string.using_account,
account.getJid().asBareJid().toEscapedString()));
} else {
binding.detailsAccount.setVisibility(View.GONE);
binding.contactPhoto.setVisibility(View.GONE);
}
}
private Set<Media> getMedia() {

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>

View file

@ -40,11 +40,10 @@
android:layout_height="wrap_content"
android:visibility="visible">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
app:popupTheme="?popupOverlayStyle" />
<TextView
@ -54,7 +53,7 @@
android:layout_below="@id/status"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="@color/white"
android:textColor="?attr/text_Color_Main"
android:textSize="50sp"
tools:text="Juliet Capulet" />
<TextView
@ -66,7 +65,7 @@
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textAppearance="@style/TextAppearance.Conversations.Body1"
android:textColor="@color/white"
android:textColor="?attr/text_Color_Main"
tools:text="jcapulet@example.com" />
<View
@ -103,8 +102,8 @@
android:layout_width="@dimen/publish_avatar_size"
android:layout_height="@dimen/publish_avatar_size"
android:layout_centerInParent="true"
app:strokeColor="@color/custom_theme_accent"
app:riv_corner_radius="@dimen/incoming_call_radius" />
app:riv_corner_radius="@dimen/incoming_call_radius"
app:strokeColor="@color/custom_theme_accent" />
<TextView
android:id="@+id/details_account"
@ -113,7 +112,10 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_margin="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:gravity="bottom"
android:text="@string/using_account"
android:textAppearance="@style/TextAppearance.Conversations.Caption" />

View file

@ -10,7 +10,7 @@
app:showAsAction="always" />
<item
android:id="@+id/action_dialpad"
android:icon="@drawable/ic_dialpad_white_24dp"
android:icon="?attr/ic_dialpad_24dp"
android:title="@string/action_dialpad"
app:showAsAction="always" />
<item

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="show_avatar_incoming_call">false</bool>
<bool name="show_avatar_incoming_call">true</bool>
</resources>

View file

@ -55,7 +55,7 @@
<attr name="icon_gps_not_fixed" format="reference" />
<attr name="ic_make_audio_call" format="reference"/>
<attr name="ic_make_video_call" format="reference"/>
<attr name="ic_dialpad_24dp" format="reference"/>
<attr name="conversations_overview_background" format="reference|color" />

View file

@ -189,6 +189,7 @@
<item name="ic_attach_photo" type="reference">@drawable/ic_attach_photo</item>
<item name="ic_attach_video" type="reference">@drawable/ic_attach_video</item>
<item name="ic_attach_record" type="reference">@drawable/ic_attach_record</item>
<item name="ic_dialpad_24dp" type="reference">@drawable/ic_dialpad_black_24dp</item>
<item name="conversations_overview_background">@color/primary</item>
@ -314,6 +315,7 @@
<item name="ic_attach_location" type="reference">@drawable/ic_attach_location_white</item>
<item name="ic_attach_photo" type="reference">@drawable/ic_attach_photo_white</item>
<item name="ic_attach_record" type="reference">@drawable/ic_attach_record_white</item>
<item name="ic_dialpad_24dp" type="reference">@drawable/ic_dialpad_white_24dp</item>
<item name="conversations_overview_background">@color/primary_dark</item>