More robust Gyro toggle (#5104)

* Make toggling Gyro events more robust

Actually ask to turn it on/off depending on the setting, instead of a
blind toggle

A quick succession of suspend/resume events could otherwise leave it
in an unexpected state (i.e., off when it should have been on).
This commit is contained in:
NiLuJe
2019-07-01 17:12:24 +02:00
committed by GitHub
parent 64cc7e0827
commit 38e7975728
6 changed files with 28 additions and 13 deletions

View File

@@ -948,7 +948,7 @@ function ReaderGesture:gestureAction(action, ges)
self:onShowFLOnOff()
elseif action == "toggle_gsensor" then
G_reader_settings:flipNilOrFalse("input_ignore_gsensor")
Device:toggleGSensor()
Device:toggleGSensor(not G_reader_settings:isTrue("input_ignore_gsensor"))
self:onGSensorToggle()
elseif action == "toggle_page_flipping" then
if not self.ui.document.info.has_pages then