Android Open Source - StoichiometryForDummies Reagent Fragment






From Project

Back to project page StoichiometryForDummies.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project StoichiometryForDummies 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.noahl98.perGProject;
/*w  ww . j  av a 2s.  c  om*/
import android.R.anim;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;

public class ReagentFragment extends FragmentActivity{

  TextView title; 
  
  RadioButton radio1;
  RadioButton radio2;
  RadioButton radio3;
  RadioButton radio4;

    //page for Limiting Reagents
  @Override
  public void onCreate(Bundle arg0){
    super.onCreate(arg0);
    setContentView(R.layout.reagent_fragment_layout);

    //Overrides incoming transition
    overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);
    
    //gets title
    title=(TextView)findViewById(R.id.reagent_title);
    //changes font
    title.setTypeface(LauncherMenu.coolvetica);
    
    //gets radio buttons
    radio1 = (RadioButton)findViewById(R.id.radio1);
    radio2 = (RadioButton)findViewById(R.id.radio2);
    radio3 = (RadioButton)findViewById(R.id.radio3);
    radio4 = (RadioButton)findViewById(R.id.radio4);
  }
  
  public void checkRadio(View v){
        //gets the radio button that was clicked
    RadioButton bttn = (RadioButton) v;

        //checks to see if the correct button is checked
    if(!bttn.getText().toString().equals("Cu")){
      Toast.makeText(getApplicationContext(), "Correct!", Toast.LENGTH_LONG).show();
    }else {
      Toast.makeText(getApplicationContext(), "Try Again", Toast.LENGTH_LONG).show();
    }
  }
  
  @Override
  public void onPause(){
    super.onPause();
        //changes the animation for when the user navigates away from the page
    overridePendingTransition(anim.slide_in_left, anim.slide_out_right);
  }
}




Java Source Code List

com.noahl98.perGProject.BalancingFragment.java
com.noahl98.perGProject.BuildConfig.java
com.noahl98.perGProject.FontAdapter.java
com.noahl98.perGProject.IntroFragment.java
com.noahl98.perGProject.LauncherMenu.java
com.noahl98.perGProject.LinksFragment.java
com.noahl98.perGProject.MainMenuActivity.java
com.noahl98.perGProject.MoleFragment.java
com.noahl98.perGProject.RatioFragment.java
com.noahl98.perGProject.ReagentFragment.java
com.noahl98.perGProject.SignificantFragment.java
com.noahl98.perGProject.YieldFragment.java