package de.apps4ics.mountainnavigation;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.ListAdapter;

/**
 * Created by Vinz on 12.03.2016.
 */
public class InformListDialog extends DialogFragment {
    private String title;
    private ListAdapter adapter;

    public InformListDialog(String title, ListAdapter adapter){
        this.title = title;
        this.adapter = adapter;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setTitle(title)
                .setAdapter(adapter, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        //nothing to do...
                    }
                })
                .setCancelable(false)
                //.setIcon(res.getDrawable(R.mipmap.ic_info_icon))
                .setPositiveButton(R.string.inform_positive_button, null);
        return builder.create();
    }
}
