Sha256: 37e5aee4fb30d9cdb882e09aaba850eae9c60ba014d033c1371b78303aa3bf16

Contents?: true

Size: 827 Bytes

Versions: 6

Compression:

Stored size: 827 Bytes

Contents

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

ruboto_import_widgets :ImageButton, :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)
    click_handler = proc do |view|
      @text_view.setText 'What hath Matz wrought!'
      toast 'Flipped a bit via butterfly'
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

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