Fix toolbar state management and pip.

This commit is contained in:
Alex Hart
2023-04-06 10:42:02 -03:00
parent cd5c253a78
commit 73a7063867
2 changed files with 17 additions and 10 deletions

View File

@@ -185,9 +185,9 @@ public class WebRtcCallView extends ConstraintLayout {
footerGradient = findViewById(R.id.call_screen_footer_gradient); footerGradient = findViewById(R.id.call_screen_footer_gradient);
startCallControls = findViewById(R.id.call_screen_start_call_controls); startCallControls = findViewById(R.id.call_screen_start_call_controls);
callParticipantsPager = findViewById(R.id.call_screen_participants_pager); callParticipantsPager = findViewById(R.id.call_screen_participants_pager);
callParticipantsRecycler = findViewById(R.id.call_screen_participants_recycler); callParticipantsRecycler = findViewById(R.id.call_screen_participants_recycler);
largeHeader = findViewById(R.id.call_screen_header); largeHeader = findViewById(R.id.call_screen_header);
startCall = findViewById(R.id.call_screen_start_call_start_call); startCall = findViewById(R.id.call_screen_start_call_start_call);
errorButton = findViewById(R.id.call_screen_error_cancel); errorButton = findViewById(R.id.call_screen_error_cancel);
groupCallSpeakerHint = new Stub<>(findViewById(R.id.call_screen_group_call_speaker_hint)); groupCallSpeakerHint = new Stub<>(findViewById(R.id.call_screen_group_call_speaker_hint));
groupCallFullStub = new Stub<>(findViewById(R.id.group_call_call_full_view)); groupCallFullStub = new Stub<>(findViewById(R.id.group_call_call_full_view));
@@ -224,6 +224,8 @@ public class WebRtcCallView extends ConstraintLayout {
} }
}); });
topViews.add(collapsedToolbar);
topViews.add(headerToolbar);
topViews.add(largeHeader); topViews.add(largeHeader);
topViews.add(topGradient); topViews.add(topGradient);
@@ -997,13 +999,19 @@ public class WebRtcCallView extends ConstraintLayout {
constraintSet.applyTo(parent); constraintSet.applyTo(parent);
if (showSmallHeader) { if (showSmallHeader) {
collapsedToolbar.setVisibility(View.VISIBLE); collapsedToolbar.setEnabled(true);
headerToolbar.setVisibility(View.GONE); collapsedToolbar.setAlpha(1);
largeHeader.setVisibility(View.GONE); headerToolbar.setEnabled(false);
headerToolbar.setAlpha(0);
largeHeader.setEnabled(false);
largeHeader.setAlpha(0);
} else { } else {
collapsedToolbar.setVisibility(View.GONE); collapsedToolbar.setEnabled(false);
headerToolbar.setVisibility(View.VISIBLE); collapsedToolbar.setAlpha(0);
largeHeader.setVisibility(View.VISIBLE); headerToolbar.setEnabled(true);
headerToolbar.setAlpha(1);
largeHeader.setEnabled(true);
largeHeader.setAlpha(1);
} }
} }

View File

@@ -214,7 +214,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/signal_m3_toolbar_height" android:layout_height="@dimen/signal_m3_toolbar_height"
android:minHeight="@dimen/signal_m3_toolbar_height" android:minHeight="@dimen/signal_m3_toolbar_height"
android:visibility="gone"
app:layout_constraintTop_toTopOf="@id/call_screen_status_bar_guideline" app:layout_constraintTop_toTopOf="@id/call_screen_status_bar_guideline"
app:menu="@menu/webrtc_toolbar_menu" app:menu="@menu/webrtc_toolbar_menu"
app:navigationIcon="@drawable/ic_arrow_left_24" app:navigationIcon="@drawable/ic_arrow_left_24"