Android Open Source - MATSOL-Android Rescalc Dialog






From Project

Back to project page MATSOL-Android.

License

The source code is released under:

GNU General Public License

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

/*****************************
You may use, distribute and copy MATSOL for Android under the terms of GNU
General Public License version 3, which is displayed below.
******************************//*from  w w  w. ja va  2s  .  c  o  m*/
package gidaibero.android.matsol;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Button;
import android.view.View;
import android.widget.ArrayAdapter;

public class RescalcDialog extends DialogFragment {

  int target;
  String message;
  TextView resValue;
  Spinner toleranceValue;
  Button algorithmPickerButton;
  View layout;
  
  public RescalcDialog(String message){
    this.message = message;
  } 
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    // Use the Builder class for convenient dialog construction
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setMessage(message);
    builder.setPositiveButton(R.string.matrix_picker_next,
        (DialogInterface.OnClickListener)(new dialogListener()));
    builder.setNegativeButton(R.string.cancel,
        (DialogInterface.OnClickListener)( new dialogListener()));
   

    // Get the layout inflater
    LayoutInflater inflater = getActivity().getLayoutInflater();
    // Inflate and set the layout for the dialog
    // Pass null as the parent view because its going in the dialog layout
    layout = inflater.inflate(R.layout.rescalc_dialog,null);
    
    Spinner spinner = (Spinner) layout.findViewById(R.id.tolerance_spinner);
    // Create an ArrayAdapter using the string array and a default spinner layout
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
                                        layout.getContext(),
                                        R.array.tolerance_values,
                                       android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    //         // Apply the adapter to the spinner
    spinner.setAdapter(adapter);


    builder.setView(layout);

    // Create the AlertDialog object and return it

    return builder.create();
  }

  private class dialogListener implements DialogInterface.OnClickListener{
    public void onClick(DialogInterface dialog, int id){
      
    }
  }
}




Java Source Code List

MatrixSolver.Determinant.java
MatrixSolver.ElementOutOfRangeException.java
MatrixSolver.ImpossibleSolutionException.java
MatrixSolver.LinearEquationSystem.java
MatrixSolver.MatrixSolverException.java
MatrixSolver.Matrix.java
MatrixSolver.TestMatrix.java
MatrixSolver.UnsquaredMatrixException.java
gidaibero.android.matsol.About.java
gidaibero.android.matsol.BaseConverterActivity.java
gidaibero.android.matsol.MainWindow.java
gidaibero.android.matsol.MatrixDimensionPicker.java
gidaibero.android.matsol.MatrixDisplayActivity.java
gidaibero.android.matsol.MatrixInputActivity.java
gidaibero.android.matsol.RescalcDialog.java