本文整理了Java中androidx.appcompat.app.AlertDialog.setOnShowListener()
方法的一些代码示例,展示了AlertDialog.setOnShowListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setOnShowListener()
方法的具体详情如下:
包路径:androidx.appcompat.app.AlertDialog
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!