Skip to content

Commit

Permalink
isolate keepScreenOn and timeoutAnswer from each other
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjaySargam committed Jun 7, 2023
1 parent 043ded7 commit c369e77
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ abstract class AbstractFlashcardViewer :
if (mGesturesEnabled) {
mGestureProcessor.init(preferences)
}
if (preferences.getBoolean("keepScreenOn", false)) {
if (preferences.getBoolean("timeoutAnswer", false) || preferences.getBoolean("keepScreenOn", false)) {
this.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
return preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ class ReviewingSettingsFragment : SettingsFragment() {
launchCatchingTask { setDayOffset(requireContext(), newValue as Int) }
}
}
// Automatic display answer
requirePreference<SwitchPreference>(R.string.timeout_answer_preference).setOnPreferenceChangeListener { newValue ->
// Enable `Keep screen on` along with the automatic display answer preference
if (newValue == true) {
requirePreference<SwitchPreference>(R.string.keep_screen_on_preference).isChecked = true
}
}

/**
* Timeout answer
Expand Down

0 comments on commit c369e77

Please sign in to comment.