Commit 1b7571c3 authored by Adrien Béraud's avatar Adrien Béraud

call: update participant label

Change-Id: Ifd10bb675525b9a87c07d9e000ee77ef201cb575
parent bdc2c97d
......@@ -31,6 +31,7 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import cx.ring.fragments.CallFragment;
import cx.ring.views.AvatarDrawable;
import cx.ring.views.AvatarFactory;
import cx.ring.databinding.ItemConferenceParticipantBinding;
......@@ -69,8 +70,15 @@ public class ConfParticipantAdapter extends RecyclerView.Adapter<ParticipantView
if (holder.disposable != null)
holder.disposable.dispose();
holder.binding.photo.setImageDrawable(new AvatarDrawable.Builder()
.withContact(contact)
.withCircleCrop(true)
.withPresence(false)
.build(context));
/*;
holder.disposable = AvatarFactory.getAvatar(context, contact)
.subscribe(holder.binding.photo::setImageDrawable);
.subscribe(holder.binding.photo::setImageDrawable);*/
holder.itemView.setOnClickListener(view -> onSelectedCallback.onParticipantSelected(view, info));
}
......
......@@ -985,6 +985,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
}
@SuppressLint("RestrictedApi")
@Override
public void updateConfInfo(List<Conference.ParticipantInfo> participantInfo) {
Log.w(TAG, "updateConfInfo " + participantInfo);
......@@ -1001,6 +1002,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
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;
params.getPercentLayoutInfo().rightMarginPercent = 1.f - (i.x + i.w) / (float) mVideoWidth;
//params.getPercentLayoutInfo().rightMarginPercent = (i.x + i.w) / (float) mVideoWidth;
label.participantName.setText(displayName);
label.moderator.setVisibility(i.isModerator ? View.VISIBLE : View.GONE);
label.mute.setVisibility(i.audioMuted ? View.VISIBLE : View.GONE);
......@@ -1021,23 +1024,6 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
boolean maximized = presenter.isMaximized(info);
PopupMenu popup = new PopupMenu(view.getContext(), view);
popup.inflate(R.menu.conference_participant_actions);
MenuBuilder menu = (MenuBuilder) popup.getMenu();
MenuItem maxItem = menu.findItem(R.id.conv_contact_maximize);
MenuItem muteItem = menu.findItem(R.id.conv_mute);
if (maximized) {
maxItem.setTitle(R.string.action_call_minimize);
maxItem.setIcon(R.drawable.baseline_close_fullscreen_24);
} else {
maxItem.setTitle(R.string.action_call_maximize);
maxItem.setIcon(R.drawable.baseline_open_in_full_24);
}
if (!info.audioMuted) {
muteItem.setTitle(R.string.action_call_mute);
muteItem.setIcon(R.drawable.baseline_mic_off_24);
} else {
muteItem.setTitle(R.string.action_call_unmute);
muteItem.setIcon(R.drawable.baseline_mic_24);
}
popup.setOnMenuItemClickListener(item -> {
if (presenter == null)
return false;
......@@ -1056,7 +1042,25 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
}
return true;
});
MenuBuilder menu = (MenuBuilder) popup.getMenu();
MenuItem maxItem = menu.findItem(R.id.conv_contact_maximize);
MenuItem muteItem = menu.findItem(R.id.conv_mute);
if (maximized) {
maxItem.setTitle(R.string.action_call_minimize);
maxItem.setIcon(R.drawable.baseline_close_fullscreen_24);
} else {
maxItem.setTitle(R.string.action_call_maximize);
maxItem.setIcon(R.drawable.baseline_open_in_full_24);
}
if (!info.audioMuted) {
muteItem.setTitle(R.string.action_call_mute);
muteItem.setIcon(R.drawable.baseline_mic_off_24);
} else {
muteItem.setTitle(R.string.action_call_unmute);
muteItem.setIcon(R.drawable.baseline_mic_24);
}
MenuPopupHelper menuHelper = new MenuPopupHelper(view.getContext(), menu, view);
menuHelper.setGravity(Gravity.END);
menuHelper.setForceShowIcon(true);
menuHelper.show();
});
......@@ -1223,7 +1227,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
} else if (Surface.ROTATION_180 == rotation) {
matrix.postRotate(180, centerX, centerY);
}
if(!choosePluginMode) {
if (!choosePluginMode) {
// binding.pluginPreviewSurface.setTransform(matrix);
// }
// else {
......
......@@ -58,7 +58,9 @@ along with this program; if not, write to the Free Software
android:contentDescription="@string/contact_picture_description"
android:tintMode="multiply"
android:enabled="false"
app:maxImageSize="56dp"
app:maxImageSize="64dp"
app:useCompatPadding="true"
tools:src="@drawable/ic_contact_picture_fallback" />
</LinearLayout>
......@@ -11,22 +11,24 @@
android:background="@drawable/background_conference_label"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="12dp">
android:padding="4dp">
<TextView
android:id="@+id/participant_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginEnd="4dp"
android:layout_marginStart="4dp"
android:ellipsize="marquee"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp"
tools:text="Georges Longname of Chateaubrillant" />
<ImageView
android:id="@+id/moderator"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_margin="4dp"
android:contentDescription="@string/call_moderator"
android:src="@drawable/baseline_moderateur"
......@@ -35,8 +37,8 @@
<ImageView
android:id="@+id/mute"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_margin="4dp"
android:contentDescription="@string/call_muted"
android:src="@drawable/baseline_mic_off_24"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment