Android Open Source - tennis-charting-android Main Activity






From Project

Back to project page tennis-charting-android.

License

The source code is released under:

GNU General Public License

If you think the Android project tennis-charting-android 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.inklily.tennischarting;
/**/*w  ww.j a  v a2  s .c o  m*/
 * TODO
 * ====
 *
 * 5. Match review screen
 *    b. Add point.
 *    c. Insert point
 *    d. Delete all matches
 * 9. Data model
 *    b. Test first serves
 * 10. Other
 *    b. Need better undo
 */

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity {

    private class LaunchActivityListener implements OnClickListener {
        private Class<? extends Activity> act;
        public LaunchActivityListener(Class<? extends Activity> activity) {
            this.act = activity;
        }

        @Override
        public void onClick(View v) {
            Intent it = new Intent(MainActivity.this, act);
            startActivity(it);
        }
    }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

        findViewById(R.id.btn_review_matches).setOnClickListener(new LaunchActivityListener(MatchReviewActivity.class));
    findViewById(R.id.btn_chart_new_match).setOnClickListener(new LaunchActivityListener(MatchInfoActivity.class));
        findViewById(R.id.btn_help).setOnClickListener(new LaunchActivityListener(HelpActivity.class));
        findViewById(R.id.btn_settings).setOnClickListener(new LaunchActivityListener(SettingsActivity.class));

        // Spin up the db to prevent delays
        SQLiteMatchStorage.getGlobalInstance(this.getApplication());
    }

    @Override
  protected void onStop() {
    super.onStop();
  }

  @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.inklily.tennischarting.HelpActivity.java
com.inklily.tennischarting.MainActivity.java
com.inklily.tennischarting.MatchChartActivity.java
com.inklily.tennischarting.MatchDetailActivity.java
com.inklily.tennischarting.MatchInfoActivity.java
com.inklily.tennischarting.MatchReviewActivity.java
com.inklily.tennischarting.MatchStorage.java
com.inklily.tennischarting.Match.java
com.inklily.tennischarting.PointEndDialog.java
com.inklily.tennischarting.Point.java
com.inklily.tennischarting.SQLiteMatchStorage.java
com.inklily.tennischarting.Score.java
com.inklily.tennischarting.SettingsActivity.java
com.inklily.tennischarting.util.SystemUiHiderBase.java
com.inklily.tennischarting.util.SystemUiHiderHoneycomb.java
com.inklily.tennischarting.util.SystemUiHider.java