Open rwdohm83 opened 3 months ago
I created a class called GlobalVars that will hold all of our Global data.
public class GlobalVars extends Application { int userID = -1; String username = ""; String password = "";
private static final GlobalVars ourInstance = new GlobalVars();
public static GlobalVars getInstance() {
return ourInstance;
}
public void setUserID(int id){ this.userID = id; }
public int getUserID(){ return userID; }
public void setUsername(String username){ this.username = username; }
public String getUsername(){ return username; }
public void setPassword(String password){ this.password = password; }
public String getPassword(){ return password; }
}
You can get an instance of it anywhere in the app by using: com.example.happeningsapp.GlobalVars gVars = com.example.happeningsapp.GlobalVars.getInstance();
set email and password, need way to get account id.
I set it from the login page to take place when the user logs in.
I pulled your branch and edited one thing so that it saves the accountID in GlobalVars. Landin updated the endpoint to return the accountID if the login in successful. It was a small fix, but works great. Pushed to front end.
I am keeping this issue open so people may log what variables they add to GlobalVars.
I added a timeWindow (hours) here. This is used to set the times within which we want events to be shown on the map. I think the ability to change the time window could be on a separate page so I added it here.
Beginning work on this.