-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminPassword.java
95 lines (63 loc) · 3.43 KB
/
AdminPassword.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package com.application.qatarmotorsports;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;
public class AdminPassword extends AppCompatActivity {
Button nextbtn;
String adminnameget,adminPasswordget;
TextInputEditText adminnameTv,adminpass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.passwordvalidate);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if(Build.VERSION.SDK_INT >= 21) {
getWindow().setStatusBarColor(this.getResources().getColor(R.color.colorPrimary));
}
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
adminnameTv = (TextInputEditText) findViewById(R.id.adminNameTiv);
adminpass = findViewById(R.id.passwordTV);
nextbtn = findViewById(R.id.btnNextadmin);
nextbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adminnameget = adminnameTv.getText().toString();
adminPasswordget = adminpass.getText().toString();
if(adminnameget.equals("admin") && adminPasswordget.equals("qmmfadmin")){
Toast toast3 = Toast.makeText(getApplicationContext(), "Registrations Baja", Toast.LENGTH_SHORT);
toast3.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
toast3.show();
Intent intent6 = new Intent(AdminPassword.this, AdminBajaRegistrationsView.class);
AdminPassword.this.startActivity(intent6);
}else{
if(!adminnameget.equals("admin")&& adminPasswordget.equals("qmmfadmin")){
Toast toast3 = Toast.makeText(getApplicationContext(), "Incorrect Admin Name", Toast.LENGTH_SHORT);
toast3.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
toast3.show();
}
if(adminnameget.equals("admin")&& !adminPasswordget.equals("qmmfadmin")) {
Toast toast3 = Toast.makeText(getApplicationContext(), "Incorrect Password", Toast.LENGTH_SHORT);
toast3.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
toast3.show();
}
if(!adminnameget.equals("admin") && !adminPasswordget.equals("qmmfadmin")){
Toast toast3 = Toast.makeText(getApplicationContext(), "This forum is admin access only", Toast.LENGTH_SHORT);
toast3.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
toast3.show();
}
}
}
});
}
}