package com.example.ghomi.chapter2_4;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.graphics.Color;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
        public void onSubmitClick(View V) {
               TextView loginText = (TextView) findViewById(R.id.textView);
               EditText userName = (EditText) findViewById(R.id.editText);
               EditText password = (EditText) findViewById(R.id.editText2);
               loginText.setText(password.getText());
               loginText.setTextColor(Color.BLUE);
               if (userName.getText().toString().equals("ghomi") && (password.getText().toString().equals("rayaneh")))
                   loginText.setText("You'r right");

              else
                  loginText.setText("You'r wrong");
          }
}
