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: case ROOM_TYPE_ONE_TO_ONE_CALL:
holder.onlineIndicator.setVisibility(View.VISIBLE); holder.onlineIndicator.setVisibility(View.VISIBLE);
if (conversation.getParticipants() == null || conversation.getParticipants().isEmpty()) { if (conversation.getCount() > 0) {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline)); 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 { } 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())) { if (!TextUtils.isEmpty(conversation.getName())) {
GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
conversation.getName(), R.dimen.avatar_size), new LazyHeaders.Builder() conversation.getName(), R.dimen.avatar_size), new LazyHeaders.Builder()
@ -226,9 +228,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
} }
break; break;
case ROOM_GROUP_CALL: 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); holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context) GlideApp.with(context)
@ -241,8 +240,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
.into(holder.dialogAvatar); .into(holder.dialogAvatar);
break; break;
case ROOM_PUBLIC_CALL: 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); holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context) GlideApp.with(context)
.asBitmap() .asBitmap()

View File

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