test/activity/subclass_activity.rb in ruboto-0.10.2 vs test/activity/subclass_activity.rb in ruboto-0.11.0.rc.0
- old
+ new
@@ -2,11 +2,11 @@
ruboto_import_widgets :LinearLayout, :ListView, :TextView
class SubclassOfArrayAdapter < Java::AndroidWidget::ArrayAdapter
def getView(position, convert_view, parent)
- puts "IN get_view!!!"
+ puts 'IN get_view!!!'
@inflater ||= context.getSystemService(Context::LAYOUT_INFLATER_SERVICE)
row = convert_view ? convert_view : @inflater.inflate(mResource, nil)
row.findViewById(mFieldId).text = "[#{get_item(position)}]"
row
rescue Exception
@@ -19,10 +19,10 @@
class Java::AndroidWidget::ArrayAdapter
field_reader :mResource, :mFieldId
end
class SubclassActivity
- def on_create(bundle)
+ def onCreate(bundle)
super
setTitle File.basename(__FILE__).chomp('_activity.rb').split('_').map { |s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ')
adapter = SubclassOfArrayAdapter.new(self, android.R.layout.simple_list_item_1, AndroidIds::text1, ['Record one', 'Record two'])