Sha256: 4bbd2974ab83134627f203b1c1d826a17611ae238eaf2463a28e74e0c7080d64

Contents?: true

Size: 663 Bytes

Versions: 7

Compression:

Stored size: 663 Bytes

Contents

require 'ruboto'

ruboto_import_widgets :ImageButton, :LinearLayout, :TextView

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

  setup_content do
    linear_layout :orientation => LinearLayout::VERTICAL do
      @text_view = text_view :text => 'What hath Matz wrought?', :id => 42
      image_button :image_resource => $package.R::drawable::icon, :width => :wrap_content, :id => 43
    end
  end

  handle_click do |view|
    if view.id == 43
      @text_view.setText 'What hath Matz wrought!'
      toast 'Flipped a bit via butterfly'
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
ruboto-0.6.0 test/activity/image_button_activity.rb
ruboto-0.5.4 test/activity/image_button_activity.rb
ruboto-0.5.3 test/activity/image_button_activity.rb
ruboto-0.5.2 test/activity/image_button_activity.rb
ruboto-core-0.5.1 test/activity/image_button_activity.rb
ruboto-core-0.4.1.rc.4 test/activity/image_button_activity.rb
ruboto-core-0.4.0 test/activity/image_button_activity.rb