Sha256: 41515857fa16a637acb0a02b2f0ad54adec85738f8cb5c5258a158170a0374fd

Contents?: true

Size: 759 Bytes

Versions: 7

Compression:

Stored size: 759 Bytes

Contents

require 'ruboto'

ruboto_import_widgets :Button, :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
      button :text => 'Button', :width => :wrap_content, :id => 44
      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.text = 'Image button pressed'
    elsif view.id == 44
      @text_view.text = 'Button pressed'
    end
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

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