use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class TagCacheTest method populateCacheTags.
public void populateCacheTags() {
chatListeners = new ChatListener() {
@Override
public void OnTagList(String content, ChatResponse<TagListResult> response) {
if (response.isCache()) {
System.out.println("Received List: " + content);
cacheTags.addAll(response.getResult().getTags());
chat.removeListener(chatListeners);
}
resumeProcess();
}
};
chat.setListener(chatListeners);
GetTagListRequest request = new GetTagListRequest.Builder().build();
chat.getTagList(request);
pauseProcess();
System.out.println("Received List: " + cacheTags.size());
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class TagCacheTest method populateServerTags.
public void populateServerTags() {
chatListeners = new ChatListener() {
@Override
public void OnTagList(String content, ChatResponse<TagListResult> response) {
if (!response.isCache()) {
System.out.println("Received List: " + content);
serverTags.addAll(response.getResult().getTags());
chat.removeListener(chatListeners);
}
resumeProcess();
}
};
chat.setListener(chatListeners);
GetTagListRequest request = new GetTagListRequest.Builder().withNoCache().build();
chat.getTagList(request);
pauseProcess();
System.out.println("Received List: " + serverTags.size());
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class TagCacheTest method deleteTag.
public void deleteTag(long tagId) {
chatListeners = new ChatListener() {
@Override
public void onTagDeleted(String content, ChatResponse<TagResult> response) {
chat.removeListener(chatListeners);
resumeProcess();
}
};
chat.setListener(chatListeners);
DeleteTagRequest request = new DeleteTagRequest.Builder(tagId).build();
chat.deleteTag(request);
pauseProcess();
System.out.println("Tag Deleted: ");
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class TagCacheTest method addNewTag.
public void addNewTag() {
chatListeners = new ChatListener() {
@Override
public void onTagCreated(String content, ChatResponse<TagResult> response) {
chat.removeListener(chatListeners);
resumeProcess();
tagId = response.getResult().getTag().getTagId();
}
};
chat.setListener(chatListeners);
CreateTagRequest request = new CreateTagRequest.Builder("Tag_" + System.currentTimeMillis() / 1000).build();
chat.createTag(request);
pauseProcess();
System.out.println("New Tag Created: ");
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class TagCacheTest method addTagParticipant.
public void addTagParticipant(long tagId) {
chatListeners = new ChatListener() {
@Override
public void OnTagParticipantAdded(String content, ChatResponse<TagParticipantResult> response) {
chat.removeListener(chatListeners);
resumeProcess();
}
};
chat.setListener(chatListeners);
List<Long> threadIds = new ArrayList<>();
threadIds.add(8688l);
threadIds.add(8730l);
threadIds.add(8729l);
AddTagParticipantRequest request = new AddTagParticipantRequest.Builder(tagId, threadIds).build();
chat.addTagParticipant(request);
pauseProcess();
System.out.println("Tag Participant Added: ");
}
Aggregations