class MainActivity < Android::App::Activity include ViewGeneration def generate_screen root_view( horizontal_layout(:row0, text_view(:title, "a dark room")), horizontal_layout(:row1, hidden_button(:outside_button, "a silent forest"), hidden_button(:embark_button, "a dusty path") ), progress_bar(:light_fire_pb, "light_fire"), horizontal_layout(:row3, hidden_button(:supplies_button, "supplies"), hidden_button(:builder_button, "builder") ), horizontal_layout(:row4, hidden_button(:merchant_button, "merchant"), hidden_button(:workshop_button, "workshop") ), spacer() do |spacer_layout| spacer_layout.height = device_height * 0.35 end, history_view ) end def history_view horizontal_layout(:history_view, scroll_view(:scroll_view_history, text_view(:text_view_history, "") ) ) do |horizontal_layout| horizontal_layout.weight = 1 horizontal_layout.setMargins(10, 10, 10, 10) end end def onCreate() setContentView(generate_screen) end def root_view *views r = vertical_layout(:root, *views) r.setBackgroundColor(ViewState.black) r.setDrawingCacheQuality(1) r end def onClick view @views.keys.each do |k| if(@views[k].is_a? Array and @views[k].include? view) self.send(k.to_s + "_clicked") elsif(@views[k] == view) self.send(k.to_s + "_clicked") end end end end