mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #1647 from chrox/fix_kv_refresh
fix some minor issues on Kindle Voyage
This commit is contained in:
@@ -4,10 +4,12 @@ local ffi = require("ffi")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
|
||||
local Device = Generic:new{
|
||||
model = "Android",
|
||||
hasKeys = yes,
|
||||
hasDPad = no,
|
||||
isAndroid = yes,
|
||||
firmware_rev = "none",
|
||||
display_dpi = ffi.C.AConfiguration_getDensity(android.app.config),
|
||||
|
||||
@@ -3,14 +3,17 @@ local util = require("ffi/util")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
|
||||
local Device = Generic:new{
|
||||
model = "Emulator",
|
||||
isEmulator = yes,
|
||||
hasKeyboard = yes,
|
||||
hasKeys = yes,
|
||||
hasDPad = yes,
|
||||
hasFrontlight = yes,
|
||||
isTouchDevice = yes,
|
||||
needsScreenRefreshAfterResume = no,
|
||||
}
|
||||
|
||||
function Device:init()
|
||||
|
||||
@@ -2,6 +2,7 @@ local Event = require("ui/event")
|
||||
local util = require("ffi/util")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
|
||||
local Device = {
|
||||
@@ -16,6 +17,7 @@ local Device = {
|
||||
-- hardware feature tests: (these are functions!)
|
||||
hasKeyboard = no,
|
||||
hasKeys = no,
|
||||
hasDPad = no,
|
||||
isTouchDevice = no,
|
||||
hasFrontlight = no,
|
||||
|
||||
@@ -33,6 +35,8 @@ local Device = {
|
||||
viewport = nil,
|
||||
-- enforce portrait orientation on display, no matter how configured at startup
|
||||
isAlwaysPortrait = no,
|
||||
-- needs full screen refresh when resumed from screensaver?
|
||||
needsScreenRefreshAfterResume = yes,
|
||||
}
|
||||
|
||||
function Device:new(o)
|
||||
@@ -131,7 +135,9 @@ end
|
||||
function Device:resume()
|
||||
local UIManager = require("ui/uimanager")
|
||||
UIManager:unschedule(self.suspend)
|
||||
self.screen:refreshFull()
|
||||
if self:needsScreenRefreshAfterResume() then
|
||||
self.screen:refreshFull()
|
||||
end
|
||||
self.screen_saver_mode = false
|
||||
self.powerd:refreshCapacity()
|
||||
end
|
||||
|
||||
@@ -2,6 +2,7 @@ local Generic = require("device/generic/device")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
|
||||
local Kindle = Generic:new{
|
||||
model = "Kindle",
|
||||
@@ -12,23 +13,27 @@ local Kindle2 = Kindle:new{
|
||||
model = "Kindle2",
|
||||
hasKeyboard = yes,
|
||||
hasKeys = yes,
|
||||
hasDPad = yes,
|
||||
}
|
||||
|
||||
local KindleDXG = Kindle:new{
|
||||
model = "KindleDXG",
|
||||
hasKeyboard = yes,
|
||||
hasKeys = yes,
|
||||
hasDPad = yes,
|
||||
}
|
||||
|
||||
local Kindle3 = Kindle:new{
|
||||
model = "Kindle3",
|
||||
hasKeyboard = yes,
|
||||
hasKeys = yes,
|
||||
hasDPad = yes,
|
||||
}
|
||||
|
||||
local Kindle4 = Kindle:new{
|
||||
model = "Kindle4",
|
||||
hasKeys = yes,
|
||||
hasDPad = yes,
|
||||
}
|
||||
|
||||
local KindleTouch = Kindle:new{
|
||||
@@ -67,6 +72,7 @@ local KindleVoyage = Kindle:new{
|
||||
hasKeys = yes,
|
||||
display_dpi = 300,
|
||||
touch_dev = "/dev/input/event1",
|
||||
needsScreenRefreshAfterResume = no,
|
||||
}
|
||||
|
||||
local KindlePaperWhite3 = Kindle:new{
|
||||
|
||||
@@ -68,7 +68,7 @@ function ButtonTable:init()
|
||||
self:addHorizontalSep()
|
||||
end
|
||||
end -- end for each button line
|
||||
if Device:hasKeys() then
|
||||
if Device:hasDPad() then
|
||||
self.layout = self.buttons
|
||||
self.layout[1][1]:onFocus()
|
||||
self.key_events.SelectByKeyPress = { {{"Press", "Enter"}} }
|
||||
|
||||
Reference in New Issue
Block a user