Example usage for android.app Dialog Dialog

List of usage examples for android.app Dialog Dialog

Introduction

In this page you can find the example usage for android.app Dialog Dialog.

Prototype

public Dialog(@NonNull Context context) 

Source Link

Document

Creates a dialog window that uses the default dialog theme.

Usage

From source file:Main.java

public static Dialog netLineWarning(Context context) {

    Dialog dialog = new Dialog(context);

    return dialog;

}

From source file:com.memetro.android.alerts.CommentDialog.java

public static void showDialog(final Context context, String comment, String creator, boolean isMine,
        final Long id) {

    final Dialog mDialog = new Dialog(context);
    mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mDialog.setContentView(R.layout.comment_dialog);
    mDialog.setCancelable(true);/*w ww  .  j  a v  a  2s  . c  om*/

    TextView titleText = (TextView) mDialog.findViewById(R.id.title);
    TextView messageText = (TextView) mDialog.findViewById(R.id.message);
    Button closeButton = (Button) mDialog.findViewById(R.id.close);
    Button deleteButton = (Button) mDialog.findViewById(R.id.delete);

    titleText.setText(titleText.getText().toString() + " " + creator);
    messageText.setMovementMethod(ScrollingMovementMethod.getInstance());
    messageText.setText(comment);

    if (isMine) {
        deleteButton.setVisibility(View.VISIBLE);
        deleteButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new DeleteInBg(context, String.valueOf(id)).execute();
                mDialog.dismiss();
                // TODO Refrescar las alertas
            }
        });
    }

    closeButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            mDialog.dismiss();
        }
    });

    mDialog.show();

}

From source file:by.android.dailystatus.dialog.LicenseDialog.java

public Dialog onCreateDialog(Bundle savedInstanceState) {
    final FragmentActivity activity = getActivity();
    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.dialog_license);
    TextView description = (TextView) dialog.findViewById(R.id.txt_dialog_version_description);
    if (text != null && !TextUtils.isEmpty(text)) {
        description.setText(text);/*from ww w . j  a v a2s . com*/
    }

    dialog.findViewById(R.id.but_dialog_version_ok).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            dismiss();

        }
    });

    return dialog;
}

From source file:dk.tinytree.reader.Fragments.Others.OpenSourceLicenses.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.fragment_opensource_licenses);

    searchTitleIcon = (ImageView) dialog.findViewById(R.id.searchTitleProfile);
    searchTitleIcon.setImageResource(R.drawable.ic_material_security_black_24dp);
    searchTitleIcon.setColorFilter(ContextCompat.getColor(getContext(), R.color.redOrange));

    searchTitleName = (TextView) dialog.findViewById(R.id.searchTitleName);
    searchTitleName.setText(R.string.licenses_header_title);

    // Closes the Dialog
    Button dialogBtnCancel = (Button) dialog.findViewById(R.id.license_BtnCancel);
    dialogBtnCancel.setOnClickListener(new View.OnClickListener() {
        @Override//w  w  w  . java  2  s. c  o m
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();
    return dialog;
}

From source file:dk.tinytree.bulldog.Fragments.Other.OpenSourceLicenses.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.fragment_dialog_opensource_licenses);

    searchTitleIcon = (ImageView) dialog.findViewById(R.id.searchTitleProfile);
    searchTitleIcon.setImageResource(R.drawable.ic_material_security_black_24dp);
    searchTitleIcon.setColorFilter(ContextCompat.getColor(getContext(), R.color.redOrange));

    searchTitleName = (TextView) dialog.findViewById(R.id.searchTitleName);
    searchTitleName.setText(R.string.licenses_header_title);

    // Closes the Dialog
    Button dialogBtnCancel = (Button) dialog.findViewById(R.id.license_BtnCancel);
    dialogBtnCancel.setOnClickListener(new View.OnClickListener() {
        @Override//from   w ww  .  j a va2 s. c o  m
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();
    return dialog;
}

From source file:com.example.stefan.movies.Fragments.Others.OpenSourceLicenses.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.fragment_opensource_licenses);

    searchTitleIcon = (ImageView) dialog.findViewById(R.id.searchTitleProfile);
    searchTitleIcon.setImageResource(R.drawable.ic_security_black_24dp);
    searchTitleIcon.setColorFilter(ContextCompat.getColor(getContext(), R.color.redOrange));

    searchTitleName = (TextView) dialog.findViewById(R.id.searchTitleName);
    searchTitleName.setText(R.string.licenses_header_title);

    // Closes the Dialog
    Button dialogBtnCancel = (Button) dialog.findViewById(R.id.license_BtnCancel);
    dialogBtnCancel.setOnClickListener(new View.OnClickListener() {
        @Override//from   ww  w .  j  a  v a2s.c o  m
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();
    return dialog;
}

From source file:dk.tinytree.flashlight.fragments.others.OpenSourceLicenses.java

@NonNull
@Override// ww  w. j  ava2  s  .c  o  m
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.fragment_opensource_licenses);

    searchTitleIcon = (ImageView) dialog.findViewById(R.id.searchTitleProfile);
    searchTitleIcon.setImageResource(R.drawable.ic_material_security_black_24dp);
    searchTitleIcon.setColorFilter(ContextCompat.getColor(getContext(), R.color.redOrange));

    searchTitleName = (TextView) dialog.findViewById(R.id.searchTitleName);
    searchTitleName.setText(R.string.licenses_header_title);

    // Closes the Dialog
    Button dialogBtnCancel = (Button) dialog.findViewById(R.id.license_BtnCancel);
    dialogBtnCancel.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();
    return dialog;
}

From source file:com.pileproject.drive.setting.app.LegalNoticeFragment.java

@Override
@NonNull/*  ww  w  .j a va 2 s . c o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(getActivity());
    dialog.setTitle(R.string.setting_legalNotice);
    return dialog;
}

From source file:com.pileproject.drive.setting.app.CopyrightNoticeFragment.java

@Override
@NonNull/* ww w  . j  a va  2s .  c om*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(getActivity());
    dialog.setTitle(R.string.setting_copyrightNotice);
    return dialog;
}

From source file:com.amazon.appstream.fireclient.ErrorDialogFragment.java

/**
 * Standard initialization. Sets up the dialog to quit the
 * activity on clicking its only button.
 */// w w w.  java2s.c  o  m
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setCancelable(false);
    dialog.getWindow().setBackgroundDrawable(ConnectDialogFragment.mEmpty);
    dialog.setContentView(R.layout.fatal_error);

    final Button signin = (Button) dialog.findViewById(R.id.signin);
    final TextView message = (TextView) dialog.findViewById(R.id.message);

    message.setText(mMessage);

    signin.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();

            ((FireClientActivity) getActivity()).openConnectDialog(null);
        }
    });

    return dialog;
}