local monarch = require "monarch.monarch" go.property("screen_proxy", msg.url("#collectionproxy")) go.property("screen_id", hash("")) go.property("popup", false) go.property("transition_url", msg.url()) go.property("focus_url", msg.url()) function init(self) monarch.register(self.screen_id, self.screen_proxy, self.popup, self.transition_url, self.focus_url) end function final(self) monarch.unregister(self.screen_id) end function on_message(self, message_id, message, sender) if message_id == hash("show") then monarch.show(self.screen_id, { clear = message.clear }) elseif message_id == hash("hide") then monarch.back() elseif message_id == hash("back") then monarch.back() elseif message_id == hash("transition_show_in") or message_id == hash("transition_show_out") or message_id == hash("transition_back_in") or message_id == hash("transition_back_out") then msg.post(sender, "transition_done") else monarch.on_message(message_id, message, sender) end end