Skip to content

Commit

Permalink
refactor: extract Collection to parameter
Browse files Browse the repository at this point in the history
The method is always called from onCollectionLoaded

so we can remove a dependency
  • Loading branch information
david-allison authored and mikehardy committed Oct 13, 2021
1 parent 3b18e99 commit 8d4d901
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ protected void onCollectionLoaded(Collection col) {

registerExternalStorageListener();

restoreCollectionPreferences();
restoreCollectionPreferences(col);

initLayout();

Expand Down Expand Up @@ -1741,11 +1741,11 @@ protected SharedPreferences restorePreferences() {
}


protected void restoreCollectionPreferences() {
protected void restoreCollectionPreferences(Collection col) {

// These are preferences we pull out of the collection instead of SharedPreferences
try {
mShowNextReviewTime = getCol().get_config_boolean("estTimes");
mShowNextReviewTime = col.get_config_boolean("estTimes");

// Dynamic don't have review options; attempt to get deck-specific auto-advance options
// but be prepared to go with all default if it's a dynamic deck
Expand Down
6 changes: 3 additions & 3 deletions AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,9 @@ protected void initControls() {
}
}

protected void restoreCollectionPreferences() {
super.restoreCollectionPreferences();
mShowRemainingCardCount = getCol().get_config_boolean("dueCounts");
protected void restoreCollectionPreferences(Collection col) {
super.restoreCollectionPreferences(col);
mShowRemainingCardCount = col.get_config_boolean("dueCounts");
}

@Override
Expand Down

0 comments on commit 8d4d901

Please sign in to comment.