Sha256: ffc82bd2d7c561c996edb1d3e3b9941ac43221823cd299ae8b76a9d843784177

Contents?: true

Size: 768 Bytes

Versions: 6

Compression:

Stored size: 768 Bytes

Contents

require 'ruboto/activity'
require 'ruboto/widget'
require 'ruboto/util/toast'

ruboto_import_widgets :LinearLayout, :TextView

$activity.start_ruboto_activity do
  setTitle File.basename(__FILE__).chomp('_activity.rb').split('_').map{|s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ')

  def on_create(bundle)
    self.content_view =
    linear_layout :orientation => LinearLayout::VERTICAL do
      @text_view = text_view :text => 'What hath Matz wrought?', :id => 42
    end
  end

  def on_create_options_menu(menu)
    mi = menu.add('Test')
    mi.setIcon($package.R::drawable::get_ruboto_core)
    mi.set_on_menu_item_click_listener do |menu_item|
      @text_view.text = 'What hath Matz wrought!'
      toast 'Flipped a bit via butterfly'
    end
    true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruboto-0.9.0 test/block_def_activity/option_menu_activity.rb
ruboto-0.9.0.rc.1 test/block_def_activity/option_menu_activity.rb
ruboto-0.9.0.rc.0 test/block_def_activity/option_menu_activity.rb
ruboto-0.8.1 test/block_def_activity/option_menu_activity.rb
ruboto-0.8.0 test/block_def_activity/option_menu_activity.rb
ruboto-0.7.0 test/block_def_activity/option_menu_activity.rb