use of com.applozic.mobicomkit.api.notification.MuteNotificationRequest in project Applozic-Android-SDK by AppLozic.
the class MobiComConversationFragment method umuteGroupChat.
public void umuteGroupChat() {
Date date = Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTime();
millisecond = date.getTime();
final MuteNotificationAsync.TaskListener taskListener = new MuteNotificationAsync.TaskListener() {
@Override
public void onSuccess(ApiResponse apiResponse) {
if (menu != null) {
menu.findItem(R.id.unmuteGroup).setVisible(false);
menu.findItem(R.id.muteGroup).setVisible(true);
}
}
@Override
public void onFailure(ApiResponse apiResponse, Exception exception) {
}
@Override
public void onCompletion() {
}
};
muteNotificationRequest = new MuteNotificationRequest(channel.getKey(), millisecond);
MuteNotificationAsync muteNotificationAsync = new MuteNotificationAsync(getContext(), taskListener, muteNotificationRequest);
AlTask.execute(muteNotificationAsync);
}
use of com.applozic.mobicomkit.api.notification.MuteNotificationRequest in project Applozic-Android-SDK by AppLozic.
the class MobiComConversationFragment method muteGroupChat.
public void muteGroupChat() {
final CharSequence[] items = { ApplozicService.getContext(getContext()).getString(R.string.eight_Hours), ApplozicService.getContext(getContext()).getString(R.string.one_week), ApplozicService.getContext(getContext()).getString(R.string.one_year) };
Date date = Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTime();
millisecond = date.getTime();
final MuteNotificationAsync.TaskListener taskListener = new MuteNotificationAsync.TaskListener() {
@Override
public void onSuccess(ApiResponse apiResponse) {
if (menu != null) {
menu.findItem(R.id.muteGroup).setVisible(false);
menu.findItem(R.id.unmuteGroup).setVisible(true);
}
}
@Override
public void onFailure(ApiResponse apiResponse, Exception exception) {
}
@Override
public void onCompletion() {
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).setTitle(ApplozicService.getContext(getContext()).getString(R.string.mute_group_for)).setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, final int selectedItem) {
if (selectedItem == 0) {
millisecond = millisecond + 28800000;
} else if (selectedItem == 1) {
millisecond = millisecond + 604800000;
} else if (selectedItem == 2) {
millisecond = millisecond + 31558000000L;
}
muteNotificationRequest = new MuteNotificationRequest(channel.getKey(), millisecond);
MuteNotificationAsync muteNotificationAsync = new MuteNotificationAsync(getContext(), taskListener, muteNotificationRequest);
AlTask.execute(muteNotificationAsync);
dialog.dismiss();
}
});
AlertDialog alertdialog = builder.create();
alertdialog.show();
}
Aggregations