package com.example.menu;

import java.text.DecimalFormat;
import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.NumberPicker;

public class EditActivity extends BaseMenuActivity implements OnClickListener {
	private NumberPicker poidsPicker,taillePicker;
	private ImageView iconeIMC;
	private TextView commentIMC;
	

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_navigation);
        poidsPicker = (NumberPicker) findViewById(R.id.np_poidsPicker);
        poidsPicker.setMaxValue(200);     
        poidsPicker.setMinValue(1);         
        poidsPicker.setWrapSelectorWheel(true);
        taillePicker = (NumberPicker) findViewById(R.id.np_taillePicker);
        taillePicker.setMaxValue(200);     
        taillePicker.setMinValue(1);         
        taillePicker.setWrapSelectorWheel(true);
        iconeIMC=(ImageView) findViewById(R.id.iv_iconeIMC);
        Button btnValide=(Button)findViewById(R.id.bt_valid);
        commentIMC =(TextView)findViewById(R.id.tv_commentIMC);
        btnValide.setOnClickListener(this);
  
    }





	@Override
	public void onClick(View v) {
		EditText nomEditText=(EditText)findViewById(R.id.et_nom);
		String nom=nomEditText.getText().toString();
		EditText prenomEditText=(EditText)findViewById(R.id.et_prenom);
		String prenom=prenomEditText.getText().toString();
		int poids=poidsPicker.getValue();
		int taille=taillePicker.getValue();
		AttributsPhysiques attr=new AttributsPhysiques(poids,taille);
		Individu pers=new Individu(nom,prenom);
		pers.setAttributs(attr);
		ArrayList<Individu> liste=ApplicationDataShare.getInstance().getListeIndividu();
		liste.add(pers);
			
		
	}
	




    
}
