package com.example.evan.hophacks2015;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;


public class MainActivity extends ActionBarActivity implements View.OnTouchListener{

    //global variables up here

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //program in here

        setContentView(R.layout.activity_main);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new PlaceholderFragment())
                    .commit();
        }
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, 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();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        return false;
    }

    /**
     * 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_main, container, false);
            return rootView;
        }
    }

    //drawing things
    public class ViewingScreen extends View {

        public ViewingScreen(Context context) {
            super(context);
        }

        protected void onDraw(Canvas g) {
            Paint paint = new Paint();
            g.drawText("Hello world", 45, 45, paint);
        }
    }
}

@@ -97,16 +97,47 @@
 Canvas;%0A
+import android.graphics.Color;%0A
 import a
@@ -155,24 +155,24 @@
 hics.Paint;%0A
-
 import andro
@@ -636,24 +636,57 @@
 bles up here
+%0A    ViewingScreen viewingScreen;
 %0A%0A    @Overr
@@ -818,16 +818,105 @@
 n here%0A%0A
+        viewingScreen = new ViewingScreen(this);%0A        setContentView(viewingScreen);%0A%0A
         
@@ -1151,24 +1151,24 @@
  .commit();%0A
-
         %7D%0A  
@@ -1156,32 +1156,81 @@
 mit();%0A        %7D
+%0A%0A        viewingScreen.setOnTouchListener(this);
 %0A    %7D%0A%0A%0A    @Ov
@@ -2761,24 +2761,65 @@
 ew Paint();%0A
+            paint.setColor(Color.BLACK);%0A
             

Add viewingScreen to Main