Android Open Source - StrTrainer_android Str Trainer






From Project

Back to project page StrTrainer_android.

License

The source code is released under:

GNU General Public License

If you think the Android project StrTrainer_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

/**
 */*from  w w  w. jav a2s .c o  m*/
 * StrTrainer /com/davefarinelli/strtrainer/StrTrainer.java
 *
 * Copyright (c) 2011 Dave Farinelli
 *
 * LICENSE:
 *
 * This file is part of StrTrainer, a companion Android app for the Starting Strength weight
 * training program (http://www.strtrainer.com).
 *
 * StrTrainer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
 * later version.
 *
 * StrTrainer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with StrTrainer.  If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * @author Dave Farinelli <dave[at]strtrainer[dot]com>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2011 Dave Farinelli
 */

package com.davefarinelli.strtrainer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class StrTrainer extends Activity implements OnClickListener {
  /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //Sets click listener for compute button
        Button buttonCompute = (Button)findViewById(R.id.b_compute);
        buttonCompute.setOnClickListener(this);
        
        //Sets click listener for records button
        Button buttonRecords = (Button)findViewById(R.id.b_records);
        buttonRecords.setOnClickListener(this);
        
        //Sets click listener for utilities button
        Button buttonUtilities = (Button)findViewById(R.id.b_utilities);
        buttonUtilities.setOnClickListener(this);
        
        //Sets click listener for settings button
        Button buttonSettings = (Button)findViewById(R.id.b_settings);
        buttonSettings.setOnClickListener(this);
    }

  @Override
  public void onClick(View arg0) {
    switch(arg0.getId()) {
      case R.id.b_compute:
        //Intent object to start Compute activity
          Intent intent2= new Intent(this, Compute.class);
          startActivity(intent2);
          
        break;
      case R.id.b_records:
        //Intent object to start Set Records activity
          Intent intent = new Intent(this, Records.class);
          startActivity(intent);
        
        break;
      case R.id.b_utilities:
        //Intent object to start Utilities activity
          Intent intent4 = new Intent(this, Utilities.class);
          startActivity(intent4);
        
        break;
      case R.id.b_settings:
        //Intent object to start Settings activity
          Intent intent3 = new Intent(this, AppSettings.class);
          startActivity(intent3);
        
        break;
    }
  }
  
  public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);
    return true;
  }
  
  public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
    case R.id.about:
      // sets up About class
      Intent aboutIntent = new Intent(this, About.class);
      startActivity(aboutIntent);
      
      break;
    default:
      return super.onOptionsItemSelected(item);
    }
    return true;
  }
}




Java Source Code List

com.davefarinelli.strtrainer.About.java
com.davefarinelli.strtrainer.AppSettings_InitializeWorkSetValues.java
com.davefarinelli.strtrainer.AppSettings_ModifyIncrementValues.java
com.davefarinelli.strtrainer.AppSettings.java
com.davefarinelli.strtrainer.ComputeTab.java
com.davefarinelli.strtrainer.Compute.java
com.davefarinelli.strtrainer.Records.java
com.davefarinelli.strtrainer.StrTrainer.java
com.davefarinelli.strtrainer.Utilities_Estimate1RM.java
com.davefarinelli.strtrainer.Utilities.java