Sha256: 1bfa5bcb8df1e477d209d399aaef2d729fe1ed42e94b2587ab733634c251988d

Contents?: true

Size: 770 Bytes

Versions: 6

Compression:

Stored size: 770 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::get_ruboto_core, :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

6 entries across 6 versions & 1 rubygems

Version Path
ruboto-0.9.0 test/handle_activity/image_button_and_button_activity.rb
ruboto-0.9.0.rc.1 test/handle_activity/image_button_and_button_activity.rb
ruboto-0.9.0.rc.0 test/handle_activity/image_button_and_button_activity.rb
ruboto-0.8.1 test/handle_activity/image_button_and_button_activity.rb
ruboto-0.8.0 test/handle_activity/image_button_and_button_activity.rb
ruboto-0.7.0 test/handle_activity/image_button_and_button_activity.rb