Don't show members button if there are no remote people.

This commit is contained in:
Alex Hart
2020-11-24 11:49:40 -04:00
parent 0bda1d46a2
commit d4748efd42
3 changed files with 11 additions and 10 deletions

View File

@@ -217,6 +217,13 @@ public class WebRtcCallView extends FrameLayout {
int statusBarHeight = ViewUtil.getStatusBarHeight(this);
statusBarGuideline.setGuidelineBegin(statusBarHeight);
toolbar.inflateMenu(R.menu.group_call);
View showParticipants = toolbar.getMenu().findItem(R.id.menu_group_call_participants_list).getActionView();
showParticipants.setOnClickListener(unused -> showParticipantsList());
participantCount = showParticipants.findViewById(R.id.show_participants_menu_counter);
}
@Override
@@ -357,14 +364,6 @@ public class WebRtcCallView extends FrameLayout {
if (recipient.isGroup()) {
recipientName.setText(getContext().getString(R.string.WebRtcCallView__s_group_call, recipient.getDisplayName(getContext())));
if (toolbar.getMenu().findItem(R.id.menu_group_call_participants_list) == null) {
toolbar.inflateMenu(R.menu.group_call);
View showParticipants = toolbar.getMenu().findItem(R.id.menu_group_call_participants_list).getActionView();
showParticipants.setOnClickListener(unused -> showParticipantsList());
participantCount = showParticipants.findViewById(R.id.show_participants_menu_counter);
}
} else {
recipientName.setText(recipient.getDisplayName(getContext()));
}

View File

@@ -57,7 +57,7 @@ public final class WebRtcControls {
}
boolean displayGroupMembersButton() {
return groupCallState.isAtLeast(GroupCallState.CONNECTING);
return groupCallState.isAtLeast(GroupCallState.CONNECTING) && hasAtLeastOneRemote;
}
boolean displayEndCall() {

View File

@@ -6,8 +6,10 @@
<item
android:id="@+id/menu_group_call_participants_list"
android:title="@string/WebRtcCallView__view_participants_list"
android:visible="false"
app:actionLayout="@layout/show_participants_menu_view"
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
tools:ignore="AlwaysShowAction"
tools:visible="true" />
</menu>