Commit bc1ec903 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

call: use participant info for conference layout

Change-Id: Iebbd60510d2b3812476a2456d6cef24995fff873
parent 08cb9706
/*
* Copyright (C) 2004-2021 Savoir-faire Linux Inc.
*
* Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package cx.ring.adapters; package cx.ring.adapters;
import android.content.Context; import android.content.Context;
...@@ -11,16 +30,18 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -11,16 +30,18 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List; import java.util.List;
import cx.ring.fragments.CallFragment;
import cx.ring.views.AvatarFactory; import cx.ring.views.AvatarFactory;
import cx.ring.databinding.ItemConferenceParticipantBinding; import cx.ring.databinding.ItemConferenceParticipantBinding;
import cx.ring.fragments.CallFragment;
import net.jami.model.Conference;
import net.jami.model.Contact; import net.jami.model.Contact;
import net.jami.model.Call; import net.jami.model.Call;
import cx.ring.views.ParticipantView; import cx.ring.views.ParticipantView;
public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView> { public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView> {
protected final ConfParticipantAdapter.ConfParticipantSelected onSelectedCallback; protected final ConfParticipantAdapter.ConfParticipantSelected onSelectedCallback;
private List<Call> calls = null; private List<Conference.ParticipantInfo> calls = null;
public ConfParticipantAdapter(@NonNull ConfParticipantSelected cb) { public ConfParticipantAdapter(@NonNull ConfParticipantSelected cb) {
onSelectedCallback = cb; onSelectedCallback = cb;
...@@ -34,22 +55,23 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView ...@@ -34,22 +55,23 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView
@Override @Override
public void onBindViewHolder(@NonNull ParticipantView holder, int position) { public void onBindViewHolder(@NonNull ParticipantView holder, int position) {
final Call call = calls.get(position); final Conference.ParticipantInfo info = calls.get(position);
final Contact contact = call.getContact(); final Contact contact = info.contact;
final Context context = holder.itemView.getContext(); final Context context = holder.itemView.getContext();
Call.CallStatus status = call.getCallStatus(); if (info.call != null && info.call.getCallStatus() != Call.CallStatus.CURRENT) {
if (status == Call.CallStatus.CURRENT) { holder.binding.displayName.setText(String.format("%s\n%s", contact.getDisplayName(), context.getText(CallFragment.callStateToHumanState(info.call.getCallStatus()))));
holder.binding.photo.setAlpha(.5f);
} else {
holder.binding.displayName.setText(contact.getDisplayName()); holder.binding.displayName.setText(contact.getDisplayName());
holder.binding.photo.setAlpha(1f); holder.binding.photo.setAlpha(1f);
} else {
holder.binding.displayName.setText(String.format("%s\n%s", contact.getDisplayName(), context.getText(CallFragment.callStateToHumanState(status))));
holder.binding.photo.setAlpha(.5f);
} }
if (holder.disposable != null) if (holder.disposable != null)
holder.disposable.dispose(); holder.disposable.dispose();
holder.disposable = AvatarFactory.getAvatar(context, contact) holder.disposable = AvatarFactory.getAvatar(context, contact)
.subscribe(holder.binding.photo::setImageDrawable); .subscribe(holder.binding.photo::setImageDrawable);
holder.itemView.setOnClickListener(view -> onSelectedCallback.onParticipantSelected(view, call)); holder.itemView.setOnClickListener(view -> onSelectedCallback.onParticipantSelected(view, info));
} }
@Override @Override
...@@ -57,8 +79,8 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView ...@@ -57,8 +79,8 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView
return calls == null ? 0 : calls.size(); return calls == null ? 0 : calls.size();
} }
public void updateFromCalls(@NonNull final List<Call> contacts) { public void updateFromCalls(@NonNull final List<Conference.ParticipantInfo> contacts) {
final List<Call> oldCalls = calls; final List<Conference.ParticipantInfo> oldCalls = calls;
calls = contacts; calls = contacts;
if (oldCalls != null) { if (oldCalls != null) {
DiffUtil.calculateDiff(new DiffUtil.Callback() { DiffUtil.calculateDiff(new DiffUtil.Callback() {
...@@ -88,6 +110,6 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView ...@@ -88,6 +110,6 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView
} }
public interface ConfParticipantSelected { public interface ConfParticipantSelected {
void onParticipantSelected(View view, Call contact); void onParticipantSelected(View view, Conference.ParticipantInfo contact);
} }
} }
...@@ -96,7 +96,6 @@ import net.jami.model.Uri; ...@@ -96,7 +96,6 @@ import net.jami.model.Uri;
import net.jami.services.DeviceRuntimeService; import net.jami.services.DeviceRuntimeService;
import net.jami.services.HardwareService; import net.jami.services.HardwareService;
import net.jami.services.NotificationService; import net.jami.services.NotificationService;
import net.jami.utils.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
...@@ -138,7 +137,6 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -138,7 +137,6 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
public static final String ACTION_GET_CALL = "GET_CALL"; public static final String ACTION_GET_CALL = "GET_CALL";
public static final String KEY_ACTION = "action"; public static final String KEY_ACTION = "action";
public static final String KEY_ACCOUNT_ID = "accountId";
public static final String KEY_CONF_ID = "confId"; public static final String KEY_CONF_ID = "confId";
public static final String KEY_AUDIO_ONLY = "AUDIO_ONLY"; public static final String KEY_AUDIO_ONLY = "AUDIO_ONLY";
...@@ -344,7 +342,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -344,7 +342,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
return binding.getRoot(); return binding.getRoot();
} }
private TextureView.SurfaceTextureListener listener = new TextureView.SurfaceTextureListener() { private final TextureView.SurfaceTextureListener listener = new TextureView.SurfaceTextureListener() {
@Override @Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
mPreviewSurfaceWidth = width; mPreviewSurfaceWidth = width;
...@@ -380,7 +378,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -380,7 +378,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
binding.pluginPreviewHandle.setAlpha(hiddenState); binding.pluginPreviewHandle.setAlpha(hiddenState);
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint({"ClickableViewAccessibility", "RtlHardcoded", "WakelockTimeout"})
@Override @Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
setHasOptionsMenu(true); setHasOptionsMenu(true);
...@@ -741,6 +739,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -741,6 +739,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
* *
* @param isAudioOnly true if it is an audio call * @param isAudioOnly true if it is an audio call
*/ */
@SuppressLint("WakelockTimeout")
@Override @Override
public void handleCallWakelock(boolean isAudioOnly) { public void handleCallWakelock(boolean isAudioOnly) {
if (isAudioOnly) { if (isAudioOnly) {
...@@ -841,15 +840,13 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -841,15 +840,13 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
@Override @Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
super.onOptionsItemSelected(item); super.onOptionsItemSelected(item);
switch (item.getItemId()) { int itemId = item.getItemId();
case android.R.id.home: if (itemId == android.R.id.home) {
presenter.chatClick(); presenter.chatClick();
break; } else if (itemId == R.id.menuitem_dialpad) {
case R.id.menuitem_dialpad: presenter.dialpadClick();
presenter.dialpadClick(); } else if (itemId == R.id.menuitem_video_plugins) {
break; displayVideoPluginsCarousel();
case R.id.menuitem_video_plugins:
displayVideoPluginsCarousel();
} }
return true; return true;
} }
...@@ -949,9 +946,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -949,9 +946,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
public void updateContactBubble(@NonNull final List<Call> contacts) { public void updateContactBubble(@NonNull final List<Call> contacts) {
Log.w(TAG, "updateContactBubble " + contacts.size()); Log.w(TAG, "updateContactBubble " + contacts.size());
mConferenceMode = contacts.size() > 1; String username = contacts.size() > 1 ? "Conference with " + contacts.size() + " people" : contacts.get(0).getContact().getDisplayName();
String username = mConferenceMode ? "Conference with " + contacts.size() + " people" : contacts.get(0).getContact().getRingUsername(); String displayName = contacts.size() > 1 ? null : contacts.get(0).getContact().getDisplayName();
String displayName = mConferenceMode ? null : contacts.get(0).getContact().getDisplayName();
boolean hasProfileName = displayName != null && !displayName.contentEquals(username); boolean hasProfileName = displayName != null && !displayName.contentEquals(username);
...@@ -987,15 +983,42 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -987,15 +983,42 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
.build(getActivity()) .build(getActivity())
); );
if (!mConferenceMode) { }
@Override
public void updateConfInfo(List<Conference.ParticipantInfo> participantInfo) {
Log.w(TAG, "updateConfInfo " + participantInfo);
mConferenceMode = participantInfo.size() > 1;
binding.participantLabelContainer.removeAllViews();
if (!participantInfo.isEmpty()) {
LayoutInflater inflater = LayoutInflater.from(binding.participantLabelContainer.getContext());
for (Conference.ParticipantInfo i : participantInfo) {
String displayName = i.contact.getDisplayName();
if (!TextUtils.isEmpty(displayName)) {
ItemParticipantLabelBinding label = ItemParticipantLabelBinding.inflate(inflater);
PercentFrameLayout.LayoutParams params = new PercentFrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.getPercentLayoutInfo().leftMarginPercent = i.x / (float) mVideoWidth;
params.getPercentLayoutInfo().topMarginPercent = i.y / (float) mVideoHeight;
label.participantName.setText(displayName);
label.moderator.setVisibility(i.isModerator ? View.VISIBLE : View.GONE);
label.mute.setVisibility(i.audioMuted ? View.VISIBLE : View.GONE);
binding.participantLabelContainer.addView(label.getRoot(), params);
}
}
}
binding.participantLabelContainer.setVisibility(participantInfo.isEmpty() ? View.GONE : View.VISIBLE);
if (participantInfo.isEmpty() || participantInfo.size() < 2) {
binding.confControlGroup.setVisibility(View.GONE); binding.confControlGroup.setVisibility(View.GONE);
} else { } else {
binding.confControlGroup.setVisibility(View.VISIBLE); binding.confControlGroup.setVisibility(View.VISIBLE);
if (confAdapter == null) { if (confAdapter == null) {
confAdapter = new ConfParticipantAdapter((view, call) -> { confAdapter = new ConfParticipantAdapter((view, info) -> {
if (presenter == null) if (presenter == null)
return; return;
boolean maximized = presenter.isMaximized(call); boolean maximized = presenter.isMaximized(info);
PopupMenu popup = new PopupMenu(view.getContext(), view); PopupMenu popup = new PopupMenu(view.getContext(), view);
popup.inflate(R.menu.conference_participant_actions); popup.inflate(R.menu.conference_participant_actions);
MenuBuilder menu = (MenuBuilder) popup.getMenu(); MenuBuilder menu = (MenuBuilder) popup.getMenu();
...@@ -1008,7 +1031,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1008,7 +1031,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
maxItem.setTitle(R.string.action_call_maximize); maxItem.setTitle(R.string.action_call_maximize);
maxItem.setIcon(R.drawable.baseline_open_in_full_24); maxItem.setIcon(R.drawable.baseline_open_in_full_24);
} }
if (!call.isAudioMuted()) { if (!info.audioMuted) {
muteItem.setTitle(R.string.action_call_mute); muteItem.setTitle(R.string.action_call_mute);
muteItem.setIcon(R.drawable.baseline_mic_off_24); muteItem.setIcon(R.drawable.baseline_mic_off_24);
} else { } else {
...@@ -1018,27 +1041,18 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1018,27 +1041,18 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
if (presenter == null) if (presenter == null)
return false; return false;
switch (item.getItemId()) { int itemId = item.getItemId();
case R.id.conv_contact_details: if (itemId == R.id.conv_contact_details) {
presenter.openParticipantContact(call); presenter.openParticipantContact(info);
break; } else if (itemId == R.id.conv_contact_hangup) {
case R.id.conv_contact_hangup: presenter.hangupParticipant(info);
presenter.hangupParticipant(call); } else if (itemId == R.id.conv_mute) {
break; //call.muteAudio(!info.audioMuted);
case R.id.conv_mute: presenter.muteParticipant(info, !info.audioMuted);
if (!call.isAudioMuted()) { } else if (itemId == R.id.conv_contact_maximize) {
call.muteAudio(true); presenter.maximizeParticipant(info);
presenter.muteParticipant(call, true); } else {
} else { return false;
call.muteAudio(false);
presenter.muteParticipant(call, false);
}
break;
case R.id.conv_contact_maximize:
presenter.maximizeParticipant(call);
break;
default:
return false;
} }
return true; return true;
}); });
...@@ -1047,34 +1061,12 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1047,34 +1061,12 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
menuHelper.show(); menuHelper.show();
}); });
} }
confAdapter.updateFromCalls(contacts); confAdapter.updateFromCalls(participantInfo);
if (binding.confControlGroup.getAdapter() == null) if (binding.confControlGroup.getAdapter() == null)
binding.confControlGroup.setAdapter(confAdapter); binding.confControlGroup.setAdapter(confAdapter);
} }
} }
@Override
public void updateConfInfo(List<Conference.ParticipantInfo> info) {
binding.participantLabelContainer.removeAllViews();
if (!info.isEmpty()) {
LayoutInflater inflater = LayoutInflater.from(binding.participantLabelContainer.getContext());
for (Conference.ParticipantInfo i : info) {
String displayName = i.contact.getDisplayName();
if (!TextUtils.isEmpty(displayName)) {
ItemParticipantLabelBinding label = ItemParticipantLabelBinding.inflate(inflater);
PercentFrameLayout.LayoutParams params = new PercentFrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.getPercentLayoutInfo().leftMarginPercent = i.x / (float) mVideoWidth;
params.getPercentLayoutInfo().topMarginPercent = i.y / (float) mVideoHeight;
label.participantName.setText(displayName);
label.moderator.setVisibility(i.isModerator ? View.VISIBLE : View.GONE);
label.mute.setVisibility(i.audioMuted ? View.VISIBLE : View.GONE);
binding.participantLabelContainer.addView(label.getRoot(), params);
}
}
}
binding.participantLabelContainer.setVisibility(info.isEmpty() ? View.GONE : View.VISIBLE);
}
@Override @Override
public void updateParticipantRecording(Set<Contact> contacts) { public void updateParticipantRecording(Set<Contact> contacts) {
if (contacts.size() == 0) { if (contacts.size() == 0) {
...@@ -1131,7 +1123,9 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1131,7 +1123,9 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
requireActivity().invalidateOptionsMenu(); requireActivity().invalidateOptionsMenu();
CallActivity callActivity = (CallActivity) getActivity(); CallActivity callActivity = (CallActivity) getActivity();
callActivity.showSystemUI(); if (callActivity != null) {
callActivity.showSystemUI();
}
} }
@Override @Override
...@@ -1471,6 +1465,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1471,6 +1465,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
/** /**
* Function that is called to show/hide the plugins recycler viewer and update UI * Function that is called to show/hide the plugins recycler viewer and update UI
*/ */
@SuppressLint("UseCompatLoadingForDrawables")
public void displayVideoPluginsCarousel() { public void displayVideoPluginsCarousel() {
choosePluginMode = !choosePluginMode; choosePluginMode = !choosePluginMode;
...@@ -1488,7 +1483,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1488,7 +1483,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
for (String callMediaHandler : callMediaHandlers) { for (String callMediaHandler : callMediaHandlers) {
Map<String, String> details = getCallMediaHandlerDetails(callMediaHandler); Map<String, String> details = getCallMediaHandlerDetails(callMediaHandler);
String drawablePath = details.get("iconPath"); String drawablePath = details.get("iconPath");
if (drawablePath.endsWith("svg")) if (drawablePath != null && drawablePath.endsWith("svg"))
drawablePath = drawablePath.replace(".svg", ".png"); drawablePath = drawablePath.replace(".svg", ".png");
Drawable handlerIcon = Drawable.createFromPath(drawablePath); Drawable handlerIcon = Drawable.createFromPath(drawablePath);
if (handlerIcon == null) { if (handlerIcon == null) {
...@@ -1513,17 +1508,15 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1513,17 +1508,15 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
if(callMediaHandlers.size() > 0) { if(callMediaHandlers.size() > 0) {
// If no previous plugin was active, take the first, else previous // If no previous plugin was active, take the first, else previous
int position; int position;
if(previousPluginPosition < 1) { if (previousPluginPosition < 1) {
rp.scrollToPosition(1); rp.scrollToPosition(1);
position = 1; position = 1;
previousPluginPosition = 1; previousPluginPosition = 1;
} else { } else {
position = previousPluginPosition; position = previousPluginPosition;
} }
if (position > 0) { String callMediaId = callMediaHandlers.get(position-1);
String callMediaId = callMediaHandlers.get(position-1); presenter.startPlugin(callMediaId);
presenter.startPlugin(callMediaId);
}
} }
} else { } else {
...@@ -1546,12 +1539,11 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1546,12 +1539,11 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
/** /**
* Called whenever a plugin drawable in the recycler picker is clicked or scrolled to * Called whenever a plugin drawable in the recycler picker is clicked or scrolled to
* @param position
*/ */
@Override @Override
public void onItemSelected(int position) { public void onItemSelected(int position) {
Log.i(TAG, "selected position: " + position); Log.i(TAG, "selected position: " + position);
/** If there was a different plugin before, unload it /* If there was a different plugin before, unload it
* If previousPluginPosition = -1 or 0, there was no plugin * If previousPluginPosition = -1 or 0, there was no plugin
*/ */
if (previousPluginPosition > 0) { if (previousPluginPosition > 0) {
...@@ -1569,13 +1561,12 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1569,13 +1561,12 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
/** /**
* Called whenever a plugin drawable in the recycler picker is clicked * Called whenever a plugin drawable in the recycler picker is clicked
* @param position
*/ */
@Override @Override
public void onItemClicked(int position) { public void onItemClicked(int position) {
Log.i(TAG, "selected position: " + position); Log.i(TAG, "selected position: " + position);
if (position == 0) { if (position == 0) {
/** If there was a different plugin before, unload it /* If there was a different plugin before, unload it
* If previousPluginPosition = -1 or 0, there was no plugin * If previousPluginPosition = -1 or 0, there was no plugin
*/ */
if (previousPluginPosition > 0) { if (previousPluginPosition > 0) {
...@@ -1585,7 +1576,9 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -1585,7 +1576,9 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
} }
CallActivity callActivity = (CallActivity) getActivity(); CallActivity callActivity = (CallActivity) getActivity();
callActivity.showSystemUI(); if (callActivity != null) {
callActivity.showSystemUI();
}
toggleVideoPluginsCarousel(false); toggleVideoPluginsCarousel(false);
displayVideoPluginsCarousel(); displayVideoPluginsCarousel();
......
...@@ -436,7 +436,7 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement ...@@ -436,7 +436,7 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement
.build(getActivity()) .build(getActivity())
); );
if (!mConferenceMode) { /*if (!mConferenceMode) {
binding.confControlGroup.setVisibility(View.GONE); binding.confControlGroup.setVisibility(View.GONE);
} else { } else {
binding.confControlGroup.setVisibility(View.VISIBLE); binding.confControlGroup.setVisibility(View.VISIBLE);
...@@ -464,7 +464,7 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement ...@@ -464,7 +464,7 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement
confAdapter.updateFromCalls(calls); confAdapter.updateFromCalls(calls);
if (binding.confControlGroup.getAdapter() == null) if (binding.confControlGroup.getAdapter() == null)
binding.confControlGroup.setAdapter(confAdapter); binding.confControlGroup.setAdapter(confAdapter);
} }*/
} }
@Override @Override
...@@ -686,6 +686,36 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement ...@@ -686,6 +686,36 @@ public class TVCallFragment extends BaseSupportFragment<CallPresenter> implement
} }
} }
binding.participantLabelContainer.setVisibility(info.isEmpty() ? View.GONE : View.VISIBLE); binding.participantLabelContainer.setVisibility(info.isEmpty() ? View.GONE : View.VISIBLE);
if (!mConferenceMode) {
binding.confControlGroup.setVisibility(View.GONE);
} else {
binding.confControlGroup.setVisibility(View.VISIBLE);
if (confAdapter == null) {
confAdapter = new ConfParticipantAdapter((view, call) -> {
Context context = requireContext();
PopupMenu popup = new PopupMenu(context, view);
popup.inflate(R.menu.conference_participant_actions);
popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId();
if (itemId == R.id.conv_contact_details) {
presenter.openParticipantContact(call);
} else if (itemId == R.id.conv_contact_hangup) {
presenter.hangupParticipant(call);
} else {
return false;
}