mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 17:37:57 +00:00
Fix various UI issues with group calling PIPs.
This commit is contained in:
@@ -16,6 +16,7 @@ import org.thoughtcrime.securesms.R;
|
|||||||
import org.thoughtcrime.securesms.components.AvatarImageView;
|
import org.thoughtcrime.securesms.components.AvatarImageView;
|
||||||
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
|
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
|
||||||
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto;
|
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto;
|
||||||
|
import org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto;
|
||||||
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
|
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
|
||||||
import org.thoughtcrime.securesms.events.CallParticipant;
|
import org.thoughtcrime.securesms.events.CallParticipant;
|
||||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||||
@@ -130,7 +131,8 @@ public class CallParticipantView extends ConstraintLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setPipAvatar(@NonNull Recipient recipient) {
|
private void setPipAvatar(@NonNull Recipient recipient) {
|
||||||
ContactPhoto contactPhoto = recipient.getContactPhoto();
|
ContactPhoto contactPhoto = recipient.isSelf() ? new ProfileContactPhoto(Recipient.self(), Recipient.self().getProfileAvatar())
|
||||||
|
: recipient.getContactPhoto();
|
||||||
FallbackContactPhoto fallbackPhoto = recipient.getFallbackContactPhoto(FALLBACK_PHOTO_PROVIDER);
|
FallbackContactPhoto fallbackPhoto = recipient.getFallbackContactPhoto(FALLBACK_PHOTO_PROVIDER);
|
||||||
|
|
||||||
GlideApp.with(this)
|
GlideApp.with(this)
|
||||||
|
@@ -240,7 +240,7 @@ public final class CallParticipantsState {
|
|||||||
int numberOfRemoteParticipants,
|
int numberOfRemoteParticipants,
|
||||||
boolean isViewingFocusedParticipant)
|
boolean isViewingFocusedParticipant)
|
||||||
{
|
{
|
||||||
boolean displayLocal = isNonIdleGroupCall || (!isInPip && localParticipant.isVideoEnabled());
|
boolean displayLocal = (numberOfRemoteParticipants == 0 || !isInPip) && (isNonIdleGroupCall || localParticipant.isVideoEnabled());
|
||||||
WebRtcLocalRenderState localRenderState = WebRtcLocalRenderState.GONE;
|
WebRtcLocalRenderState localRenderState = WebRtcLocalRenderState.GONE;
|
||||||
|
|
||||||
if (displayLocal || showVideoForOutgoing) {
|
if (displayLocal || showVideoForOutgoing) {
|
||||||
@@ -250,10 +250,10 @@ public final class CallParticipantsState {
|
|||||||
} else if (numberOfRemoteParticipants == 1) {
|
} else if (numberOfRemoteParticipants == 1) {
|
||||||
localRenderState = WebRtcLocalRenderState.SMALL_RECTANGLE;
|
localRenderState = WebRtcLocalRenderState.SMALL_RECTANGLE;
|
||||||
} else {
|
} else {
|
||||||
localRenderState = WebRtcLocalRenderState.LARGE;
|
localRenderState = localParticipant.isVideoEnabled() ? WebRtcLocalRenderState.LARGE : WebRtcLocalRenderState.LARGE_NO_VIDEO;
|
||||||
}
|
}
|
||||||
} else if (callState != WebRtcViewModel.State.CALL_INCOMING && callState != WebRtcViewModel.State.CALL_DISCONNECTED) {
|
} else if (callState != WebRtcViewModel.State.CALL_INCOMING && callState != WebRtcViewModel.State.CALL_DISCONNECTED) {
|
||||||
localRenderState = WebRtcLocalRenderState.LARGE;
|
localRenderState = localParticipant.isVideoEnabled() ? WebRtcLocalRenderState.LARGE : WebRtcLocalRenderState.LARGE_NO_VIDEO;
|
||||||
}
|
}
|
||||||
} else if (callState == WebRtcViewModel.State.CALL_PRE_JOIN) {
|
} else if (callState == WebRtcViewModel.State.CALL_PRE_JOIN) {
|
||||||
localRenderState = WebRtcLocalRenderState.LARGE_NO_VIDEO;
|
localRenderState = WebRtcLocalRenderState.LARGE_NO_VIDEO;
|
||||||
|
@@ -272,7 +272,7 @@ public class WebRtcCallView extends FrameLayout {
|
|||||||
recyclerAdapter.submitList(state.getListParticipants());
|
recyclerAdapter.submitList(state.getListParticipants());
|
||||||
updateLocalCallParticipant(state.getLocalRenderState(), state.getLocalParticipant());
|
updateLocalCallParticipant(state.getLocalRenderState(), state.getLocalParticipant());
|
||||||
|
|
||||||
if (state.isLargeVideoGroup()) {
|
if (state.isLargeVideoGroup() && !state.isInPipMode()) {
|
||||||
layoutParticipantsForLargeCount();
|
layoutParticipantsForLargeCount();
|
||||||
} else {
|
} else {
|
||||||
layoutParticipantsForSmallCount();
|
layoutParticipantsForSmallCount();
|
||||||
@@ -521,7 +521,7 @@ public class WebRtcCallView extends FrameLayout {
|
|||||||
pictureInPictureGestureHelper.lockToBottomEnd();
|
pictureInPictureGestureHelper.lockToBottomEnd();
|
||||||
|
|
||||||
pictureInPictureGestureHelper.performAfterFling(() -> {
|
pictureInPictureGestureHelper.performAfterFling(() -> {
|
||||||
ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, ViewUtil.dpToPx(40), ViewUtil.dpToPx(72));
|
ResizeAnimation animation = new ResizeAnimation(smallLocalRenderFrame, ViewUtil.dpToPx(54), ViewUtil.dpToPx(72));
|
||||||
animation.setDuration(PIP_RESIZE_DURATION);
|
animation.setDuration(PIP_RESIZE_DURATION);
|
||||||
animation.setAnimationListener(new SimpleAnimationListener() {
|
animation.setAnimationListener(new SimpleAnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Space xmlns:android="http://schemas.android.com/apk/res/android"
|
<Space xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="40dp"
|
android:layout_width="54dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
tools:background="@color/red"
|
tools:background="@color/red"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
Reference in New Issue
Block a user