mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
refactor(readerfooter): optimization and bug fixes
* avoid unnecessary initialization * really fix the crash caused by autoRefreshTime.... * responsive progress bar layout
This commit is contained in:
@@ -23,17 +23,22 @@ function ReaderFlipping:init()
|
||||
end
|
||||
|
||||
function ReaderFlipping:resetLayout()
|
||||
self[1].dimen.w = Screen:getWidth()
|
||||
local new_screen_width = Screen:getWidth()
|
||||
if new_screen_width == self._last_screen_width then return end
|
||||
local new_screen_height = Screen:getHeight()
|
||||
self._last_screen_width = new_screen_width
|
||||
|
||||
self[1].dimen.w = new_screen_width
|
||||
if Device:isTouchDevice() then
|
||||
self.ges_events = {
|
||||
Tap = {
|
||||
GestureRange:new{
|
||||
ges = "tap",
|
||||
range = Geom:new{
|
||||
x = Screen:getWidth()*DTAP_ZONE_FLIPPING.x,
|
||||
y = Screen:getHeight()*DTAP_ZONE_FLIPPING.y,
|
||||
w = Screen:getWidth()*DTAP_ZONE_FLIPPING.w,
|
||||
h = Screen:getHeight()*DTAP_ZONE_FLIPPING.h
|
||||
x = new_screen_width*DTAP_ZONE_FLIPPING.x,
|
||||
y = new_screen_height*DTAP_ZONE_FLIPPING.y,
|
||||
w = new_screen_width*DTAP_ZONE_FLIPPING.w,
|
||||
h = new_screen_height*DTAP_ZONE_FLIPPING.h
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user