detect screen DPI for android devices

pull/611/head
chrox 10 years ago
parent 5aa8eb52da
commit b2e0d2a735

@ -1,3 +1,4 @@
local Blitbuffer = require("ffi/blitbuffer")
local Geom = require("ui/geometry")
local DEBUG = require("dbg")
@ -80,6 +81,10 @@ function Screen:getDPI()
self.dpi = 265
elseif model == "Kobo_pixie" then
self.dpi = 200
elseif util.isAndroid() then
local android = require("android")
local ffi = require("ffi")
self.dpi = ffi.C.AConfiguration_getDensity(android.app.config)
else
self.dpi = 167
end

Loading…
Cancel
Save