Permalink
Browse files

Updated for ruboto 0.10.X

  • Loading branch information...
1 parent 9be768a commit 16454dd12b497bdf234e6108e2d61dd1406fa28d @rscottm rscottm committed Dec 8, 2012
Showing with 18 additions and 10 deletions.
  1. +18 −10 assets/demo-scripts/demo-ruboto-core-sample.rb
@@ -12,20 +12,28 @@
ruboto_import_widgets :Button, :LinearLayout, :TextView
-$activity.start_ruboto_activity "$sample_activity" do
- setTitle 'This is the Title'
-
+class SampleActivity
def on_create(bundle)
+ super
+ set_title 'Domo arigato, Mr Ruboto!'
+
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
+ linear_layout :orientation => :vertical do
+ @text_view = text_view :text => 'What hath Matz wrought?', :id => 42, :width => :match_parent,
+ :gravity => :center, :text_size => 48.0
+ button :text => 'M-x butterfly', :width => :match_parent, :id => 43, :on_click_listener => proc { butterfly }
end
+ rescue
+ puts "Exception creating activity: #{$!}"
+ puts $!.backtrace.join("\n")
end
- @handle_click = proc do |view|
- @text_view.text = 'What hath Matz wrought!'
- toast 'Flipped a bit via butterfly'
+ private
+
+ def butterfly
+ @text_view.text = 'What hath Matz wrought!'
+ toast 'Flipped a bit via butterfly'
end
end
+
+$irb.start_ruboto_activity :class_name => "SampleActivity"

0 comments on commit 16454dd

Please sign in to comment.