local oo = require("loop.simple") local AppletMeta = require("jive.AppletMeta") local Icon = require("jive.ui.Icon") local Surface = require("jive.ui.Surface") local Timer = require("jive.ui.Timer") local math = require("math") local appletManager = appletManager local jiveMain = jiveMain module(...) oo.class(_M, AppletMeta) function jiveVersion(self) return 1, 1 end function registerApplet(self) local icon = Icon("icon") Timer(300, function() local size = jiveMain:getSkinParam('THUMB_SIZE') local srf = Surface:newRGB(size, size) srf:filledRectangle(0, 0, size, size, math.random(0, 0xFFFFFF) << 8 | 0xFF) icon:setValue(srf) end):start() self.menu = self:menuItem('appletRedrawTest', 'home', 'Redraw Test Item', nil, 50, { icon = icon }, "hm_radio") jiveMain:addItem(self.menu) end