// Path: src/fr/xtof54/jsgo/EventManager.java
// enum eventType {loginStarted, loginEnd, downloadListStarted, downloadListEnd, downloadListGamesEnd, downloadGameStarted, downloadGameEnd, GameOK, moveSentStart, moveSentEnd, gobanReady,
// 	msgSendStart, msgSendEnd, ladderStart, ladderEnd, ladderChallengeStart, ladderChallengeEnd, showMessage, copyEidogoStart, copyEidogoEnd};
// 
// Path: src/fr/xtof54/jsgo/GoJsActivity.java
// enum guistate {nogame, play, markDeadStones, checkScore, message, review, forums};


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.ArrayList;
import fr.xtof54.jsgo.R;
import fr.xtof54.jsgo.EventManager.eventType;
import fr.xtof54.jsgo.GoJsActivity.guistate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
		class DetListDialogFragment extends DialogFragment {
			@Override
			public Dialog onCreateDialog(Bundle savedInstanceState) {
				final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
				// Get the layout inflater
				LayoutInflater inflater = getActivity().getLayoutInflater();
				// sgfs should never be empty, because this list can only be displayed *after* contReview()
				ArrayAdapter<String> adapter = new ArrayAdapter<String>(GoJsActivity.main, R.layout.detlistitem, sgfs);
				// Inflate and set the layout for the dialog
				// Pass null as the parent view because it's going in the dialog layout
				View listFrameview = inflater.inflate(R.layout.ladder, null);
				{
					TextView ladderlab = (TextView)listFrameview.findViewById(R.id.ladderlab);
					String s = "Choose the file to review:";
					ladderlab.setText(s);
				}
				final ListView ladder = (ListView)listFrameview.findViewById(R.id.ladderList);
				ladder.setAdapter(adapter);
				ladder.setOnItemClickListener(new OnItemClickListener() {
					@Override
					public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) {
						tmpchosen = position;
					}
				});
				builder.setView(listFrameview);

				builder.setPositiveButton("Review", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {
						DetListDialogFragment.this.getDialog().dismiss();
						if (tmpchosen<0) {
// Path: src/fr/xtof54/jsgo/EventManager.java
// enum eventType {loginStarted, loginEnd, downloadListStarted, downloadListEnd, downloadListGamesEnd, downloadGameStarted, downloadGameEnd, GameOK, moveSentStart, moveSentEnd, gobanReady,
// 	msgSendStart, msgSendEnd, ladderStart, ladderEnd, ladderChallengeStart, ladderChallengeEnd, showMessage, copyEidogoStart, copyEidogoEnd};
// 
// Path: src/fr/xtof54/jsgo/GoJsActivity.java
// enum guistate {nogame, play, markDeadStones, checkScore, message, review, forums};


// Path: src/fr/xtof54/jsgo/Reviews.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.ArrayList;
import fr.xtof54.jsgo.R;
import fr.xtof54.jsgo.EventManager.eventType;
import fr.xtof54.jsgo.GoJsActivity.guistate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

		class DetListDialogFragment extends DialogFragment {
			@Override
			public Dialog onCreateDialog(Bundle savedInstanceState) {
				final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
				// Get the layout inflater
				LayoutInflater inflater = getActivity().getLayoutInflater();
				// sgfs should never be empty, because this list can only be displayed *after* contReview()
				ArrayAdapter<String> adapter = new ArrayAdapter<String>(GoJsActivity.main, R.layout.detlistitem, sgfs);
				// Inflate and set the layout for the dialog
				// Pass null as the parent view because it's going in the dialog layout
				View listFrameview = inflater.inflate(R.layout.ladder, null);
				{
					TextView ladderlab = (TextView)listFrameview.findViewById(R.id.ladderlab);
					String s = "Choose the file to review:";
					ladderlab.setText(s);
				}
				final ListView ladder = (ListView)listFrameview.findViewById(R.id.ladderList);
				ladder.setAdapter(adapter);
				ladder.setOnItemClickListener(new OnItemClickListener() {
					@Override
					public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) {
						tmpchosen = position;
					}
				});
				builder.setView(listFrameview);

				builder.setPositiveButton("Review", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {
						DetListDialogFragment.this.getDialog().dismiss();
						if (tmpchosen<0) {
							EventManager.getEventManager().sendEvent(eventType.showMessage, "No sgf selected");