Android Open Source - Donnect Donnect






From Project

Back to project page Donnect.

License

The source code is released under:

Eclipse Public License - v 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECI...

If you think the Android project Donnect 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 com.example.donnect;
//from  w  w  w  .j  av  a2s  . co m

import org.cocos2dx.lib.Cocos2dxGLSurfaceView;

import android.support.v4.app.Fragment;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;


public class Donnect extends Activity {
  
  protected Cocos2dxGLSurfaceView _glSurfaceView;
  private DrawingView drawView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.fragment_donnect);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
     
      _glSurfaceView = new Cocos2dxGLSurfaceView(this);
   
      setContentView(_glSurfaceView);
    
    drawView = (DrawingView)findViewById(R.id.drawingView1);
    //drawView.setColor();
    
  }

  @Override
  public void onStart()
  {
      super.onStart();
   
      CCDirector.sharedDirector().attachInView(_glSurfaceView);
   
      CCDirector.sharedDirector().setDisplayFPS(true);
   
      CCDirector.sharedDirector().setAnimationInterval(1.0f / 60.0f);
  }
  
  @Override
  public void onPause()
  {
      super.onPause();
   
      CCDirector.sharedDirector().pause();
  }
   
  @Override
  public void onResume()
  {
      super.onResume();
   
      CCDirector.sharedDirector().resume();
  }
   
  @Override
  public void onStop()
  {
      super.onStop();
   
      CCDirector.sharedDirector().end();
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {

    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.donnect, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
      return true;
    }
    return super.onOptionsItemSelected(item);
  }

  /**
   * A placeholder fragment containing a simple view.
   */
  public static class PlaceholderFragment extends Fragment {

    public PlaceholderFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_donnect,
          container, false);
      return rootView;
    }
  }

}




Java Source Code List

com.example.donnect.Donnect.java
com.example.donnect.DrawingView.java