Skip to content

Commit

Permalink
Keep track of whether or not spell slots were opened from the FAB on …
Browse files Browse the repository at this point in the history
…a rotation.
  • Loading branch information
Carifio24 committed Feb 20, 2023
1 parent 06e8382 commit d4f45f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/dnd/jon/spellbook/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private enum WindowStatus {
private static final String FILTER_VISIBLE_KEY = "FILTER_VISIBLE";
private static final String WINDOW_STATUS_KEY = "WINDOW_STATUS";
private static final String PREV_WINDOW_STATUS_KEY = "PREV_WINDOW_STATUS";
private static final String SLOTS_OPENED_FAB_KEY = "SLOTS_OPENED_FAB";

// ViewModel stuff
private ViewModelProvider.Factory viewModelFactory;
Expand Down Expand Up @@ -220,6 +221,7 @@ protected void onCreate(final Bundle savedInstanceState) {
savedInstanceState.getBoolean(FILTER_VISIBLE_KEY, false);
windowStatus = (WindowStatus) savedInstanceState.getSerializable(WINDOW_STATUS_KEY);
prevWindowStatus = (WindowStatus) savedInstanceState.getSerializable(PREV_WINDOW_STATUS_KEY);
openedSpellSlotsFromFAB = savedInstanceState.getBoolean(SLOTS_OPENED_FAB_KEY, false);
}

// Set the toolbar as the app bar for the activity
Expand Down Expand Up @@ -622,6 +624,7 @@ public void onSaveInstanceState(@NonNull Bundle outState) {
outState.putBoolean(FILTER_VISIBLE_KEY, filterVisible);
outState.putSerializable(WINDOW_STATUS_KEY, windowStatus);
outState.putSerializable(PREV_WINDOW_STATUS_KEY, prevWindowStatus);
outState.putBoolean(SLOTS_OPENED_FAB_KEY, openedSpellSlotsFromFAB);
viewModel.saveCurrentProfile();
viewModel.saveSettings();
}
Expand Down

0 comments on commit d4f45f9

Please sign in to comment.