Skip to content

Commit b069b16

Browse files
somenath1435atm1504
authored andcommitted
fix: Few UI improvements (#222)
* UI fix in Change password * Improved login UI
1 parent d2c2237 commit b069b16

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

app/src/main/java/com/example/saar/ChangeCredentials/ChangePasswordFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
6969
if(getActivity().getIntent().hasExtra("rollno")){
7070
forgot_password=true;
7171
old_password.setText("Dummy");
72-
old_password.setVisibility(View.GONE);
72+
view.findViewById(R.id.oldPasswordInputLayout).setVisibility(View.GONE);
7373
rollno=getActivity().getIntent().getStringExtra("rollno");
7474
}
7575

app/src/main/java/com/example/saar/ChangeCredentials/ForgotPasswordFragment.java

+13-6
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
4646
Bundle savedInstanceState) {
4747
// Inflate the layout for this fragment
4848
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);
5252
return rootView;
5353
}
5454

@@ -60,7 +60,14 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
6060
forgotPassword.setOnClickListener(new View.OnClickListener() {
6161
@Override
6262
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();
6471
}
6572
});
6673
}
@@ -85,8 +92,8 @@ public void onResponse(String response) {
8592
Toast.makeText(getContext(), getString(R.string.success_forgot_password_request), Toast.LENGTH_LONG).show();
8693

8794
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");
9097
startActivity(intent);
9198
} else {
9299
Timber.d(getString(R.string.error_Forgot_password));

app/src/main/res/layout/fragment_login.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
android:layout_marginStart="@dimen/margin_big"
3131
android:layout_marginTop="@dimen/login_card_margin"
3232
android:layout_marginEnd="@dimen/margin_big"
33-
android:layout_marginBottom="@dimen/margin_50dp"
33+
android:layout_marginBottom="@dimen/margin_30dp"
3434
android:background="@color/white"
3535
app:cardCornerRadius="@dimen/card_login_radius"
3636
app:cardElevation="@dimen/card_login_elevation">
@@ -116,7 +116,8 @@
116116
android:padding="@dimen/padding_medium"
117117
android:text="@string/verify_email"
118118
android:textColor="@color/colorPrimary"
119-
android:textSize="@dimen/textsize_medium" />
119+
android:textSize="@dimen/textsize_medium"
120+
android:layout_marginBottom="@dimen/margin_medium"/>
120121

121122
<android.support.v7.widget.AppCompatTextView
122123
android:id="@+id/skip_login"
@@ -135,7 +136,7 @@
135136
android:layout_height="wrap_content"
136137
android:layout_below="@id/skip_login"
137138
android:layout_centerHorizontal="true"
138-
android:layout_marginTop="@dimen/margin_big"
139+
android:layout_marginTop="@dimen/margin_medium"
139140
android:layout_marginBottom="@dimen/margin_big"
140141
android:padding="@dimen/padding_medium"
141142
android:text="@string/forgot_password"

0 commit comments

Comments
 (0)