package com.kerbol.eeloo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.btnIncR).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                radius_ += 0.01;
                updateLabels();
            }
        });
        findViewById(R.id.btnDecR).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                radius_ -= 0.01;
                updateLabels();
            }
        });
        findViewById(R.id.btnIncTheta).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                theta_ += 0.01;
                updateLabels();
            }
        });
        findViewById(R.id.btnDecTheta).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                theta_ -= 0.01;
                updateLabels();
            }
        });
        findViewById(R.id.btnIncRho).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                rho_ += 0.01;
                updateLabels();
            }
        });
        findViewById(R.id.btnDecRho).setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                rho_ -= 0.01;
                updateLabels();
            }
        });
    }

    private void updateLabels()
    {
        ((TextView)findViewById(R.id.txtR)).setText("r : " + radius_);
        ((TextView)findViewById(R.id.txtTheta)).setText("theta : " + theta_);
        ((TextView)findViewById(R.id.txtRho)).setText("rho : " + rho_);
    }

    private double radius_ = 1;
    private double theta_ = 1;
    private double rho_ = 1;
}
