@@ -46,9 +46,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
46
46
Bundle savedInstanceState ) {
47
47
// Inflate the layout for this fragment
48
48
View rootView = inflater .inflate (R .layout .fragment_forgot_password , container , false );
49
- email = rootView .findViewById (R .id .email_text_forgot_password );
50
- rollno = rootView .findViewById (R .id .roll_text_forgot_password );
51
- forgotPassword = rootView .findViewById (R .id .forgot_password_button );
49
+ email = rootView .findViewById (R .id .email_text_forgot_password );
50
+ rollno = rootView .findViewById (R .id .roll_text_forgot_password );
51
+ forgotPassword = rootView .findViewById (R .id .forgot_password_button );
52
52
return rootView ;
53
53
}
54
54
@@ -60,7 +60,14 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
60
60
forgotPassword .setOnClickListener (new View .OnClickListener () {
61
61
@ Override
62
62
public void onClick (View v ) {
63
- requestDatas ();
63
+ String email_text = email .getText ().toString ();
64
+ String rollno_text = rollno .getText ().toString ();
65
+ if (email_text .isEmpty () || rollno_text .isEmpty ())
66
+ Toast .makeText (getContext (), getResources ().getString (R .string .enter_all_fields ), Toast .LENGTH_LONG ).show ();
67
+ else if (Utils .isNetworkConnected (getContext ()))
68
+ requestDatas ();
69
+ else
70
+ Toast .makeText (getContext (), getString (R .string .no_internet ), Toast .LENGTH_LONG ).show ();
64
71
}
65
72
});
66
73
}
@@ -85,8 +92,8 @@ public void onResponse(String response) {
85
92
Toast .makeText (getContext (), getString (R .string .success_forgot_password_request ), Toast .LENGTH_LONG ).show ();
86
93
87
94
Intent intent = new Intent (getContext (), OtpActivity .class );
88
- intent .putExtra ("rollno" ,rollno .getText ().toString ());
89
- intent .putExtra ("forgot_password" ,"forgot_password" );
95
+ intent .putExtra ("rollno" , rollno .getText ().toString ());
96
+ intent .putExtra ("forgot_password" , "forgot_password" );
90
97
startActivity (intent );
91
98
} else {
92
99
Timber .d (getString (R .string .error_Forgot_password ));
0 commit comments