package com.rhinemann.project;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class MBTIResult extends AppCompatActivity {

    TextView Result, Explanation;
    String ResultText;

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

        Result = findViewById(R.id.Result);
        Explanation = findViewById(R.id.Explanation);

        ResultText = getIntent().getStringExtra("Result");

        Result.setText(ResultText);

        switch (ResultText){
            case "ESTG":
                Explanation.setText(R.string.ESTJ);
                break;
            case "ISTJ":
                Explanation.setText(R.string.ISTJ);
                break;
            case "ESTP":
                Explanation.setText(R.string.ESTP);
                break;
            case "ISTP":
                Explanation.setText(R.string.ISTP);
                break;
            case "ENTJ":
                Explanation.setText(R.string.ENTJ);
                break;
            case "INTJ":
                Explanation.setText(R.string.INTJ);
                break;
            case "ENTP":
                Explanation.setText(R.string.ENTP);
                break;
            case "INTP":
                Explanation.setText(R.string.INTP);
                break;
            case "ESFJ":
                Explanation.setText(R.string.ESFJ);
                break;
            case "ISFJ":
                Explanation.setText(R.string.ISFJ);
                break;
            case "ESFP":
                Explanation.setText(R.string.ESFP);
                break;
            case "ISFP":
                Explanation.setText(R.string.ISFP);
                break;
            case "ENFJ":
                Explanation.setText(R.string.ENFJ);
                break;
            case "INFJ":
                Explanation.setText(R.string.INFJ);
                break;
            case "ENFP":
                Explanation.setText(R.string.ENFP);
                break;
            case "INFP":
                Explanation.setText(R.string.INFP);
                break;
        }

        Button Home = findViewById(R.id.home);

        Home.setOnClickListener(v -> {
            Intent intent = new Intent(MBTIResult.this, HomeScreen.class);
            startActivity(intent);
        });
    }
}