Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9216 from JosJuice/android-load-time
Android: Don't reset savestate time on load
  • Loading branch information
leoetlino committed Nov 2, 2020
2 parents c3bc079 + f6ef6a3 commit 060040e
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -104,11 +104,16 @@ public void onClick(View view)
int action = (mSaveOrLoad == SaveOrLoad.SAVE ? saveActionsMap : loadActionsMap)[buttonIndex];
((EmulationActivity) getActivity()).handleMenuAction(action);

// The savestate most likely hasn't gotten saved yet (it happens asynchronously),
// so we unfortunately can't rely on setButtonText/GetUnixTimeOfStateSlot here.
Button button = (Button) view;
CharSequence time = DateUtils.getRelativeTimeSpanString(0, 0, DateUtils.MINUTE_IN_MILLIS);
button.setText(getString(R.string.emulation_state_slot, buttonIndex + 1, time));
if (mSaveOrLoad == SaveOrLoad.SAVE)
{
// Update the "last modified" time.
// The savestate most likely hasn't gotten saved to disk yet (it happens asynchronously),
// so we unfortunately can't rely on setButtonText/GetUnixTimeOfStateSlot here.

Button button = (Button) view;
CharSequence time = DateUtils.getRelativeTimeSpanString(0, 0, DateUtils.MINUTE_IN_MILLIS);
button.setText(getString(R.string.emulation_state_slot, buttonIndex + 1, time));
}
}

private void setButtonText(Button button, int index)
Expand Down

0 comments on commit 060040e

Please sign in to comment.