Skip to content

Commit

Permalink
UI with SDK 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yadavmangesh committed Apr 17, 2019
1 parent d9bf163 commit b828541
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,6 @@ public void typingEnded(TypingIndicator typingIndicator) {
toolbarSubTitle.setText(names);
}

@Override
public void onMessageDelivered(MessageReceipt messageReceipt) {
if (groupMessageAdapter!=null)
groupMessageAdapter.Delivered(messageReceipt);

}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,20 +262,6 @@ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup,
}


private void setDeliveryIcon(CircleImageView circleImageView,BaseMessage baseMessage){
if (baseMessage.getDeliveredAt()!=0){
circleImageView.setImageResource(R.drawable.ic_double_tick);
}
}

public void Delivered(MessageReceipt messageReceipt) {
BaseMessage baseMessage=messageList.get(messageReceipt.getMessageId());
if (baseMessage!=null) {
baseMessage.setDeliveredAt(messageReceipt.getTimestamp());
messageList.put(baseMessage.getId(), baseMessage);
notifyDataSetChanged();
}
}

@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
Expand Down Expand Up @@ -348,7 +334,7 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i)
rightMessageViewHolder.messageStatus.setVisibility(View.VISIBLE);
rightMessageViewHolder.textMessage.setTypeface(FontUtils.openSansRegular);
rightMessageViewHolder.messageStatus.setImageResource(R.drawable.ic_check_white_24dp);
setDeliveryIcon(rightMessageViewHolder.messageStatus,baseMessage);

break;
case LEFT_IMAGE_MESSAGE:
LeftImageVideoViewHolder leftImageViewHolder = (LeftImageVideoViewHolder) viewHolder;
Expand Down Expand Up @@ -377,7 +363,6 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i)
rightImageVideoViewHolder.messageTimeStamp.setText(timeStampString);
rightImageVideoViewHolder.btnPlayVideo.setVisibility(View.GONE);
rightImageVideoViewHolder.fileLoadingProgressBar.setVisibility(View.GONE);
setDeliveryIcon(rightImageVideoViewHolder.messageStatus,baseMessage);
if (mediaFile != null) {

RequestOptions RightrequestOptions = new RequestOptions().centerCrop()
Expand Down Expand Up @@ -431,7 +416,6 @@ public void onClick(View view) {
rightVideoViewHolder.messageTimeStamp.setText(timeStampString);
rightVideoViewHolder.btnPlayVideo.setVisibility(View.VISIBLE);
rightVideoViewHolder.fileLoadingProgressBar.setVisibility(View.GONE);
setDeliveryIcon(rightVideoViewHolder.messageStatus,baseMessage);
RequestOptions requestOptions2 = new RequestOptions().fitCenter()
.placeholder(R.drawable.ic_broken_image);
Glide.with(context)
Expand All @@ -457,7 +441,7 @@ public void onClick(View view) {
if (!player.isPlaying()) {
rightAudioViewHolder.playAudio.setImageResource(R.drawable.ic_play_arrow);
}
setDeliveryIcon(rightAudioViewHolder.messageStatus,baseMessage);

rightAudioViewHolder.audioSeekBar.setProgress(0);
String rightAudioPath = null;
File rightAudioFile = null;
Expand Down Expand Up @@ -735,7 +719,6 @@ public void run() {
rightFileViewHolder.fileName.setText(mediaMessage.getAttachment().getFileName());
rightFileViewHolder.messageTimeStamp.setText(timeStampString);
rightFileViewHolder.fileType.setText(mediaMessage.getAttachment().getFileExtension());
setDeliveryIcon(rightFileViewHolder.messageStatus,baseMessage);
final String finalMediaFile = mediaFile;
rightFileViewHolder.fileName.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -786,7 +769,6 @@ public void onClick(View view) {
rightTextReplyViewHolder.tvNameReply.setText(textMessage.getMetadata().getString("senderName"));
}
}
setDeliveryIcon(rightTextReplyViewHolder.ivMessageStatus,baseMessage);
rightTextReplyViewHolder.tvNewMessage.setVisibility(View.VISIBLE);
rightTextReplyViewHolder.tvNewMessage.setText(textMessage.getText());

Expand Down Expand Up @@ -916,7 +898,6 @@ public void onClick(View view) {
rightMediaReplyViewHolder.tvNameReply.setText(mediaMessage.getMetadata().getString("senderName"));
}
}
setDeliveryIcon(rightMediaReplyViewHolder.ivMessageStatus,baseMessage);
if (mediaMessage.getMetadata().has("type")) {

switch (mediaMessage.getMetadata().getString("type")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ interface GroupChatView extends BaseView {

void typingEnded(TypingIndicator typingIndicator);

void onMessageDelivered(MessageReceipt messageReceipt);
}

interface GroupChatPresenter extends BasePresenter<GroupChatView> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void onTypingEnded(TypingIndicator typingIndicator) {

@Override
public void onMessageDelivered(MessageReceipt messageReceipt) {
getBaseView().onMessageDelivered(messageReceipt);

}

});
Expand Down

0 comments on commit b828541

Please sign in to comment.