package com.epson.memcardacc;

import android.app.Dialog;
import android.os.Bundle;




import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


public class LocalProgressDialogFragment extends DialogFragment {
    private static final String ARGUMENT_MESSAGE_TEXT_ID = "resource-id";

    public static LocalProgressDialogFragment newInstance(int i) {
        LocalProgressDialogFragment localProgressDialogFragment = new LocalProgressDialogFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(ARGUMENT_MESSAGE_TEXT_ID, i);
        localProgressDialogFragment.setArguments(bundle);
        return localProgressDialogFragment;
    }

    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        setCancelable(false);
    }

    @NonNull
    public Dialog onCreateDialog(Bundle bundle) {
        int i;
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        View inflate = getActivity().getLayoutInflater().inflate(R.layout.dialog_local_prgress, (ViewGroup) null);
        builder.setView(inflate);
        Bundle arguments = getArguments();
        if (!(arguments == null || (i = arguments.getInt(ARGUMENT_MESSAGE_TEXT_ID, 0)) == 0)) {
            ((TextView) inflate.findViewById(R.id.messageText)).setText(i);
        }
        return builder.create();
    }
}
