Commit 8dbc84fc by Kunj

UOFLMA-130: Fixed - Please make email field as pre-filled in all forms.

parent 2fa384a9
......@@ -40,6 +40,7 @@ public class CatalogueApplication extends Application {
PrefManager.setSharedPref(CatalogueApplication.this, PrefManager.PREFERENCE_FIRST_NAME, "");
PrefManager.setSharedPref(CatalogueApplication.this, PrefManager.PREFERENCE_USER_ID, "");
PrefManager.setSharedPref(CatalogueApplication.this, PrefManager.PREFERENCE_USER_FULL_NAME, "");
PrefManager.setSharedPref(CatalogueApplication.this, PrefManager.PREFERENCE_USER_EMAIL_ID, "");
Intent loginIntent = new Intent(CatalogueApplication.this, LoginScreen.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(loginIntent);
......
......@@ -28,6 +28,10 @@ public class UserApiValues {
@Expose
private String userId;
@SerializedName("email")
@Expose
private String userEmailId;
public String getFirstName() {
return firstName;
}
......@@ -67,4 +71,12 @@ public class UserApiValues {
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserEmailId() {
return userEmailId;
}
public void setUserEmailId(String userEmailId) {
this.userEmailId = userEmailId;
}
}
......@@ -409,6 +409,9 @@ public class CatalogueVariableScreen extends AppCompatActivity {
} else if(catalogueVariable.getName().equals(getString(R.string.catalogue_user_id))) {
String userId = PrefManager.getSharedPref(CatalogueVariableScreen.this, PrefManager.PREFERENCE_USER_ID);
((EditText)controlView).setText(userId);
} else if(catalogueVariable.getName().equals(getString(R.string.catalogue_user_email_id))) {
String emailId = PrefManager.getSharedPref(CatalogueVariableScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID);
((EditText)controlView).setText(emailId);
}
if (viewType == ViewType.DATE) {
controlView.setOnClickListener(dateListener);
......
......@@ -75,6 +75,7 @@ public class HomeScreen extends AppCompatActivity {
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_FIRST_NAME, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_ID, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_FULL_NAME, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, "");
Intent loginIntent = new Intent(HomeScreen.this, LoginScreen.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(loginIntent);
......
......@@ -184,6 +184,7 @@ public class LoginScreen extends Activity {
String userFullName = mUserDetails.get(0).getFullName();
String userId = mUserDetails.get(0).getUserId();
String userEmailId = mUserDetails.get(0).getUserEmailId();
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_FIRST_NAME, firstName);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_LAST_NAME, lastName);
......@@ -191,6 +192,7 @@ public class LoginScreen extends Activity {
/*For prefill value in variable form*/
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_USER_FULL_NAME, userFullName);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_USER_ID, userId);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, userEmailId);
startActivity(new Intent(LoginScreen.this, HomeScreen.class));
finish();
......
......@@ -15,6 +15,7 @@ public class PrefManager {
public static final String PREFERENCE_SYS_ID = "sysId";
public static final String PREFERENCE_USER_FULL_NAME = "full_name";
public static final String PREFERENCE_USER_ID = "user_id";
public static final String PREFERENCE_USER_EMAIL_ID = "user_email_id";
/*Access Token */
public static final String PREFERENCE_LOGIN_VALUES_KEY = "LoginPrefs";
......
......@@ -99,6 +99,7 @@
<!--Catalogue Variable form screen - key for pre fill value-->
<string name="catalogue_user_full_name">full_name</string>
<string name="catalogue_user_id">user_id</string>
<string name="catalogue_user_email_id">email_address</string>
<!--Home Screen-->
<string name="home_screen_logout_confirmation_msg_string">Are you sure you want to logout?</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment