ReaderGesture: cleanup (#6292)

convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
This commit is contained in:
yparitcher
2020-07-12 14:47:49 -04:00
committed by GitHub
parent f4dad2fae8
commit 70f89c4df1
26 changed files with 585 additions and 595 deletions

View File

@@ -166,7 +166,7 @@ describe("Readerfooter module", function()
}
local footer = readerui.view.footer
footer:onPageUpdate(1)
footer:updateFooter()
footer:onUpdateFooter()
local timeinfo = footer.textGeneratorMap.time(footer)
local page_count = readerui.document:getPageCount()
-- stats has not been initialized here, so we get na TB and TC
@@ -184,7 +184,7 @@ describe("Readerfooter module", function()
document = DocumentRegistry:openDocument(sample_pdf),
}
local footer = readerui.view.footer
readerui.view.footer:updateFooter()
readerui.view.footer:onUpdateFooter()
local timeinfo = readerui.view.footer.textGeneratorMap.time(footer)
assert.are.same('1 / 2 | '..timeinfo..' | ⇒ 1 | 0% | ⤠ 50% | ⏳ na | ⤻ na',
readerui.view.footer.footer_text.text)
@@ -203,7 +203,7 @@ describe("Readerfooter module", function()
local footer = readerui.view.footer
footer:addToMainMenu(fake_menu)
footer:resetLayout()
footer:updateFooter()
footer:onUpdateFooter()
local timeinfo = footer.textGeneratorMap.time(footer)
assert.are.same('1 / 2 | '..timeinfo..' | ⇒ 1 | 0% | ⤠ 50% | ⏳ na | ⤻ na',
footer.footer_text.text)
@@ -295,7 +295,7 @@ describe("Readerfooter module", function()
}
local footer = readerui.view.footer
local horizontal_margin = Screen:scaleBySize(10)*2
footer:updateFooter()
footer:onUpdateFooter()
assert.is.same(354, footer.text_width)
assert.is.same(600, footer.progress_bar.width
+ footer.text_width