Merge pull request #81 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/gg_login_change
//Stock_FacingActivity Changes today
This commit is contained in:
@@ -247,7 +247,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
View focusView = null;
|
View focusView = null;
|
||||||
|
|
||||||
// Check for a valid password, if the user entered one.
|
// Check for a valid password, if the user entered one.
|
||||||
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
|
if (TextUtils.isEmpty(password)) {
|
||||||
mPasswordView.setError(getString(R.string.error_invalid_password));
|
mPasswordView.setError(getString(R.string.error_invalid_password));
|
||||||
focusView = mPasswordView;
|
focusView = mPasswordView;
|
||||||
cancel = true;
|
cancel = true;
|
||||||
@@ -268,12 +268,14 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
// There was an error; don't attempt login and focus the first
|
// There was an error; don't attempt login and focus the first
|
||||||
// form field with an error.
|
// form field with an error.
|
||||||
focusView.requestFocus();
|
focusView.requestFocus();
|
||||||
|
} else if(isuseridValid(userid)){
|
||||||
|
Snackbar.make(museridView,getString(R.string.error_incorrect_username),Snackbar.LENGTH_SHORT).show();
|
||||||
|
}else if(isPasswordValid(password)){
|
||||||
|
Snackbar.make(museridView,getString(R.string.error_incorrect_password),Snackbar.LENGTH_SHORT).show();
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
// Show a progress spinner, and kick off a background task to
|
// Show a progress spinner, and kick off a background task to
|
||||||
// perform the user login attempt.
|
// perform the user login attempt.
|
||||||
//showProgress(true);
|
|
||||||
/* mAuthTask = new UserLoginTask(userid, password);
|
|
||||||
mAuthTask.execute((Void) null);*/
|
|
||||||
|
|
||||||
new AuthenticateTask().execute();
|
new AuthenticateTask().execute();
|
||||||
|
|
||||||
@@ -282,12 +284,29 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private boolean isuseridValid(String userid) {
|
private boolean isuseridValid(String userid) {
|
||||||
//TODO: Replace this with your own logic
|
//TODO: Replace this with your own logic
|
||||||
return userid.contains("@");
|
|
||||||
|
boolean flag =true;
|
||||||
|
|
||||||
|
String u_id = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||||
|
|
||||||
|
if(!u_id.equals("") && !userid.equals(u_id)){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPasswordValid(String password) {
|
private boolean isPasswordValid(String password) {
|
||||||
//TODO: Replace this with your own logic
|
//TODO: Replace this with your own logic
|
||||||
return password.length() > 4;
|
boolean flag =true;
|
||||||
|
|
||||||
|
String pw = preferences.getString(CommonString.KEY_PASSWORD, "");
|
||||||
|
|
||||||
|
if(!password.equals(pw)){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -190,8 +190,11 @@
|
|||||||
<!--Gagan end new code 2-->
|
<!--Gagan end new code 2-->
|
||||||
|
|
||||||
<string name="previous_data_upload">Lütfen Önceki Verileri Paylaşın</string>
|
<string name="previous_data_upload">Lütfen Önceki Verileri Paylaşın</string>
|
||||||
|
<string name="error_incorrect_username">Bu kullanıcı adı yanlış</string>
|
||||||
|
|
||||||
<string name="error">Hata! paylaşılıyor</string>
|
<string name="error">Hata! paylaşılıyor</string>
|
||||||
<string name="data_will_be_lost">Veri kaydedilmedi. İlerlemek</string>
|
<string name="data_will_be_lost">Veri kaydedilmedi. İlerlemek</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -228,5 +228,9 @@
|
|||||||
<string name="uploadeddata">Uploaded Data</string>
|
<string name="uploadeddata">Uploaded Data</string>
|
||||||
|
|
||||||
<string name="previous_data_upload">Please Upload Previous Data First</string>
|
<string name="previous_data_upload">Please Upload Previous Data First</string>
|
||||||
|
|
||||||
|
<string name="error_incorrect_username">This username is incorrect</string>
|
||||||
|
|
||||||
<string name="error">Error Uploading</string>
|
<string name="error">Error Uploading</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user