package com.Tricot.calcutator;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import androidx.appcompat.app.AppCompatActivity;

public class Calculator_option extends AppCompatActivity {
    RadioGroup radioGroup;
    RadioButton radiobtn_meter;
    RadioButton radiobtn_yard;
    Button option_btn;
    com.Tricot.calcutator.And_Application app;
    int Ym_swap=0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calculator_option);
        radioGroup=findViewById(R.id.option_radioG);
        radiobtn_meter=findViewById(R.id.option_radio_meter);
        radiobtn_yard=findViewById(R.id.option_radio_yard);
        option_btn=findViewById(R.id.option_Btn);
        app=(com.Tricot.calcutator.And_Application)getApplication();
        option_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (radioGroup.getCheckedRadioButtonId()){
                    case R.id.option_radio_meter:
                        app.setConversion_ym(com.Tricot.calcutator.And_Application.Meter);
                        break;
                    case R.id.option_radio_yard:
                        app.setConversion_ym(com.Tricot.calcutator.And_Application.Yard);
                        break;
                }
                finish();
            }
        });

    }



    public void backClick(View v){
        finish();
    }

}
