Sha256: 995d9bd90e9a60c559d966fcc63c01b7a6228c28574687d584df066e8e51df06

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

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

ruboto_import_widgets :Button, :LinearLayout, :TextView

$activity.start_ruboto_activity "$sample_activity" do
  setTitle 'This is the Title'

  def on_create(bundle)
    self.content_view =
        linear_layout(:orientation => :vertical) do
          @text_view = text_view :text => 'What hath Matz wrought?', :id => 42
          button :text => 'M-x butterfly', :width => :wrap_content, :id => 43,
                    :on_click_listener => @handle_click
        end
  end

  @handle_click = proc do |view|
      @text_view.text = 'What hath Matz wrought!'
      toast 'Flipped a bit via butterfly'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruboto-0.6.0 assets/samples/sample_activity.rb
ruboto-0.5.4 assets/samples/sample_activity.rb
ruboto-0.5.3 assets/samples/sample_activity.rb