Skip to content

Commit d2c2237

Browse files
authored
Revert "fix: skip press issue in login page (#218)" (#220)
This reverts commit 88f8666.
1 parent a0279dc commit d2c2237

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

app/src/main/java/com/example/saar/Constant.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public class Constant {
4242
public static final String ACHIEVEMENTS = "achievements";
4343
public static final String IMG_URL = "img_url";
4444

45-
//Utilities
45+
//Notification service
4646
public static final String SUBSCRIBE_NOTIFICATION = "subscribe_notification";
47-
public static final String SKIP_LOGIN = "skip_login";
4847

4948
}

app/src/main/java/com/example/saar/Login_SignUp/LoginFragment.java

-11
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public class LoginFragment extends Fragment {
4646
Button loginButton;
4747
String email, password;
4848
SharedPreferences.Editor sharedPreferenceEditor;
49-
SharedPreferences preferences;
5049
ProgressDialog progressDialog;
5150

5251
@Override
@@ -61,7 +60,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
6160
skipLogin = rootView.findViewById(R.id.skip_login);
6261
loginButton = rootView.findViewById(R.id.login_button);
6362
sharedPreferenceEditor = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
64-
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
6563
return rootView;
6664
}
6765

@@ -71,13 +69,6 @@ public void onViewCreated(final View view, @Nullable Bundle savedInstanceState)
7169
//you can set the title for your toolbar here for different fragments different titles
7270
getActivity().setTitle(R.string.saar_login);
7371

74-
if (preferences.getBoolean(Constant.SKIP_LOGIN, false)) {
75-
Intent intent = new Intent(getActivity(), MainActivity.class);
76-
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
77-
startActivity(intent);
78-
getActivity().finish();
79-
}
80-
8172
verifyOTP.setOnClickListener(new View.OnClickListener() {
8273
@Override
8374
public void onClick(View v) {
@@ -96,8 +87,6 @@ public void onClick(View v) {
9687
skipLogin.setOnClickListener(new View.OnClickListener() {
9788
@Override
9889
public void onClick(View v) {
99-
sharedPreferenceEditor.putBoolean(Constant.SKIP_LOGIN, true);
100-
sharedPreferenceEditor.apply();
10190
Intent intent = new Intent(getActivity(), MainActivity.class);
10291
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
10392
startActivity(intent);

0 commit comments

Comments
 (0)