Delete Login_Screen.java

This commit is contained in:
Raman deep
2020-10-28 05:44:37 +00:00
parent 6aa0991b6f
commit 6da7db72f4

View File

@@ -1,70 +0,0 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatCheckBox;
import android.content.Intent;
import android.os.Bundle;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
public class Login_Screen extends AppCompatActivity {
private EditText Username;
private Button login;
private android.widget.EditText Password;
private AppCompatCheckBox checkbox;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login__screen);
Username=findViewById(R.id.username);
Password=findViewById(R.id.password);
login=findViewById(R.id.login);
checkbox = (AppCompatCheckBox) findViewById(R.id.showpassword);
Password = (EditText) findViewById(R.id.password);
checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (isChecked) {
// show password
Password.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
// hide password
Password.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
});
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String username = Username.getText().toString();
String password = Password.getText().toString();
if(username.length()==0 || password.length()==0)
{
Toast.makeText(Login_Screen.this, "Please Fill all the fields", Toast.LENGTH_SHORT).show();
}
else if (username.equals("Arresttb") && password.equals("tb123")) {
Intent intent = new Intent(Login_Screen.this, home.class);
startActivity(intent);
} else {
Toast.makeText(Login_Screen.this, "Invalid Credentials ", Toast.LENGTH_SHORT).show();
}
}
});
}
}