alert.setOnShowListener((DialogInterface dialogInterface) -> { if (getTargetFragment() != null && getTargetFragment() instanceof OnDialogShowListener) ((OnDialogShowListener) getTargetFragment()).onShow(alert);
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Bundle args = getArguments(); String title = args.getString(TAG_TITLE); String message = args.getString(TAG_MESSAGE); String positiveText = args.getString(TAG_POS_TEXT); String negativeText = args.getString(TAG_NEG_TEXT); String neutralText = args.getString(TAG_NEUTRAL_BUTTON); int resIdView = args.getInt(TAG_RES_ID_VIEW); LayoutInflater i = LayoutInflater.from(getActivity()); View v = null; if (resIdView != 0) v = i.inflate(resIdView, null); AlertDialog.Builder dialog = buildDialog(title, message, v, positiveText, negativeText, neutralText); final AlertDialog alert = dialog.create(); alert.setOnShowListener((DialogInterface dialogInterface) -> { if (getTargetFragment() != null && getTargetFragment() instanceof OnDialogShowListener) ((OnDialogShowListener) getTargetFragment()).onShow(alert); else if (getActivity() instanceof OnDialogShowListener) ((OnDialogShowListener) getActivity()).onShow(alert); }); return alert; }
alert.setOnShowListener((DialogInterface dialogInterface) -> { if (getTargetFragment() != null) { if (getTargetFragment() instanceof OnDialogShowListener)
.create(); dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialogInterface) {
dialog.setOnShowListener(dialogInterface -> { if (mDividerColor != 0) {
dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialogInterface) {
@Override public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) { final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); alertDialogBuilder.setTitle(R.string.excluded_applications); final AppListDialogFragmentBinding binding = AppListDialogFragmentBinding.inflate(getActivity().getLayoutInflater(), null, false); binding.executePendingBindings(); alertDialogBuilder.setView(binding.getRoot()); alertDialogBuilder.setPositiveButton(R.string.set_exclusions, (dialog, which) -> setExclusionsAndDismiss()); alertDialogBuilder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); alertDialogBuilder.setNeutralButton(R.string.deselect_all, (dialog, which) -> { }); binding.setFragment(this); binding.setAppData(appData); loadData(); final AlertDialog dialog = alertDialogBuilder.create(); dialog.setOnShowListener(d -> dialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(view -> { for (final ApplicationData app : appData) app.setExcludedFromTunnel(false); })); return dialog; }