package com.example.ugotthis;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private CardView cvLogin;
    private TextView txRegister;

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

        cvLogin = (CardView)findViewById(R.id.cardView);
        cvLogin.setOnClickListener(this);
        txRegister = (TextView) findViewById(R.id.textView_Register);
        txRegister.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){
            case R.id.textView_Register :{

                Intent registerActivity = new Intent(MainActivity.this, Register.class);
                startActivity(registerActivity);
                break;}
            case R.id.cardView :{

                Intent taskActivity = new Intent(MainActivity.this, Tasks.class);
                startActivity(taskActivity);
                break;}
            default:{
                break;
            }
        }
    }
}
