// Path: project/src/main/java/com/idunnolol/sotm/data/Difficulty.java
// public enum Difficulty {
// 
//     RANDOM(-1, R.string.difficulty_random),
//     EASY(90, R.string.difficulty_easy),
//     MEDIUM(75, R.string.difficulty_medium),
//     HARD(50, R.string.difficulty_hard),
//     VERY_HARD(30, R.string.difficulty_very_hard),
//     GOOD_LUCK(15, R.string.difficulty_good_luck),
//     PICK_YOUR_OWN(-1, R.string.difficulty_specify);
// 
//     private int mTargetWinPercent;
//     private int mStrResId;
// 
//     private Difficulty(int targetWinPercent, int strResId) {
//         mTargetWinPercent = targetWinPercent;
//         mStrResId = strResId;
//     }
// 
//     public int getTargetWinPercent() {
//         return mTargetWinPercent;
//     }
// 
//     public int getStrResId() {
//         return mStrResId;
//     }
// }
// 
// Path: project/src/main/java/com/idunnolol/sotm/widget/DifficultyAdapter.java
// public class DifficultyAdapter extends BaseAdapter {
// 
//     private Context mContext;
// 
//     public DifficultyAdapter(Context context) {
//         mContext = context;
//     }
// 
//     @Override
//     public int getCount() {
//         return Difficulty.values().length;
//     }
// 
//     @Override
//     public Difficulty getItem(int position) {
//         return Difficulty.values()[position];
//     }
// 
//     @Override
//     public long getItemId(int position) {
//         return position;
//     }
// 
//     @Override
//     public View getView(int position, View convertView, ViewGroup parent) {
//         if (convertView == null) {
//             convertView = LayoutInflater.from(mContext).inflate(R.layout.row_dialog, parent, false);
//         }
// 
//         TextView textView = (TextView) convertView;
//         Difficulty difficulty = getItem(position);
// 
//         CharSequence text;
//         if (difficulty.getTargetWinPercent() == -1) {
//             text = mContext.getString(difficulty.getStrResId());
//         }
//         else {
//             text = mContext.getString(R.string.template_win_rate, mContext.getString(difficulty.getStrResId()),
//                 difficulty.getTargetWinPercent());
//         }
//         textView.setText(text);
// 
//         return convertView;
//     }
// 
// }


import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import com.idunnolol.sotm.R;
import com.idunnolol.sotm.data.Difficulty;
import com.idunnolol.sotm.widget.DifficultyAdapter;
package com.idunnolol.sotm.fragment;


public class DifficultyDialogFragment extends DialogFragment {

    public static final String TAG = DifficultyDialogFragment.class.getName();

    private DifficultyDialogFragmentListener mListener;

    private DifficultyAdapter mAdapter;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        mListener = (DifficultyDialogFragmentListener) activity;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        mAdapter = new DifficultyAdapter(getActivity());

        return new AlertDialog.Builder(getActivity())
            .setTitle(R.string.title_difficulty)
            .setSingleChoiceItems(mAdapter, 0, new OnClickListener() {
// Path: project/src/main/java/com/idunnolol/sotm/data/Difficulty.java
// public enum Difficulty {
// 
//     RANDOM(-1, R.string.difficulty_random),
//     EASY(90, R.string.difficulty_easy),
//     MEDIUM(75, R.string.difficulty_medium),
//     HARD(50, R.string.difficulty_hard),
//     VERY_HARD(30, R.string.difficulty_very_hard),
//     GOOD_LUCK(15, R.string.difficulty_good_luck),
//     PICK_YOUR_OWN(-1, R.string.difficulty_specify);
// 
//     private int mTargetWinPercent;
//     private int mStrResId;
// 
//     private Difficulty(int targetWinPercent, int strResId) {
//         mTargetWinPercent = targetWinPercent;
//         mStrResId = strResId;
//     }
// 
//     public int getTargetWinPercent() {
//         return mTargetWinPercent;
//     }
// 
//     public int getStrResId() {
//         return mStrResId;
//     }
// }
// 
// Path: project/src/main/java/com/idunnolol/sotm/widget/DifficultyAdapter.java
// public class DifficultyAdapter extends BaseAdapter {
// 
//     private Context mContext;
// 
//     public DifficultyAdapter(Context context) {
//         mContext = context;
//     }
// 
//     @Override
//     public int getCount() {
//         return Difficulty.values().length;
//     }
// 
//     @Override
//     public Difficulty getItem(int position) {
//         return Difficulty.values()[position];
//     }
// 
//     @Override
//     public long getItemId(int position) {
//         return position;
//     }
// 
//     @Override
//     public View getView(int position, View convertView, ViewGroup parent) {
//         if (convertView == null) {
//             convertView = LayoutInflater.from(mContext).inflate(R.layout.row_dialog, parent, false);
//         }
// 
//         TextView textView = (TextView) convertView;
//         Difficulty difficulty = getItem(position);
// 
//         CharSequence text;
//         if (difficulty.getTargetWinPercent() == -1) {
//             text = mContext.getString(difficulty.getStrResId());
//         }
//         else {
//             text = mContext.getString(R.string.template_win_rate, mContext.getString(difficulty.getStrResId()),
//                 difficulty.getTargetWinPercent());
//         }
//         textView.setText(text);
// 
//         return convertView;
//     }
// 
// }


// Path: project/src/main/java/com/idunnolol/sotm/fragment/DifficultyDialogFragment.java
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import com.idunnolol.sotm.R;
import com.idunnolol.sotm.data.Difficulty;
import com.idunnolol.sotm.widget.DifficultyAdapter;

package com.idunnolol.sotm.fragment;


public class DifficultyDialogFragment extends DialogFragment {

    public static final String TAG = DifficultyDialogFragment.class.getName();

    private DifficultyDialogFragmentListener mListener;

    private DifficultyAdapter mAdapter;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        mListener = (DifficultyDialogFragmentListener) activity;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        mAdapter = new DifficultyAdapter(getActivity());

        return new AlertDialog.Builder(getActivity())
            .setTitle(R.string.title_difficulty)
            .setSingleChoiceItems(mAdapter, 0, new OnClickListener() {
                @Override