use of com.waz.zclient.ui.theme.OptionsTheme in project wire-android by wireapp.
the class SingleParticipantFragment method showBlockConfirmation.
private void showBlockConfirmation(final User user) {
ConfirmationCallback callback = new TwoButtonConfirmationCallback() {
@Override
public void positiveButtonClicked(boolean checkboxIsSelected) {
getStoreFactory().getConnectStore().blockUser(user);
// Dismiss common user profile
getContainer().dismissUserProfile();
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new BlockingEvent(BlockingEvent.ConformationResponse.BLOCK));
}
@Override
public void negativeButtonClicked() {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new BlockingEvent(BlockingEvent.ConformationResponse.CANCEL));
}
@Override
public void onHideAnimationEnd(boolean confirmed, boolean canceled, boolean checkboxIsSelected) {
}
};
String header = getString(R.string.confirmation_menu__block_header);
String text = getString(R.string.confirmation_menu__block_text_with_name, user.getDisplayName());
String confirm = getString(R.string.confirmation_menu__confirm_block);
String cancel = getString(R.string.confirmation_menu__cancel);
OptionsTheme optionsTheme = getControllerFactory().getThemeController().getThemeDependentOptionsTheme();
ConfirmationRequest request = new ConfirmationRequest.Builder().withHeader(header).withMessage(text).withPositiveButton(confirm).withNegativeButton(cancel).withConfirmationCallback(callback).withWireTheme(optionsTheme).build();
getControllerFactory().getConfirmationController().requestConfirmation(request, IConfirmationController.USER_PROFILE);
SoundController ctrl = inject(SoundController.class);
if (ctrl != null) {
ctrl.playAlert();
}
}
use of com.waz.zclient.ui.theme.OptionsTheme in project wire-android by wireapp.
the class ParticipantFragment method showBlockUserConfirmation.
private void showBlockUserConfirmation(final User user) {
ConfirmationCallback callback = new TwoButtonConfirmationCallback() {
@Override
public void positiveButtonClicked(boolean checkboxIsSelected) {
getStoreFactory().getConversationStore().setCurrentConversationToNext(ConversationChangeRequester.BLOCK_USER);
getStoreFactory().getConnectStore().blockUser(user);
getControllerFactory().getConversationScreenController().hideUser();
if (LayoutSpec.isTablet(getActivity())) {
getControllerFactory().getConversationScreenController().hideParticipants(false, true);
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new BlockingEvent(BlockingEvent.ConformationResponse.BLOCK));
}
@Override
public void negativeButtonClicked() {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new BlockingEvent(BlockingEvent.ConformationResponse.CANCEL));
}
@Override
public void onHideAnimationEnd(boolean confirmed, boolean canceled, boolean checkboxIsSelected) {
}
};
String header = getString(R.string.confirmation_menu__block_header);
String text = getString(R.string.confirmation_menu__block_text_with_name, user.getDisplayName());
String confirm = getString(R.string.confirmation_menu__confirm_block);
String cancel = getString(R.string.confirmation_menu__cancel);
OptionsTheme optionsTheme = getControllerFactory().getThemeController().getThemeDependentOptionsTheme();
ConfirmationRequest request = new ConfirmationRequest.Builder().withHeader(header).withMessage(text).withPositiveButton(confirm).withNegativeButton(cancel).withConfirmationCallback(callback).withWireTheme(optionsTheme).build();
getControllerFactory().getConfirmationController().requestConfirmation(request, IConfirmationController.PARTICIPANTS);
SoundController ctrl = inject(SoundController.class);
if (ctrl != null) {
ctrl.playAlert();
}
}
Aggregations