Closed Rimjhim28 closed 6 years ago
@Rimjhim28 Isn't this the wanted behaviour ? We're using saved data to create default avatar in code. I took it as a implementation of code to use user's favourite avatar look.
@geekanamika This is not the expected implementation. The avatar items should set to default values after each click on "NEW GAME" If we look into older version of app there was code snippet to do so in Avatar Activity onCreate():
eye=1;
skin=1;
hair=1;
cloth=1;
With the integration of FInal Avatar Screen during GCI a preference manager was implemented by the participant to check if the Avatar was previously customized to set the user's selected options otherwise to set to default values.
if (!hasPreviouslyCustomized) {
SharedPreferences.Editor edit = prefs.edit();
edit.putBoolean(getString(R.string.preferences_has_previously_customized), Boolean.TRUE);
edit.apply();
eye=1;
skin=1;
hair=1;
cloth=1;
} else {
eye=getmDbHandler().getAvatarEye();
skin=getmDbHandler().getAvatarSkin();
hair=getmDbHandler().getAvatarHair();
cloth=getmDbHandler().getAvatarCloth();
//Other to set the items on Avatar
}
The problem here is the if-else block never goes to settin to default values because PreferenceManager isn't working as expected. I intend to replace this PreferenceManager with a static variable in SessionHistory.java to check for previous customization.
@m-murad @saurabhjn76 please approve the issue.
please share the logs of the crash.
@m-murad Here's the crash log. This basically happens when the screen is switched of. Though I am not very sure if this happens beacause of this issue but it was not present before. May be a diffrerent issue can be created to handle the game when the screen goes off.
@m-murad Can I proceed with this issue. Should I create another one for crash?
@Rimjhim28 You can send a PR for this
ThankYou @m-murad!! Will be sending a PR soon.
Description
The avatar does not reset to default one with default options (hair, eyes, clothes) in avatar room. This eventually leads to app crash if the device's screen is turned off. There are errors in writing in database that needs to be handled properly.
Mocks
Acceptance Criteria
Update
Definition of Done
Estimation
2 hours
I would like to work on the issue