Android Open Source - MathApp Activity Score






From Project

Back to project page MathApp.

License

The source code is released under:

MIT License

If you think the Android project MathApp 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 ie.lc.mathApp;
//  w ww  . j  a  va  2s. c o m
import ie.lc.R;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;





public class ActivityScore extends ActivityCommonMenu
{
  protected void onCreate( Bundle savedInstanceState ) {
    super.onCreate( savedInstanceState );
    setContentView( R.layout.activity_score );
    setupActions();
  }
  
  
  
  
  
  protected void onResume() {
    super.onResume();
    updateUI();
  }
  
  
  
  
  
  protected void menuResetScore() {
    super.menuResetScore();
    updateUI();
  }
  
  
  
  
  
  private void setupActions() {
    final Button      buttBack      = (Button)       findViewById( R.id.scoreButtBack      );
    final ToggleButton toggleUseless = (ToggleButton) findViewById( R.id.scoreToggleUseless );
    
    
    buttBack.setOnClickListener( new OnClickListener() {
      public void onClick( View v ) {
        finish();
      }
    });
    
    
    toggleUseless.setOnClickListener( new OnClickListener() {
      public void onClick( View v ) {
        if (toggleUseless.isChecked())
           showToastMessage( "Huh.  Didn't do anything..." );
        else showToastMessage( "Nope.  Not a thing!"     );
      }
    });
    }
  
  
  
  
  
  private void updateUI() {
    final TextView textRate     = (TextView) findViewById( R.id.scoreTextRate     );
    final TextView textFraction = (TextView) findViewById( R.id.scoreTextFraction );
    
    int percent = Score.getSuccessPercent();
    int good    = Score.getSuccesses();
    int total   = Score.getAttempts();
    
    textRate    .setText( "" + percent + "%" );
    textFraction.setText( "" + good + " / " + total );
    }
}




Java Source Code List

ie.lc.mathApp.ActivityArithmetic.java
ie.lc.mathApp.ActivityCommonMenu.java
ie.lc.mathApp.ActivityGameBase.java
ie.lc.mathApp.ActivityScore.java
ie.lc.mathApp.ActivitySqrt.java
ie.lc.mathApp.ActivityWave.java
ie.lc.mathApp.CallbackThread.java
ie.lc.mathApp.Callback.java
ie.lc.mathApp.Geo.java
ie.lc.mathApp.Operator.java
ie.lc.mathApp.ScoreData.java
ie.lc.mathApp.Score.java
ie.lc.mathApp.SeekBarAdapter.java
ie.lc.mathApp.Storage.java
ie.lc.mathApp.TextWatcherAdapter.java
ie.lc.mathApp.Util.java
ie.lc.mathApp.Wave.java