mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-02 15:36:32 +00:00
Fix overlap of join banner and camera toggle.
This commit is contained in:
committed by
Cody Henthorne
parent
7735ca9dab
commit
baa6032770
@@ -83,7 +83,7 @@ class PendingParticipantsBottomSheet : ComposeBottomSheetDialogFragment() {
|
||||
}
|
||||
|
||||
val participants = viewModel.pendingParticipants
|
||||
.map { it.getAllPendingParticipants(launchTime).toList() }
|
||||
.map { it.pendingParticipantCollection.getAllPendingParticipants(launchTime).toList() }
|
||||
.subscribeAsState(initial = emptyList())
|
||||
|
||||
PendingParticipantsSheet(
|
||||
|
||||
@@ -60,7 +60,7 @@ import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.ringrtc.CameraState;
|
||||
import org.thoughtcrime.securesms.service.webrtc.PendingParticipantCollection;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.PendingParticipantsState;
|
||||
import org.thoughtcrime.securesms.stories.viewer.reply.reaction.MultiReactionBurstLayout;
|
||||
import org.thoughtcrime.securesms.util.BlurTransformation;
|
||||
import org.thoughtcrime.securesms.util.ThrottledDebouncer;
|
||||
@@ -446,15 +446,20 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
|
||||
pendingParticipantsViewListener = listener;
|
||||
}
|
||||
|
||||
public void updatePendingParticipantsList(@NonNull PendingParticipantCollection pendingParticipantCollection) {
|
||||
if (pendingParticipantCollection.getUnresolvedPendingParticipants().isEmpty()) {
|
||||
public void updatePendingParticipantsList(@NonNull PendingParticipantsState state) {
|
||||
if (state.isInPipMode()) {
|
||||
pendingParticipantsViewStub.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.getPendingParticipantCollection().getUnresolvedPendingParticipants().isEmpty()) {
|
||||
if (pendingParticipantsViewStub.resolved()) {
|
||||
pendingParticipantsViewStub.get().setListener(pendingParticipantsViewListener);
|
||||
pendingParticipantsViewStub.get().applyState(pendingParticipantCollection);
|
||||
pendingParticipantsViewStub.get().applyState(state.getPendingParticipantCollection());
|
||||
}
|
||||
} else {
|
||||
pendingParticipantsViewStub.get().setListener(pendingParticipantsViewListener);
|
||||
pendingParticipantsViewStub.get().applyState(pendingParticipantCollection);
|
||||
pendingParticipantsViewStub.get().applyState(state.getPendingParticipantCollection());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,10 +530,8 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
|
||||
updateLocalCallParticipant(state.getLocalRenderState(), state.getLocalParticipant(), displaySmallSelfPipInLandscape);
|
||||
|
||||
if (state.isLargeVideoGroup()) {
|
||||
moveSnackbarAboveParticipantRail(true);
|
||||
adjustLayoutForLargeCount();
|
||||
} else {
|
||||
moveSnackbarAboveParticipantRail(state.isViewingFocusedParticipant());
|
||||
adjustLayoutForSmallCount();
|
||||
}
|
||||
}
|
||||
@@ -647,14 +650,6 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
|
||||
setStatus(getContext().getString(statusRes));
|
||||
}
|
||||
|
||||
private @NonNull View getPipBarrier() {
|
||||
if (collapsedToolbar.isEnabled()) {
|
||||
return collapsedToolbar;
|
||||
} else {
|
||||
return largeHeader;
|
||||
}
|
||||
}
|
||||
|
||||
public void setStatusFromHangupType(@NonNull HangupMessage.Type hangupType) {
|
||||
switch (hangupType) {
|
||||
case NORMAL:
|
||||
@@ -904,28 +899,6 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
|
||||
constraintSet.applyTo(this);
|
||||
}
|
||||
|
||||
private void moveSnackbarAboveParticipantRail(boolean aboveRail) {
|
||||
if (aboveRail) {
|
||||
updatePendingParticipantsBottomConstraint(callParticipantsRecycler);
|
||||
} else {
|
||||
updatePendingParticipantsBottomConstraint(aboveControlsGuideline);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePendingParticipantsBottomConstraint(View anchor) {
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
constraintSet.setForceId(false);
|
||||
constraintSet.clone(this);
|
||||
|
||||
constraintSet.connect(R.id.call_screen_pending_recipients,
|
||||
ConstraintSet.BOTTOM,
|
||||
anchor.getId(),
|
||||
ConstraintSet.TOP,
|
||||
ViewUtil.dpToPx(8));
|
||||
|
||||
constraintSet.applyTo(this);
|
||||
}
|
||||
|
||||
private void fadeInNewUiState(boolean showSmallHeader) {
|
||||
for (View view : SetUtil.difference(allTimeVisibleViews, visibleViewSet)) {
|
||||
view.setVisibility(GONE);
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.thoughtcrime.securesms.recipients.LiveRecipient;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.service.webrtc.PendingParticipantCollection;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.PendingParticipantsState;
|
||||
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcEphemeralState;
|
||||
import org.thoughtcrime.securesms.util.NetworkUtil;
|
||||
import org.thoughtcrime.securesms.util.SingleLiveEvent;
|
||||
@@ -220,8 +221,12 @@ public class WebRtcCallViewModel extends ViewModel {
|
||||
return callStarting;
|
||||
}
|
||||
|
||||
public @NonNull Observable<PendingParticipantCollection> getPendingParticipants() {
|
||||
return pendingParticipants.observeOn(AndroidSchedulers.mainThread());
|
||||
public @NonNull Observable<PendingParticipantsState> getPendingParticipants() {
|
||||
Observable<Boolean> isInPipMode = participantsState
|
||||
.map(CallParticipantsState::isInPipMode)
|
||||
.distinctUntilChanged();
|
||||
|
||||
return Observable.combineLatest(pendingParticipants, isInPipMode, PendingParticipantsState::new);
|
||||
}
|
||||
|
||||
public @NonNull PendingParticipantCollection getPendingParticipantsSnapshot() {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright 2024 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.thoughtcrime.securesms.service.webrtc.state
|
||||
|
||||
import org.thoughtcrime.securesms.service.webrtc.PendingParticipantCollection
|
||||
|
||||
/**
|
||||
* Represents the current state of the pending participants card.
|
||||
*/
|
||||
data class PendingParticipantsState(
|
||||
val pendingParticipantCollection: PendingParticipantCollection,
|
||||
val isInPipMode: Boolean
|
||||
)
|
||||
Reference in New Issue
Block a user