package com.example.download;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class FailureDialogFragment2 extends DialogFragment {
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        LayoutInflater inflator = getActivity().getLayoutInflater();
        View layout = inflator.inflate(R.layout.custom_dialog, null);
        ImageView image = (ImageView) layout
                .findViewById(R.id.dialogImage);
        image.setImageResource(R.drawable.error);
        TextView text = (TextView) layout
                .findViewById(R.id.dialogText);
        text.setText(R.string.downloadFail);
        AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
        b.setView(layout);
        b.setNeutralButton(android.R.string.ok, null);
        return b.create();
    }
}