Add status support

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-04 16:05:16 +02:00
parent ef8a2b68fd
commit d5c582efb7
2 changed files with 11 additions and 14 deletions

View file

@ -196,15 +196,17 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
case ROOM_TYPE_ONE_TO_ONE_CALL:
holder.onlineIndicator.setVisibility(View.VISIBLE);
if (conversation.getParticipants() == null || conversation.getParticipants().isEmpty()) {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline));
if (conversation.getCount() > 0) {
if (conversation.getCount() == 2 || (conversation.getCount() == 1 &&
conversation.getSessionId().equals("0"))) {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_online));
} else {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline));
}
} else {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_online));
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline));
}
//holder.moreMenuButton.setContentDescription(String.format(resources.getString(R.string
// .nc_description_more_menu_one_to_one), conversation.getDisplayName()));
if (!TextUtils.isEmpty(conversation.getName())) {
GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
conversation.getName(), R.dimen.avatar_size), new LazyHeaders.Builder()
@ -226,9 +228,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
}
break;
case ROOM_GROUP_CALL:
//holder.moreMenuButton.setContentDescription(String.format(resources.getString(R.string
// .nc_description_more_menu_group), conversation.getDisplayName()));
holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context)
@ -241,8 +240,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
.into(holder.dialogAvatar);
break;
case ROOM_PUBLIC_CALL:
//holder.moreMenuButton.setContentDescription(String.format(resources.getString(R.string
// .nc_description_more_menu_public), conversation.getDisplayName()));
holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context)
.asBitmap()

View file

@ -29,7 +29,7 @@ import com.nextcloud.talk.models.json.participants.Participant;
import org.parceler.Parcel;
import java.util.List;
import java.util.HashMap;
import lombok.Data;
@ -54,9 +54,9 @@ public class Conversation {
@JsonField(name = "numGuests")
public long numberOfGuests;
@JsonField(name = "guestList")
public List<Participant> guestList;
public HashMap<String, HashMap<String, Object>> guestList;
@JsonField(name = "participants")
public List<Participant> participants;
public HashMap<String, HashMap<String, Object>> participants;
@JsonField(name = "participantType", typeConverter = EnumParticipantTypeConverter.class)
public Participant.ParticipantType participantType;
@JsonField(name = "hasPassword")