use of com.applozic.mobicomkit.listners.AlCallback in project Applozic-Android-SDK by AppLozic.
the class AlLinkPreview method createView.
public void createView() {
AlLinkPreviewModel existingLinkModel = getUrlMetaModel();
if (existingLinkModel != null) {
updateViews(existingLinkModel);
} else {
urlLoadLayout.setVisibility(View.GONE);
AlTask.execute(new UrlLoader(context, message, new AlCallback() {
@Override
public void onSuccess(Object response) {
updateViews((AlLinkPreviewModel) response);
}
@Override
public void onError(Object error) {
}
}));
}
}
use of com.applozic.mobicomkit.listners.AlCallback in project Applozic-Android-SDK by AppLozic.
the class ApplozicClient method disableChatForUser.
public ApplozicClient disableChatForUser(final boolean disable, final AlCallback callback) {
Map<String, String> userMetadata;
Contact contact = new AppContactService(context).getContactById(MobiComUserPreference.getInstance(context).getUserId());
if (contact != null && contact.getMetadata() != null) {
userMetadata = contact.getMetadata();
userMetadata.putAll(contact.getMetadata());
} else {
userMetadata = new HashMap<>();
}
userMetadata.put(Contact.DISABLE_CHAT_WITH_USER, String.valueOf(disable));
User user = new User();
user.setMetadata(userMetadata);
UserService.getInstance(context).updateUser(user, new AlCallback() {
@Override
public void onSuccess(Object response) {
sharedPreferences.edit().putBoolean(Contact.DISABLE_CHAT_WITH_USER, disable).commit();
if (callback != null) {
callback.onSuccess(response);
}
}
@Override
public void onError(Object error) {
if (callback != null) {
callback.onError(error);
}
}
});
return this;
}
Aggregations