Android Open Source - DragonGoApp G U I






From Project

Back to project page DragonGoApp.

License

The source code is released under:

GNU General Public License

If you think the Android project DragonGoApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fr.xtof54.jsgo;
/*from w  w w . j a va 2 s  .  co m*/
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import fr.xtof54.dragonGoApp.R;

public class GUI {
  private GUI() {}
  private static GUI gui = new GUI();
    private static WaitDialogFragment waitdialog;
    private static boolean isWaitingDialogShown = false;

  public static GUI getGUI() {
    return gui;
  }

  //  public void showMain() {
  //    GoJsActivity.main.setContentView(R.layout.activity_main);
  //  }

  public void showHome() {
    GoJsActivity.main.initGUI();
  }
  
  public static synchronized void hideWaitingWin() {
      if (isWaitingDialogShown) {
          waitdialog.dismiss();
          isWaitingDialogShown=false;
      }
  }
  public static synchronized void showWaitingWin() {
        try {
            if (!isWaitingDialogShown) {
                waitdialog = new WaitDialogFragment();
                waitdialog.show(GoJsActivity.main.getSupportFragmentManager(),"waiting");
                isWaitingDialogShown=true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
  }

    private static class WaitDialogFragment extends DialogFragment {
        @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            // Get the layout inflater
            LayoutInflater inflater = getActivity().getLayoutInflater();

            // Inflate and set the layout for the dialog
            // Pass null as the parent view because its going in the dialog layout
            builder.setView(inflater.inflate(R.layout.waiting, null))
            // Add action buttons
            .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    WaitDialogFragment.this.getDialog().cancel();
                    // TODO stop thread
                }
            });
            return builder.create();
        }
    }
}




Java Source Code List

fr.xtof54.jsgo.AndroidServerConnection.java
fr.xtof54.jsgo.EventManager.java
fr.xtof54.jsgo.Forums.java
fr.xtof54.jsgo.GUI.java
fr.xtof54.jsgo.Game.java
fr.xtof54.jsgo.GoJsActivity.java
fr.xtof54.jsgo.Ladder.java
fr.xtof54.jsgo.Message.java
fr.xtof54.jsgo.PrefUtils.java
fr.xtof54.jsgo.Reviews.java
fr.xtof54.jsgo.ServerConnection.java
fr.xtof54.jsgo.WebAppInterface.java
org.json.CDL.java
org.json.CookieList.java
org.json.Cookie.java
org.json.HTTPTokener.java
org.json.HTTP.java
org.json.JSONArray.java
org.json.JSONException.java
org.json.JSONML.java
org.json.JSONObject.java
org.json.JSONString.java
org.json.JSONStringer.java
org.json.JSONTokener.java
org.json.JSONWriter.java
org.json.Kim.java
org.json.Property.java
org.json.XMLTokener.java
org.json.XML.java