Android: Don't reset savestate time on load

This commit is contained in:
JosJuice 2020-11-02 10:47:39 +01:00
parent c3bc079c81
commit f6ef6a317d
1 changed files with 10 additions and 5 deletions

View File

@ -104,11 +104,16 @@ public final class SaveLoadStateFragment extends Fragment implements View.OnClic
int action = (mSaveOrLoad == SaveOrLoad.SAVE ? saveActionsMap : loadActionsMap)[buttonIndex]; int action = (mSaveOrLoad == SaveOrLoad.SAVE ? saveActionsMap : loadActionsMap)[buttonIndex];
((EmulationActivity) getActivity()).handleMenuAction(action); ((EmulationActivity) getActivity()).handleMenuAction(action);
// The savestate most likely hasn't gotten saved yet (it happens asynchronously), if (mSaveOrLoad == SaveOrLoad.SAVE)
// so we unfortunately can't rely on setButtonText/GetUnixTimeOfStateSlot here. {
Button button = (Button) view; // Update the "last modified" time.
CharSequence time = DateUtils.getRelativeTimeSpanString(0, 0, DateUtils.MINUTE_IN_MILLIS); // The savestate most likely hasn't gotten saved to disk yet (it happens asynchronously),
button.setText(getString(R.string.emulation_state_slot, buttonIndex + 1, time)); // 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) private void setButtonText(Button button, int index)