Android Open Source - MakeitRain Main Activity






From Project

Back to project page MakeitRain.

License

The source code is released under:

GNU General Public License

If you think the Android project MakeitRain 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.finlay.makeitrain;
// w  ww  .java  2  s. co  m
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends Activity {
  private static final String TAG = "MainActivity";
  
  private DollaSurface _drawingPanel;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
    setContentView(R.layout.activity_main);
    
    
    // Layout items
    _drawingPanel = (DollaSurface) findViewById(R.id.DollaBill);
    
    _drawingPanel.setOnTouchListener(new OnTouchListener() {

      @Override
      public boolean onTouch(View v, MotionEvent event) {
        Log.v(TAG, "onTouch");
        // TODO - types of event?
        _drawingPanel.sendTouchEvent();
        return false;
      }
      
    });
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
  }

}




Java Source Code List

com.finlay.makeitrain.DollaBill.java
com.finlay.makeitrain.DollaSurface.java
com.finlay.makeitrain.GameThread.java
com.finlay.makeitrain.MainActivity.java