New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes #113

Open
wants to merge 6 commits into
base: master
from
Prev

[issue-94] Persist history setting correctly on device rotation.

  • Loading branch information...
xaviershay committed Dec 22, 2017
commit a72031206eb91fdac2c756b6c8a83af8a2a45bc7
@@ -196,18 +196,32 @@ public void run() {
break;
case ACTION_HISTORY_TIMES_SHOWN:
history = true;
setHistory(true);
reloadList();
break;
case ACTION_SESSION_TIMES_SHOWN:
history = false;
setHistory(false);
reloadList();
break;
}
}
};
private void setHistory(boolean value) {
history = value;
// Need to persist history to fragment arguments so that it is correctly persisted on
// re-create (such as when device is rotated).
Bundle arguments = getArguments();
// Cargo-culted this null check from onCreate. Unsure how this could actually be null.
if (arguments != null) {
arguments.putBoolean(HISTORY, history);
setArguments(arguments);
}
}
// Receives broadcasts about UI interactions that require actions to be taken.
private TTFragmentBroadcastReceiver mUIInteractionReceiver
= new TTFragmentBroadcastReceiver(this, CATEGORY_UI_INTERACTIONS) {
ProTip! Use n and p to navigate between commits in a pull request.