Sha256: 3060a9e272c35718b4a7d4e7da28a74340bd07641c7dd8032668a8b604672bca

Contents?: true

Size: 1.27 KB

Versions: 17

Compression:

Stored size: 1.27 KB

Contents

STACK_DEPTH_SCRIPT = java.lang.Thread.current_thread.stack_trace.length.to_s

raise "Stack level: #{STACK_DEPTH_SCRIPT}" rescue puts $!.backtrace.join("\n")

require 'ruboto/widget'

ruboto_import_widgets :Button, :LinearLayout, :TextView

class StackActivity
  STACK_DEPTH_CLASS = java.lang.Thread.current_thread.stack_trace.length.to_s
  def onCreate(bundle)
    stack_depth_on_create = java.lang.Thread.current_thread.stack_trace.length.to_s
    super
    setTitle File.basename(__FILE__).chomp('_activity.rb').split('_').map { |s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ')

    self.content_view =
        linear_layout :orientation => :vertical, :gravity => android.view.Gravity::CENTER do
          stack_depth_linear_layout = java.lang.Thread.current_thread.stack_trace.length.to_s
          text_view :id => 42, :text => STACK_DEPTH_SCRIPT, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 43, :text => STACK_DEPTH_CLASS, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 44, :text => stack_depth_on_create, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 45, :text => stack_depth_linear_layout, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
        end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruboto-1.1.2 test/activity/stack_activity.rb
ruboto-1.1.1 test/activity/stack_activity.rb
ruboto-1.1.0 test/activity/stack_activity.rb
ruboto-1.0.3 test/activity/stack_activity.rb
ruboto-1.0.2 test/activity/stack_activity.rb
ruboto-1.0.1 test/activity/stack_activity.rb
ruboto-1.0.0 test/activity/stack_activity.rb
ruboto-0.16.0 test/activity/stack_activity.rb
ruboto-0.15.0 test/activity/stack_activity.rb
ruboto-0.14.0 test/activity/stack_activity.rb
ruboto-0.13.0 test/activity/stack_activity.rb
ruboto-0.12.0 test/activity/stack_activity.rb
ruboto-0.13.0.rc.0 test/activity/stack_activity.rb
ruboto-0.12.0.rc.0 test/activity/stack_activity.rb
ruboto-0.11.0 test/activity/stack_activity.rb
ruboto-0.11.0.rc.1 test/activity/stack_activity.rb
ruboto-0.11.0.rc.0 test/activity/stack_activity.rb