Skip to content

Commit

Permalink
[CM-1472] - Show Typing Indicator while api fetching the response (#404)
Browse files Browse the repository at this point in the history
* [CM-1472] - Show Typing Indicator while api fetching the response

* minor code changes
  • Loading branch information
pranaysaini04 authored Jul 5, 2023
1 parent 8b347a1 commit ad5068e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public class AlCustomizationSettings extends JsonMarker {

private boolean launchChatFromProfilePicOrName = false;
private boolean useDeviceDefaultLanguage = true;
private boolean showTypingIndicatorWhileFetchingResponse = false;
private Map<String, Boolean> filterGallery;
private boolean enableShareConversation = false;
private String messageStatusIconColor = "";
Expand Down Expand Up @@ -641,6 +642,9 @@ public boolean isAgentApp() {
public boolean isUseDeviceDefaultLanguage(){
return useDeviceDefaultLanguage;
}
public boolean isShowTypingIndicatorWhileFetchingResponse() {
return showTypingIndicatorWhileFetchingResponse;
}

public boolean isGroupSubtitleHidden() {
return hideGroupSubtitle;
Expand Down Expand Up @@ -817,6 +821,7 @@ public String toString() {
", toolbarTitleColor=" + toolbarTitleColor +
", toolbarSubtitleColor=" + toolbarSubtitleColor +
", useDeviceDefaultLanguage=" + useDeviceDefaultLanguage +
", showTypingIndicatorWhileFetchingResponse=" + showTypingIndicatorWhileFetchingResponse+
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.applozic.mobicomkit.ApplozicClient;
import com.applozic.mobicomkit.api.MobiComKitConstants;
import com.applozic.mobicomkit.api.account.user.MobiComUserPreference;
import com.applozic.mobicomkit.api.account.user.User;
import com.applozic.mobicomkit.api.account.user.UserClientService;
import com.applozic.mobicomkit.api.attachment.FileClientService;
import com.applozic.mobicomkit.api.attachment.FileMeta;
Expand All @@ -32,6 +33,7 @@
import com.applozic.mobicomkit.channel.service.ChannelService;
import com.applozic.mobicomkit.contact.AppContactService;
import com.applozic.mobicomkit.contact.BaseContactService;
import com.applozic.mobicomkit.uiwidgets.AlCustomizationSettings;
import com.applozic.mobicomkit.uiwidgets.R;
import com.applozic.mobicomkit.uiwidgets.async.KmChannelDeleteTask;
import com.applozic.mobicomkit.uiwidgets.async.KmChannelLeaveMember;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
import java.util.Timer;
Expand Down Expand Up @@ -2805,6 +2806,12 @@ public void updateMessageKeyString(final Message message) {
if (getActivity() == null) {
return;
}
//Showing typing indicator when bot is fetching response from API
if (alCustomizationSettings.isShowTypingIndicatorWhileFetchingResponse()){
if (Objects.equals(conversationAssignee.getRoleType(), User.RoleType.BOT.getValue())){
updateTypingStatus(message.getTo(),true);
}
}

this.getActivity().runOnUiThread(new Runnable() {
@Override
Expand Down

0 comments on commit ad5068e

Please sign in to comment.