1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.epson.iprint.storage;
- import android.app.AlertDialog;
- import android.app.Dialog;
- import android.content.DialogInterface;
- import android.os.Bundle;
- import android.support.annotation.NonNull;
- import android.support.annotation.Nullable;
- import epson.print.R;
- public class OneButtonDialogFragment extends DialogFragment {
- private static final String PARAM_DIALOG_ID = "dialog_id";
- private static final String PARAM_MESSAGE_RESOURCE_ID = "message_id";
- /* access modifiers changed from: private */
- public String mDialogId;
- private int mMessageId;
- public interface DialogCallback {
- void buttonPressed(@Nullable String str);
- }
- public static OneButtonDialogFragment newInstance(int i, String str) {
- OneButtonDialogFragment oneButtonDialogFragment = new OneButtonDialogFragment();
- Bundle bundle = new Bundle();
- bundle.putInt(PARAM_MESSAGE_RESOURCE_ID, i);
- bundle.putSerializable(PARAM_DIALOG_ID, str);
- oneButtonDialogFragment.setArguments(bundle);
- return oneButtonDialogFragment;
- }
- public void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- Bundle arguments = getArguments();
- this.mMessageId = arguments.getInt(PARAM_MESSAGE_RESOURCE_ID);
- this.mDialogId = arguments.getString(PARAM_DIALOG_ID);
- setCancelable(false);
- }
- @NonNull
- public Dialog onCreateDialog(Bundle bundle) {
- super.onCreateDialog(bundle);
- return new AlertDialog.Builder(getActivity()).setMessage(this.mMessageId).setPositiveButton(R.string.str_ok, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- FragmentActivity activity = OneButtonDialogFragment.this.getActivity();
- if (activity != null) {
- ((DialogCallback) activity).buttonPressed(OneButtonDialogFragment.this.mDialogId);
- }
- }
- }).setCancelable(false).create();
- }
- }
|