androidx.appcompat.app.AlertDialog.setOnShowListener()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中androidx.appcompat.app.AlertDialog.setOnShowListener()方法的一些代码示例,展示了AlertDialog.setOnShowListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setOnShowListener()方法的具体详情如下:
包路径:androidx.appcompat.app.AlertDialog
类名称:AlertDialog
方法名:setOnShowListener

AlertDialog.setOnShowListener介绍

暂无

代码示例

代码示例来源:origin: proninyaroslav/libretorrent

alert.setOnShowListener((DialogInterface dialogInterface) -> {
  if (getTargetFragment() != null && getTargetFragment() instanceof OnDialogShowListener)
    ((OnDialogShowListener) getTargetFragment()).onShow(alert);

代码示例来源:origin: proninyaroslav/libretorrent

@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;
}

代码示例来源:origin: proninyaroslav/libretorrent

alert.setOnShowListener((DialogInterface dialogInterface) -> {
  if (getTargetFragment() != null) {
    if (getTargetFragment() instanceof OnDialogShowListener)

代码示例来源:origin: Gwokhov/Deadline

.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
  @Override
  public void onShow(DialogInterface dialogInterface) {

代码示例来源:origin: PSDev/LicensesDialog

dialog.setOnShowListener(dialogInterface -> {
  if (mDividerColor != 0) {

代码示例来源:origin: Gwokhov/Deadline

dialog.setOnShowListener(new DialogInterface.OnShowListener() {
  @Override
  public void onShow(DialogInterface dialogInterface) {

代码示例来源:origin: WireGuard/wireguard-android

@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;
}

相关文章