|
@@ -3,8 +3,10 @@
|
|
*
|
|
*
|
|
* @author Mario Danic
|
|
* @author Mario Danic
|
|
* @author Marcel Hibbe
|
|
* @author Marcel Hibbe
|
|
- * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
|
|
|
- * Copyright (C) 2022 Marcel Hibbe (dev@mhibbe.de)
|
|
|
|
|
|
+ * @author Andy Scherzinger
|
|
|
|
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
|
|
|
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
|
|
|
|
+ * Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
|
*
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* 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
|
|
* it under the terms of the GNU General Public License as published by
|
|
@@ -23,35 +25,23 @@
|
|
package com.nextcloud.talk.adapters.items;
|
|
package com.nextcloud.talk.adapters.items;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.annotation.SuppressLint;
|
|
-import android.content.Context;
|
|
|
|
-import android.content.res.Resources;
|
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
-import android.widget.ImageView;
|
|
|
|
|
|
|
|
import com.facebook.drawee.backends.pipeline.Fresco;
|
|
import com.facebook.drawee.backends.pipeline.Fresco;
|
|
import com.facebook.drawee.interfaces.DraweeController;
|
|
import com.facebook.drawee.interfaces.DraweeController;
|
|
-import com.facebook.drawee.view.SimpleDraweeView;
|
|
|
|
import com.nextcloud.talk.R;
|
|
import com.nextcloud.talk.R;
|
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
|
|
|
+import com.nextcloud.talk.databinding.RvItemContactBinding;
|
|
import com.nextcloud.talk.models.database.UserEntity;
|
|
import com.nextcloud.talk.models.database.UserEntity;
|
|
-import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
|
|
|
|
import com.nextcloud.talk.models.json.participants.Participant;
|
|
import com.nextcloud.talk.models.json.participants.Participant;
|
|
-import com.nextcloud.talk.models.json.participants.Participant.InCallFlags;
|
|
|
|
-import com.nextcloud.talk.models.json.status.StatusType;
|
|
|
|
-import com.nextcloud.talk.ui.StatusDrawable;
|
|
|
|
import com.nextcloud.talk.utils.ApiUtils;
|
|
import com.nextcloud.talk.utils.ApiUtils;
|
|
import com.nextcloud.talk.utils.DisplayUtils;
|
|
import com.nextcloud.talk.utils.DisplayUtils;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
-import androidx.annotation.Nullable;
|
|
|
|
-import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import androidx.core.content.res.ResourcesCompat;
|
|
import androidx.core.content.res.ResourcesCompat;
|
|
-import androidx.emoji.widget.EmojiTextView;
|
|
|
|
-import butterknife.BindView;
|
|
|
|
-import butterknife.ButterKnife;
|
|
|
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
|
import eu.davidea.flexibleadapter.items.IFilterable;
|
|
import eu.davidea.flexibleadapter.items.IFilterable;
|
|
@@ -62,20 +52,18 @@ import eu.davidea.viewholders.FlexibleViewHolder;
|
|
public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder> implements
|
|
public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder> implements
|
|
ISectionable<UserItem.UserItemViewHolder, GenericTextHeaderItem>, IFilterable<String> {
|
|
ISectionable<UserItem.UserItemViewHolder, GenericTextHeaderItem>, IFilterable<String> {
|
|
|
|
|
|
- private static final float STATUS_SIZE_IN_DP = 9f;
|
|
|
|
- private static final String NO_ICON = "";
|
|
|
|
|
|
+ public static final String PARTICIPANT_SOURCE_CIRCLES = "circles";
|
|
|
|
+ public static final String PARTICIPANT_SOURCE_GROUPS = "groups";
|
|
|
|
+ public static final String PARTICIPANT_SOURCE_USERS = "users";
|
|
|
|
|
|
- private Context context;
|
|
|
|
- private Participant participant;
|
|
|
|
- private UserEntity userEntity;
|
|
|
|
|
|
+ private final Participant participant;
|
|
|
|
+ private final UserEntity userEntity;
|
|
private GenericTextHeaderItem header;
|
|
private GenericTextHeaderItem header;
|
|
public boolean isOnline = true;
|
|
public boolean isOnline = true;
|
|
|
|
|
|
- public UserItem(Context activityContext,
|
|
|
|
- Participant participant,
|
|
|
|
|
|
+ public UserItem(Participant participant,
|
|
UserEntity userEntity,
|
|
UserEntity userEntity,
|
|
GenericTextHeaderItem genericTextHeaderItem) {
|
|
GenericTextHeaderItem genericTextHeaderItem) {
|
|
- this.context = activityContext;
|
|
|
|
this.participant = participant;
|
|
this.participant = participant;
|
|
this.userEntity = userEntity;
|
|
this.userEntity = userEntity;
|
|
this.header = genericTextHeaderItem;
|
|
this.header = genericTextHeaderItem;
|
|
@@ -99,23 +87,14 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|
/**
|
|
/**
|
|
* @return the model object
|
|
* @return the model object
|
|
*/
|
|
*/
|
|
-
|
|
|
|
public Participant getModel() {
|
|
public Participant getModel() {
|
|
return participant;
|
|
return participant;
|
|
}
|
|
}
|
|
|
|
|
|
- public UserEntity getEntity() {
|
|
|
|
- return userEntity;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int getLayoutRes() {
|
|
public int getLayoutRes() {
|
|
- if (header != null) {
|
|
|
|
- return R.layout.rv_item_contact;
|
|
|
|
- } else {
|
|
|
|
- return R.layout.rv_item_conversation_info_participant;
|
|
|
|
- }
|
|
|
|
|
|
+ return R.layout.rv_item_contact;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -127,59 +106,72 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|
@Override
|
|
@Override
|
|
public void bindViewHolder(FlexibleAdapter adapter, UserItemViewHolder holder, int position, List payloads) {
|
|
public void bindViewHolder(FlexibleAdapter adapter, UserItemViewHolder holder, int position, List payloads) {
|
|
|
|
|
|
- if (holder.participantAvatar != null) {
|
|
|
|
- holder.participantAvatar.setController(null);
|
|
|
|
|
|
+ if (holder.binding.avatarDraweeView != null) {
|
|
|
|
+ holder.binding.avatarDraweeView.setController(null);
|
|
}
|
|
}
|
|
|
|
|
|
- if (holder.checkedImageView != null) {
|
|
|
|
|
|
+ if (holder.binding.checkedImageView != null) {
|
|
if (participant.isSelected()) {
|
|
if (participant.isSelected()) {
|
|
- holder.checkedImageView.setVisibility(View.VISIBLE);
|
|
|
|
|
|
+ holder.binding.checkedImageView.setVisibility(View.VISIBLE);
|
|
} else {
|
|
} else {
|
|
- holder.checkedImageView.setVisibility(View.GONE);
|
|
|
|
|
|
+ holder.binding.checkedImageView.setVisibility(View.GONE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- drawStatus(holder);
|
|
|
|
-
|
|
|
|
if (!isOnline) {
|
|
if (!isOnline) {
|
|
- holder.contactDisplayName.setTextColor(ResourcesCompat.getColor(
|
|
|
|
- holder.contactDisplayName.getContext().getResources(),
|
|
|
|
|
|
+ holder.binding.nameText.setTextColor(ResourcesCompat.getColor(
|
|
|
|
+ holder.binding.nameText.getContext().getResources(),
|
|
R.color.medium_emphasis_text,
|
|
R.color.medium_emphasis_text,
|
|
null)
|
|
null)
|
|
- );
|
|
|
|
- holder.participantAvatar.setAlpha(0.38f);
|
|
|
|
|
|
+ );
|
|
|
|
+ holder.binding.avatarDraweeView.setAlpha(0.38f);
|
|
} else {
|
|
} else {
|
|
- holder.contactDisplayName.setTextColor(ResourcesCompat.getColor(
|
|
|
|
- holder.contactDisplayName.getContext().getResources(),
|
|
|
|
|
|
+ holder.binding.nameText.setTextColor(ResourcesCompat.getColor(
|
|
|
|
+ holder.binding.nameText.getContext().getResources(),
|
|
R.color.high_emphasis_text,
|
|
R.color.high_emphasis_text,
|
|
null)
|
|
null)
|
|
- );
|
|
|
|
- holder.participantAvatar.setAlpha(1.0f);
|
|
|
|
|
|
+ );
|
|
|
|
+ holder.binding.avatarDraweeView.setAlpha(1.0f);
|
|
}
|
|
}
|
|
|
|
|
|
if (adapter.hasFilter()) {
|
|
if (adapter.hasFilter()) {
|
|
- FlexibleUtils.highlightText(holder.contactDisplayName, participant.getDisplayName(),
|
|
|
|
- String.valueOf(adapter.getFilter(String.class)), NextcloudTalkApplication.Companion.getSharedApplication()
|
|
|
|
- .getResources().getColor(R.color.colorPrimary));
|
|
|
|
|
|
+ FlexibleUtils.highlightText(holder.binding.nameText,
|
|
|
|
+ participant.getDisplayName(),
|
|
|
|
+ String.valueOf(adapter.getFilter(String.class)),
|
|
|
|
+ NextcloudTalkApplication
|
|
|
|
+ .Companion
|
|
|
|
+ .getSharedApplication()
|
|
|
|
+ .getResources()
|
|
|
|
+ .getColor(R.color.colorPrimary));
|
|
}
|
|
}
|
|
|
|
|
|
- holder.contactDisplayName.setText(participant.getDisplayName());
|
|
|
|
|
|
+ holder.binding.nameText.setText(participant.getDisplayName());
|
|
|
|
|
|
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
|
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
|
- (participant.getType().equals(Participant.ParticipantType.GUEST) || participant.getType().equals(Participant.ParticipantType.USER_FOLLOWING_LINK))) {
|
|
|
|
- holder.contactDisplayName.setText(NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest));
|
|
|
|
|
|
+ (participant.getType().equals(Participant.ParticipantType.GUEST) ||
|
|
|
|
+ participant.getType().equals(Participant.ParticipantType.USER_FOLLOWING_LINK))) {
|
|
|
|
+ holder.binding.nameText.setText(NextcloudTalkApplication
|
|
|
|
+ .Companion
|
|
|
|
+ .getSharedApplication()
|
|
|
|
+ .getString(R.string.nc_guest));
|
|
}
|
|
}
|
|
|
|
|
|
- if (participant.getActorType() == Participant.ActorType.GROUPS ||
|
|
|
|
- "groups".equals(participant.getSource()) ||
|
|
|
|
- participant.getActorType() == Participant.ActorType.CIRCLES ||
|
|
|
|
- "circles".equals(participant.getSource())) {
|
|
|
|
- holder.participantAvatar.setImageResource(R.drawable.ic_circular_group);
|
|
|
|
|
|
+ if (
|
|
|
|
+ participant.getActorType() == Participant.ActorType.GROUPS ||
|
|
|
|
+ PARTICIPANT_SOURCE_GROUPS.equals(participant.getSource()) ||
|
|
|
|
+ participant.getActorType() == Participant.ActorType.CIRCLES ||
|
|
|
|
+ PARTICIPANT_SOURCE_CIRCLES.equals(participant.getSource())) {
|
|
|
|
+
|
|
|
|
+ holder.binding.avatarDraweeView.setImageResource(R.drawable.ic_circular_group);
|
|
|
|
+
|
|
} else if (participant.getActorType() == Participant.ActorType.EMAILS) {
|
|
} else if (participant.getActorType() == Participant.ActorType.EMAILS) {
|
|
- holder.participantAvatar.setImageResource(R.drawable.ic_circular_mail);
|
|
|
|
- } else if (participant.getActorType() == Participant.ActorType.GUESTS ||
|
|
|
|
- Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
|
|
|
- Participant.ParticipantType.GUEST_MODERATOR.equals(participant.getType())) {
|
|
|
|
|
|
+
|
|
|
|
+ holder.binding.avatarDraweeView.setImageResource(R.drawable.ic_circular_mail);
|
|
|
|
+
|
|
|
|
+ } else if (
|
|
|
|
+ participant.getActorType() == Participant.ActorType.GUESTS ||
|
|
|
|
+ Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
|
|
|
+ Participant.ParticipantType.GUEST_MODERATOR.equals(participant.getType())) {
|
|
|
|
|
|
String displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
|
String displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
|
.getResources().getString(R.string.nc_guest);
|
|
.getResources().getString(R.string.nc_guest);
|
|
@@ -189,134 +181,40 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|
}
|
|
}
|
|
|
|
|
|
DraweeController draweeController = Fresco.newDraweeControllerBuilder()
|
|
DraweeController draweeController = Fresco.newDraweeControllerBuilder()
|
|
- .setOldController(holder.participantAvatar.getController())
|
|
|
|
|
|
+ .setOldController(holder.binding.avatarDraweeView.getController())
|
|
.setAutoPlayAnimations(true)
|
|
.setAutoPlayAnimations(true)
|
|
- .setImageRequest(DisplayUtils.getImageRequestForUrl(ApiUtils.getUrlForAvatarWithNameForGuests(userEntity.getBaseUrl(),
|
|
|
|
- displayName, R.dimen.avatar_size), null))
|
|
|
|
|
|
+ .setImageRequest(DisplayUtils.getImageRequestForUrl(
|
|
|
|
+ ApiUtils.getUrlForAvatarWithNameForGuests(userEntity.getBaseUrl(),
|
|
|
|
+ displayName,
|
|
|
|
+ R.dimen.avatar_size),
|
|
|
|
+ null))
|
|
.build();
|
|
.build();
|
|
- holder.participantAvatar.setController(draweeController);
|
|
|
|
|
|
+ holder.binding.avatarDraweeView.setController(draweeController);
|
|
|
|
|
|
- } else if (participant.getActorType() == Participant.ActorType.USERS || participant.getSource().equals("users")) {
|
|
|
|
|
|
+ } else if (participant.getActorType() == Participant.ActorType.USERS ||
|
|
|
|
+ PARTICIPANT_SOURCE_USERS.equals(participant.getSource())) {
|
|
DraweeController draweeController = Fresco.newDraweeControllerBuilder()
|
|
DraweeController draweeController = Fresco.newDraweeControllerBuilder()
|
|
- .setOldController(holder.participantAvatar.getController())
|
|
|
|
|
|
+ .setOldController(holder.binding.avatarDraweeView.getController())
|
|
.setAutoPlayAnimations(true)
|
|
.setAutoPlayAnimations(true)
|
|
- .setImageRequest(DisplayUtils.getImageRequestForUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
|
|
|
|
- participant.getActorId(), R.dimen.avatar_size), null))
|
|
|
|
|
|
+ .setImageRequest(DisplayUtils.getImageRequestForUrl(
|
|
|
|
+ ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
|
|
|
|
+ participant.getActorId(),
|
|
|
|
+ R.dimen.avatar_size),
|
|
|
|
+ null))
|
|
.build();
|
|
.build();
|
|
- holder.participantAvatar.setController(draweeController);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Resources resources = NextcloudTalkApplication.Companion.getSharedApplication().getResources();
|
|
|
|
-
|
|
|
|
- if (header == null) {
|
|
|
|
- Long inCallFlag = participant.getInCall();
|
|
|
|
- if ((inCallFlag & InCallFlags.WITH_PHONE) > 0) {
|
|
|
|
- holder.videoCallIconView.setImageResource(R.drawable.ic_call_grey_600_24dp);
|
|
|
|
- holder.videoCallIconView.setVisibility(View.VISIBLE);
|
|
|
|
- holder.videoCallIconView.setContentDescription(
|
|
|
|
- resources.getString(R.string.nc_call_state_with_phone, participant.displayName));
|
|
|
|
- } else if ((inCallFlag & InCallFlags.WITH_VIDEO) > 0) {
|
|
|
|
- holder.videoCallIconView.setImageResource(R.drawable.ic_videocam_grey_600_24dp);
|
|
|
|
- holder.videoCallIconView.setVisibility(View.VISIBLE);
|
|
|
|
- holder.videoCallIconView.setContentDescription(
|
|
|
|
- resources.getString(R.string.nc_call_state_with_video, participant.displayName));
|
|
|
|
- } else if (inCallFlag > InCallFlags.DISCONNECTED) {
|
|
|
|
- holder.videoCallIconView.setImageResource(R.drawable.ic_mic_grey_600_24dp);
|
|
|
|
- holder.videoCallIconView.setVisibility(View.VISIBLE);
|
|
|
|
- holder.videoCallIconView.setContentDescription(
|
|
|
|
- resources.getString(R.string.nc_call_state_in_call, participant.displayName));
|
|
|
|
- } else {
|
|
|
|
- holder.videoCallIconView.setVisibility(View.GONE);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (holder.contactMentionId != null) {
|
|
|
|
- String userType = "";
|
|
|
|
-
|
|
|
|
- switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) {
|
|
|
|
- case 1:
|
|
|
|
- //userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_owner);
|
|
|
|
- //break;
|
|
|
|
- case 2:
|
|
|
|
- case 6: // Guest moderator
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_moderator);
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_user);
|
|
|
|
- if (participant.getActorType() == Participant.ActorType.GROUPS) {
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_group);
|
|
|
|
- }
|
|
|
|
- if (participant.getActorType() == Participant.ActorType.CIRCLES) {
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_circle);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case 4:
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
|
|
|
|
- if (participant.getActorType() == Participant.ActorType.EMAILS) {
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_email);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case 5:
|
|
|
|
- userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_following_link);
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!userType.equals(NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_user))) {
|
|
|
|
- holder.contactMentionId.setText("(" + userType + ")");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void drawStatus(UserItemViewHolder holder) {
|
|
|
|
- if (holder.statusMessage != null && holder.participantEmoji != null && holder.userStatusImage != null) {
|
|
|
|
- float size = DisplayUtils.convertDpToPixel(STATUS_SIZE_IN_DP, context);
|
|
|
|
- holder.userStatusImage.setImageDrawable(new StatusDrawable(
|
|
|
|
- participant.status,
|
|
|
|
- NO_ICON,
|
|
|
|
- size,
|
|
|
|
- context.getResources().getColor(R.color.bg_default),
|
|
|
|
- context));
|
|
|
|
-
|
|
|
|
- if (participant.statusMessage != null) {
|
|
|
|
- holder.statusMessage.setText(participant.statusMessage);
|
|
|
|
- alignUsernameVertical(holder, 0);
|
|
|
|
- } else {
|
|
|
|
- holder.statusMessage.setText("");
|
|
|
|
- alignUsernameVertical(holder, 10);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (participant.statusIcon != null && !participant.statusIcon.isEmpty()) {
|
|
|
|
- holder.participantEmoji.setText(participant.statusIcon);
|
|
|
|
- } else {
|
|
|
|
- holder.participantEmoji.setVisibility(View.GONE);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (participant.status != null && participant.status.equals(StatusType.DND.getString())) {
|
|
|
|
- if (participant.statusMessage == null || participant.statusMessage.isEmpty()) {
|
|
|
|
- holder.statusMessage.setText(R.string.dnd);
|
|
|
|
- }
|
|
|
|
- } else if (participant.status != null && participant.status.equals(StatusType.AWAY.getString())) {
|
|
|
|
- if (participant.statusMessage == null || participant.statusMessage.isEmpty()) {
|
|
|
|
- holder.statusMessage.setText(R.string.away);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ holder.binding.avatarDraweeView.setController(draweeController);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void alignUsernameVertical(UserItem.UserItemViewHolder holder, float densityPixelsFromTop) {
|
|
|
|
- ConstraintLayout.LayoutParams layoutParams =
|
|
|
|
- (ConstraintLayout.LayoutParams) holder.contactDisplayName.getLayoutParams();
|
|
|
|
- layoutParams.topMargin = (int) DisplayUtils.convertDpToPixel(densityPixelsFromTop, context);
|
|
|
|
- holder.contactDisplayName.setLayoutParams(layoutParams);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public boolean filter(String constraint) {
|
|
public boolean filter(String constraint) {
|
|
return participant.getDisplayName() != null &&
|
|
return participant.getDisplayName() != null &&
|
|
- (Pattern.compile(constraint, Pattern.CASE_INSENSITIVE | Pattern.LITERAL).matcher(participant.getDisplayName().trim()).find() ||
|
|
|
|
- Pattern.compile(constraint, Pattern.CASE_INSENSITIVE | Pattern.LITERAL).matcher(participant.getActorId().trim()).find());
|
|
|
|
|
|
+ (Pattern.compile(constraint, Pattern.CASE_INSENSITIVE | Pattern.LITERAL)
|
|
|
|
+ .matcher(participant.getDisplayName().trim())
|
|
|
|
+ .find() ||
|
|
|
|
+ Pattern.compile(constraint, Pattern.CASE_INSENSITIVE | Pattern.LITERAL)
|
|
|
|
+ .matcher(participant.getActorId().trim())
|
|
|
|
+ .find());
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -331,36 +229,14 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|
|
|
|
|
static class UserItemViewHolder extends FlexibleViewHolder {
|
|
static class UserItemViewHolder extends FlexibleViewHolder {
|
|
|
|
|
|
- @BindView(R.id.name_text)
|
|
|
|
- public EmojiTextView contactDisplayName;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.avatar_drawee_view)
|
|
|
|
- public SimpleDraweeView participantAvatar;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.secondary_text)
|
|
|
|
- public EmojiTextView contactMentionId;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.videoCallIcon)
|
|
|
|
- ImageView videoCallIconView;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.checkedImageView)
|
|
|
|
- ImageView checkedImageView;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.participant_status_emoji)
|
|
|
|
- com.vanniktech.emoji.EmojiEditText participantEmoji;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.user_status_image)
|
|
|
|
- ImageView userStatusImage;
|
|
|
|
- @Nullable
|
|
|
|
- @BindView(R.id.conversation_info_status_message)
|
|
|
|
- EmojiTextView statusMessage;
|
|
|
|
|
|
+ RvItemContactBinding binding;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Default constructor.
|
|
* Default constructor.
|
|
*/
|
|
*/
|
|
UserItemViewHolder(View view, FlexibleAdapter adapter) {
|
|
UserItemViewHolder(View view, FlexibleAdapter adapter) {
|
|
super(view, adapter);
|
|
super(view, adapter);
|
|
- ButterKnife.bind(this, view);
|
|
|
|
|
|
+ binding = RvItemContactBinding.bind(view);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|