I'm very new to Android development (therefore to Ruboto), I have the following code in an attempt to display a text field, a button, and a progress bar. I would like to turn this progress bar into a horizontal progress bar:
require 'ruboto/widget'
require 'ruboto/util/toast'
ruboto_import_widgets :Button, :LinearLayout, :TextView, :ProgressBar
class SplashActivity
def onCreate(bundle)
super
set_title 'some title here'
self.content_view =
linear_layout :orientation => :vertical do
@text_view = text_view :text => 'sample text.', :id => 42,
:layout => {:width => :match_parent},
:gravity => :center, :text_size => 18.0
button :text => 'foo',
:layout => {:width => :match_parent},
:id => 43, :on_click_listener => proc { bar }
progress_bar
end
rescue Exception
puts "Exception creating activity: #{$!}"
puts $!.backtrace.join("\n")
end
private
def bar
@text_view.text = 'things change.'
toast 'cha-ching!'
end
end
All elements display as expected. The progress_bar
is the indeterminate mode by default, what attributes are needed to convert the progress_bar
into horizontal?
I have found Ruboto has been super easy to pick up, I just cannot find enough API documentation for customized controls. A lot of the functionality I'm looking for in the application I'm developing could be found in the GitHub source, but a lot is commented out. Is there something I am overlooking for detailed API documentation?