Android Open Source - FlangeAssist Main Activity






From Project

Back to project page FlangeAssist.

License

The source code is released under:

MIT License

If you think the Android project FlangeAssist 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.atasoft.flangeassist;
/*w w  w .  j a  v  a 2  s. com*/

import android.annotation.*;
import android.app.*;
import android.content.*;
import android.os.*;
import android.view.*;
import android.view.View.*;
import android.widget.*;

@SuppressLint("NewApi")
public class MainActivity extends Activity implements OnClickListener {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    setupButtons();
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu items for use in the action bar
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main_actions, menu);
    return super.onCreateOptionsMenu(menu);
  }
  
  private void openSettings() {
    Intent intent = new Intent(this, PreferenceMenu.class);
      startActivity(intent);
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle presses on the action bar items
    switch (item.getItemId()) {
      case R.id.action_settings:
        openSettings();
        return true;
      default:
        return super.onOptionsItemSelected(item);
    }
  }
  
  @Override
    public void onClick(View v) {
    switch (v.getId()) {
      case R.id.main_toolButton:
        launchTools();
        break;
      case R.id.main_paychequeButton:
        launchPayCalc();
        break;
      case R.id.main_linkButton:
        launchLinks();
        break;
      case R.id.main_settingsButton:
        openSettings();
        break;
      case R.id.main_aboutButton:
        launchAbout();
        break;
    }
    }
  
  Button toolButton;
  Button paychequeButton;
  Button linkButton;
  Button settingsButton;
  Button aboutButton;
  Button[] buttonArr;
  private void setupButtons(){
    this.toolButton = (Button) findViewById(R.id.main_toolButton);
    this.paychequeButton = (Button) findViewById(R.id.main_paychequeButton);
    this.linkButton = (Button) findViewById(R.id.main_linkButton);
    this.settingsButton = (Button) findViewById(R.id.main_settingsButton);
    this.aboutButton = (Button) findViewById(R.id.main_aboutButton);
    this.buttonArr = new Button[]{toolButton, paychequeButton, linkButton, settingsButton, aboutButton};
    for(Button b: buttonArr){
      b.setOnClickListener(this);
    }
  }
    
  private void launchTools(){
    Intent intent = new Intent(this, ToolsActivity.class);
      startActivity(intent);
  }
  
  private void launchPayCalc(){
    Intent intent = new Intent(this, FragFramer.class);
    intent.putExtra("launch_frag", FragFramer.PAY_CALC);
      startActivity(intent);
  }
  
  private void launchLinks(){
    Intent intent = new Intent(this, FragFramer.class);
    intent.putExtra("launch_frag", FragFramer.HALL);
      startActivity(intent);
  }
  
  private void launchAbout(){
    Intent intent = new Intent(this, FragFramer.class);
    intent.putExtra("launch_frag", FragFramer.ABOUT);
      startActivity(intent);  
  }
  
}




Java Source Code List

com.atasoft.adapters.ExListAd.java
com.atasoft.adapters.ExpandableGroup.java
com.atasoft.adapters.TabsPagerAdapter.java
com.atasoft.flangeassist.FragFramer.java
com.atasoft.flangeassist.MainActivity.java
com.atasoft.flangeassist.PreferenceMenu.java
com.atasoft.flangeassist.ToolsActivity.java
com.atasoft.flangeassist.fragments.AboutFragment.java
com.atasoft.flangeassist.fragments.CashCounter.java
com.atasoft.flangeassist.fragments.FlangeFragment.java
com.atasoft.flangeassist.fragments.HallFragment.java
com.atasoft.flangeassist.fragments.NozzleCalc.java
com.atasoft.flangeassist.fragments.PaychequeFragment.java
com.atasoft.flangeassist.fragments.RigTrig.java
com.atasoft.flangeassist.fragments.ShapeCalcFrag.java
com.atasoft.flangeassist.fragments.TorqueFragment.java
com.atasoft.flangeassist.fragments.UnitConFragment.java
com.atasoft.flangeassist.fragments.WageCPIEstimate.java
com.atasoft.flangeassist.fragments.WeldingFrag.java
com.atasoft.helpers.AtaMathUtils.java
com.atasoft.helpers.AtaTimePicker.java
com.atasoft.helpers.ConvDataHold.java
com.atasoft.helpers.JsonPuller.java
com.atasoft.helpers.ShapeCalcHold.java
com.atasoft.helpers.TaxManager.java