use of com.waz.zclient.controllers.tracking.events.group.RemoveContactEvent in project wire-android by wireapp.
the class ParticipantFragment method showRemoveConfirmation.
//////////////////////////////////////////////////////////////////////////////////////////
//
// UserProfileContainer
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void showRemoveConfirmation(final User user) {
// Show confirmation dialog before removing user
ConfirmationCallback callback = new TwoButtonConfirmationCallback() {
@Override
public void positiveButtonClicked(boolean checkboxIsSelected) {
dismissUserProfile();
new Handler().post(new Runnable() {
@Override
public void run() {
getStoreFactory().getConversationStore().getCurrentConversation().removeMember(user);
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new RemoveContactEvent(true, getParticipantsCount()));
}
});
}
@Override
public void negativeButtonClicked() {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new RemoveContactEvent(false, getParticipantsCount()));
}
@Override
public void onHideAnimationEnd(boolean confirmed, boolean canceled, boolean checkboxIsSelected) {
}
};
String header = getString(R.string.confirmation_menu__header);
String text = getString(R.string.confirmation_menu_text_with_name, user.getDisplayName());
String confirm = getString(R.string.confirmation_menu__confirm_remove);
String cancel = getString(R.string.confirmation_menu__cancel);
ConfirmationRequest request = new ConfirmationRequest.Builder().withHeader(header).withMessage(text).withPositiveButton(confirm).withNegativeButton(cancel).withConfirmationCallback(callback).withWireTheme(getControllerFactory().getThemeController().getThemeDependentOptionsTheme()).build();
getControllerFactory().getConfirmationController().requestConfirmation(request, IConfirmationController.PARTICIPANTS);
SoundController ctrl = inject(SoundController.class);
if (ctrl != null) {
ctrl.playAlert();
}
}
Aggregations